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

Tests: Updated the tests to have same dropdown state for all unit tests.

Note, this changes the first expected value in  "should bind to insertTable command" TC - since the dropdown is open by default, the button should be marked as "on" (active).
Marek Lewandowski 6 лет назад
Родитель
Сommit
d9d23f9478
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      packages/ckeditor5-table/tests/tableui.js

+ 2 - 3
packages/ckeditor5-table/tests/tableui.js

@@ -53,6 +53,7 @@ describe( 'TableUI', () => {
 
 
 		beforeEach( () => {
 		beforeEach( () => {
 			insertTable = editor.ui.componentFactory.create( 'insertTable' );
 			insertTable = editor.ui.componentFactory.create( 'insertTable' );
+			insertTable.isOpen = true; // Dropdown is lazy loaded, so make sure its open (#6193).
 		} );
 		} );
 
 
 		it( 'should register insertTable button', () => {
 		it( 'should register insertTable button', () => {
@@ -65,7 +66,7 @@ describe( 'TableUI', () => {
 			const command = editor.commands.get( 'insertTable' );
 			const command = editor.commands.get( 'insertTable' );
 
 
 			command.isEnabled = true;
 			command.isEnabled = true;
-			expect( insertTable.buttonView.isOn ).to.be.false;
+			expect( insertTable.buttonView.isOn ).to.be.true;
 			expect( insertTable.buttonView.isEnabled ).to.be.true;
 			expect( insertTable.buttonView.isEnabled ).to.be.true;
 
 
 			command.isEnabled = false;
 			command.isEnabled = false;
@@ -75,8 +76,6 @@ describe( 'TableUI', () => {
 		it( 'should execute insertTable command on button execute event', () => {
 		it( 'should execute insertTable command on button execute event', () => {
 			const executeSpy = testUtils.sinon.spy( editor, 'execute' );
 			const executeSpy = testUtils.sinon.spy( editor, 'execute' );
 
 
-			insertTable.isOpen = true;
-
 			const tableSizeView = insertTable.panelView.children.first;
 			const tableSizeView = insertTable.panelView.children.first;
 
 
 			tableSizeView.rows = 2;
 			tableSizeView.rows = 2;