|
@@ -34,25 +34,25 @@ describe( 'CodeBlockCommand', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
describe( '#value', () => {
|
|
describe( '#value', () => {
|
|
|
- it( 'should be true when the first selected element is a codeBlock element #1', () => {
|
|
|
|
|
|
|
+ it( 'should be true when the first selected element is a codeBlock element - selection inside code block', () => {
|
|
|
setModelData( model, '<codeBlock language="foo">f[]oo</codeBlock>' );
|
|
setModelData( model, '<codeBlock language="foo">f[]oo</codeBlock>' );
|
|
|
|
|
|
|
|
expect( command.value ).to.equal( 'foo' );
|
|
expect( command.value ).to.equal( 'foo' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- it( 'should be true when the first selected element is a codeBlock element', () => {
|
|
|
|
|
|
|
+ it( 'should be true when the first selected element is a codeBlock element - other blocks in selection are not code block', () => {
|
|
|
setModelData( model, '<codeBlock language="foo">f[oo</codeBlock><paragraph>ba]r</paragraph>' );
|
|
setModelData( model, '<codeBlock language="foo">f[oo</codeBlock><paragraph>ba]r</paragraph>' );
|
|
|
|
|
|
|
|
expect( command.value ).to.equal( 'foo' );
|
|
expect( command.value ).to.equal( 'foo' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- it( 'should be false when the first selected element is not a code block #1', () => {
|
|
|
|
|
|
|
+ it( 'should be false when the first selected element is not a code block - all blocks are not code block', () => {
|
|
|
setModelData( model, '<paragraph>f[]oo</paragraph>' );
|
|
setModelData( model, '<paragraph>f[]oo</paragraph>' );
|
|
|
|
|
|
|
|
expect( command.value ).to.equal( false );
|
|
expect( command.value ).to.equal( false );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
- it( 'should be false when the first selected element is not a code block #2', () => {
|
|
|
|
|
|
|
+ it( 'should be false when the first selected element is not a code block - selection ends in code block', () => {
|
|
|
setModelData( model, '<paragraph>f[oo</paragraph><codeBlock language="foo">ba]r</codeBlock>' );
|
|
setModelData( model, '<paragraph>f[oo</paragraph><codeBlock language="foo">ba]r</codeBlock>' );
|
|
|
|
|
|
|
|
expect( command.value ).to.equal( false );
|
|
expect( command.value ).to.equal( false );
|