|
@@ -31,7 +31,7 @@ describe( 'Command', () => {
|
|
|
|
|
|
|
|
it( 'sets the state properties', () => {
|
|
it( 'sets the state properties', () => {
|
|
|
expect( command.value ).to.be.undefined;
|
|
expect( command.value ).to.be.undefined;
|
|
|
- expect( command.isEnabled ).to.be.true;
|
|
|
|
|
|
|
+ expect( command.isEnabled ).to.be.false;
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'adds a listener which refreshed the command on editor.document#changesDone', () => {
|
|
it( 'adds a listener which refreshed the command on editor.document#changesDone', () => {
|
|
@@ -61,7 +61,7 @@ describe( 'Command', () => {
|
|
|
|
|
|
|
|
command.on( 'change:isEnabled', spy );
|
|
command.on( 'change:isEnabled', spy );
|
|
|
|
|
|
|
|
- command.isEnabled = false;
|
|
|
|
|
|
|
+ command.isEnabled = true;
|
|
|
|
|
|
|
|
expect( spy.calledOnce ).to.be.true;
|
|
expect( spy.calledOnce ).to.be.true;
|
|
|
} );
|
|
} );
|
|
@@ -73,6 +73,8 @@ describe( 'Command', () => {
|
|
|
|
|
|
|
|
command.on( 'execute', spy );
|
|
command.on( 'execute', spy );
|
|
|
|
|
|
|
|
|
|
+ command.isEnabled = true;
|
|
|
|
|
+
|
|
|
command.execute( 1, 2 );
|
|
command.execute( 1, 2 );
|
|
|
|
|
|
|
|
expect( spy.calledOnce ).to.be.true;
|
|
expect( spy.calledOnce ).to.be.true;
|
|
@@ -95,8 +97,6 @@ describe( 'Command', () => {
|
|
|
command.on( 'execute', spyHighest, { priority: 'highest' } );
|
|
command.on( 'execute', spyHighest, { priority: 'highest' } );
|
|
|
command.on( 'execute', spyHigh, { priority: 'high' } );
|
|
command.on( 'execute', spyHigh, { priority: 'high' } );
|
|
|
|
|
|
|
|
- command.isEnabled = false;
|
|
|
|
|
-
|
|
|
|
|
command.execute();
|
|
command.execute();
|
|
|
|
|
|
|
|
expect( spyExecute.called ).to.be.false;
|
|
expect( spyExecute.called ).to.be.false;
|
|
@@ -107,8 +107,6 @@ describe( 'Command', () => {
|
|
|
|
|
|
|
|
describe( 'refresh()', () => {
|
|
describe( 'refresh()', () => {
|
|
|
it( 'sets isEnabled to true', () => {
|
|
it( 'sets isEnabled to true', () => {
|
|
|
- command.isEnabled = false;
|
|
|
|
|
-
|
|
|
|
|
command.refresh();
|
|
command.refresh();
|
|
|
|
|
|
|
|
expect( command.isEnabled ).to.be.true;
|
|
expect( command.isEnabled ).to.be.true;
|