Przeglądaj źródła

Tests: changed Link tests to be more accurate and not base on default command state.

Szymon Cofalik 9 lat temu
rodzic
commit
a7432ef3a4
1 zmienionych plików z 5 dodań i 3 usunięć
  1. 5 3
      packages/ckeditor5-link/tests/link.js

+ 5 - 3
packages/ckeditor5-link/tests/link.js

@@ -67,6 +67,7 @@ describe( 'Link', () => {
 			const model = linkButton.model;
 			const command = editor.commands.get( 'link' );
 
+			command.isEnabled = true;
 			expect( model.isEnabled ).to.be.true;
 
 			command.isEnabled = false;
@@ -127,10 +128,11 @@ describe( 'Link', () => {
 			const model = unlinkButton.model;
 			const command = editor.commands.get( 'unlink' );
 
-			expect( model.isEnabled ).to.false;
-
 			command.isEnabled = true;
-			expect( model.isEnabled ).to.true;
+			expect( model.isEnabled ).to.be.true;
+
+			command.isEnabled = false;
+			expect( model.isEnabled ).to.be.false;
 		} );
 
 		it( 'should execute unlink command on unlinkButton#model execute event', () => {