Browse Source

Added missing test.

Piotrek Koszuliński 9 years ago
parent
commit
8ddd64a061
1 changed files with 14 additions and 1 deletions
  1. 14 1
      tests/creator/creator.js

+ 14 - 1
tests/creator/creator.js

@@ -195,7 +195,7 @@ describe( 'Creator', () => {
 		} );
 	} );
 
-	describe( '_restoreElement', () => {
+	describe( '_restoreElements', () => {
 		it( 'should restore all elements', () => {
 			const el1 = editor.elements.get( 'first' );
 			const replacement1 = document.createElement( 'div' );
@@ -211,5 +211,18 @@ describe( 'Creator', () => {
 			expect( replacement2.parentNode ).to.be.null;
 			expect( el2.style.display ).to.not.equal( 'none' );
 		} );
+
+		it( 'should not try to remove replacement elements', () => {
+			const el1 = editor.elements.get( 'first' );
+			const el2 = editor.elements.get( 'second' );
+
+			creator._replaceElement( el1 );
+			creator._replaceElement( el2 );
+
+			creator._restoreElements();
+
+			expect( el1.style.display ).to.not.equal( 'none' );
+			expect( el2.style.display ).to.not.equal( 'none' );
+		} );
 	} );
 } );