8
0
Просмотр исходного кода

Added tests for ContainerElement and AttributeElement.

Piotr Jasiun 9 лет назад
Родитель
Сommit
ad1289f15d

+ 25 - 0
packages/ckeditor5-engine/tests/treeview/attributeelement.js

@@ -0,0 +1,25 @@
+/**
+ * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* bender-tags: treeview */
+
+'use strict';
+
+import AttributeElement from '/ckeditor5/engine/treeview/attributeelement.js';
+import Element from '/ckeditor5/engine/treeview/element.js';
+import { DEFAULT_PRIORITY } from '/ckeditor5/engine/treeview/attributeelement.js';
+
+describe( 'AttributeElement', () => {
+	describe( 'constructor', () => {
+		it( 'should create element with default priority', () => {
+			const el = new AttributeElement( 'strong' );
+
+			expect( el ).to.be.an.instanceof( AttributeElement );
+			expect( el ).to.be.an.instanceof( Element );
+			expect( el ).to.have.property( 'name' ).that.equals( 'strong' );
+			expect( el ).to.have.property( 'priority' ).that.equals( DEFAULT_PRIORITY );
+		} );
+	} );
+} );

+ 23 - 0
packages/ckeditor5-engine/tests/treeview/containerelement.js

@@ -0,0 +1,23 @@
+/**
+ * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* bender-tags: treeview */
+
+'use strict';
+
+import ContainerElement from '/ckeditor5/engine/treeview/containerelement.js';
+import Element from '/ckeditor5/engine/treeview/element.js';
+
+describe( 'ContainerElement', () => {
+	describe( 'constructor', () => {
+		it( 'should create element with default priority', () => {
+			const el = new ContainerElement( 'p' );
+
+			expect( el ).to.be.an.instanceof( ContainerElement );
+			expect( el ).to.be.an.instanceof( Element );
+			expect( el ).to.have.property( 'name' ).that.equals( 'p' );
+		} );
+	} );
+} );