|
|
@@ -98,6 +98,22 @@ describe( 'Command', () => {
|
|
|
|
|
|
expect( editor.something ).to.false;
|
|
|
} );
|
|
|
+
|
|
|
+ it( 'stops beforeChange event to force disabled and not affect change event', () => {
|
|
|
+ const beforeChangeSpy = sinon.spy();
|
|
|
+ const changeSpy = sinon.spy();
|
|
|
+
|
|
|
+ command.isEnabled = true;
|
|
|
+ editor.isReadOnly = false;
|
|
|
+
|
|
|
+ command.on( 'beforeChange', beforeChangeSpy );
|
|
|
+ command.on( 'change', changeSpy );
|
|
|
+
|
|
|
+ editor.isReadOnly = true;
|
|
|
+
|
|
|
+ sinon.assert.notCalled( beforeChangeSpy );
|
|
|
+ sinon.assert.calledOnce( changeSpy );
|
|
|
+ } );
|
|
|
} );
|
|
|
|
|
|
describe( 'execute()', () => {
|