attribute.js 793 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* bender-tags: treemodel */
  6. 'use strict';
  7. import Attribute from '/ckeditor5/core/treemodel/attribute.js';
  8. describe( 'Attribute', () => {
  9. describe( 'constructor', () => {
  10. it( 'should create attribute', () => {
  11. let attr = new Attribute( 'foo', 'bar' );
  12. expect( attr ).to.have.property( 'key' ).that.equals( 'foo' );
  13. expect( attr ).to.have.property( 'value' ).that.equals( 'bar' );
  14. } );
  15. it( 'should create equal instance even if object has different order', () => {
  16. let attr1 = new Attribute( 'foo', { a: 1, b: 2 } );
  17. let attr2 = new Attribute( 'foo', { b: 2, a: 1 } );
  18. expect( attr1.isEqual( attr2 ) ).to.be.true;
  19. } );
  20. } );
  21. } );