|
@@ -25,9 +25,7 @@ describe( 'createButtonDropdown', () => {
|
|
|
return button;
|
|
return button;
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- model = new Model( {
|
|
|
|
|
- label: 'foo'
|
|
|
|
|
- } );
|
|
|
|
|
|
|
+ model = new Model( { isVertical: true } );
|
|
|
|
|
|
|
|
view = createButtonDropdown( model, buttonViews, locale );
|
|
view = createButtonDropdown( model, buttonViews, locale );
|
|
|
view.render();
|
|
view.render();
|
|
@@ -156,7 +154,7 @@ describe( 'createButtonDropdown', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
describe( 'icon', () => {
|
|
describe( 'icon', () => {
|
|
|
- it( 'should be set to first button', () => {
|
|
|
|
|
|
|
+ it( 'should be set to first button\'s icon if no defaultIcon defined', () => {
|
|
|
expect( view.buttonView.icon ).to.equal( view.buttonGroupView.items.get( 0 ).icon );
|
|
expect( view.buttonView.icon ).to.equal( view.buttonGroupView.items.get( 0 ).icon );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -170,6 +168,27 @@ describe( 'createButtonDropdown', () => {
|
|
|
|
|
|
|
|
expect( view.buttonView.icon ).to.equal( view.buttonGroupView.items.get( 0 ).icon );
|
|
expect( view.buttonView.icon ).to.equal( view.buttonGroupView.items.get( 0 ).icon );
|
|
|
} );
|
|
} );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'should be set to defaultIcon if defined and on button is on', () => {
|
|
|
|
|
+ const model = new Model( { defaultIcon: 'baz' } );
|
|
|
|
|
+
|
|
|
|
|
+ view = createButtonDropdown( model, buttonViews, locale );
|
|
|
|
|
+ view.render();
|
|
|
|
|
+
|
|
|
|
|
+ expect( view.buttonView.icon ).to.equal( 'baz' );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
|
|
+ it( 'should not bind icons if staticIcon is set', () => {
|
|
|
|
|
+ const model = new Model( { defaultIcon: 'baz', staticIcon: true } );
|
|
|
|
|
+
|
|
|
|
|
+ view = createButtonDropdown( model, buttonViews, locale );
|
|
|
|
|
+ view.render();
|
|
|
|
|
+
|
|
|
|
|
+ expect( view.buttonView.icon ).to.equal( 'baz' );
|
|
|
|
|
+ view.buttonGroupView.items.get( 1 ).isOn = true;
|
|
|
|
|
+
|
|
|
|
|
+ expect( view.buttonView.icon ).to.equal( 'baz' );
|
|
|
|
|
+ } );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|