|
|
@@ -14,7 +14,7 @@ import BlockQuoteEditing from '@ckeditor/ckeditor5-block-quote/src/blockquoteedi
|
|
|
import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';
|
|
|
import { getData as getModelData, setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
|
|
|
|
|
|
-describe.only( 'CodeBlockCommand', () => {
|
|
|
+describe( 'CodeBlockCommand', () => {
|
|
|
let editor, model, command;
|
|
|
|
|
|
beforeEach( () => {
|
|
|
@@ -232,6 +232,22 @@ describe.only( 'CodeBlockCommand', () => {
|
|
|
|
|
|
expect( getModelData( model ) ).to.equal( '<codeBlock language="plaintext">f[o]o</codeBlock>' );
|
|
|
} );
|
|
|
+
|
|
|
+ it( 'should allow setting the language of the new block', () => {
|
|
|
+ setModelData( model, '<paragraph>f[o]o</paragraph>' );
|
|
|
+
|
|
|
+ command.execute( { language: 'css' } );
|
|
|
+
|
|
|
+ expect( getModelData( model ) ).to.equal( '<codeBlock language="css">f[o]o</codeBlock>' );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'should allow changing the language of the existing block', () => {
|
|
|
+ setModelData( model, '<codeBlock language="plaintext">f[o]o</codeBlock>' );
|
|
|
+
|
|
|
+ command.execute( { language: 'css', forceValue: true } );
|
|
|
+
|
|
|
+ expect( getModelData( model ) ).to.equal( '<codeBlock language="css">f[o]o</codeBlock>' );
|
|
|
+ } );
|
|
|
} );
|
|
|
|
|
|
describe( 'BlockQuote integration', () => {
|