Browse Source

Code style: move markdown integration tests to codeblock-integration.js.

Maciej Gołaszewski 5 years ago
parent
commit
5552643826
1 changed files with 15 additions and 14 deletions
  1. 15 14
      packages/ckeditor5-code-block/tests/codeblock-integration.js

+ 15 - 14
packages/ckeditor5-code-block/tests/markdown.js → packages/ckeditor5-code-block/tests/codeblock-integration.js

@@ -3,17 +3,16 @@
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
  */
 
 
-import CodeBlockEditing from '../src/codeblockediting';
-
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
 import Enter from '@ckeditor/ckeditor5-enter/src/enter';
 import Enter from '@ckeditor/ckeditor5-enter/src/enter';
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import GFMDataProcessor from '@ckeditor/ckeditor5-markdown-gfm/src/gfmdataprocessor';
 import GFMDataProcessor from '@ckeditor/ckeditor5-markdown-gfm/src/gfmdataprocessor';
-
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 
 
+import CodeBlockEditing from '../src/codeblockediting';
+
 // A simple plugin that enables the GFM data processor.
 // A simple plugin that enables the GFM data processor.
-class Markdown extends Plugin {
+class CodeBlockIntegration extends Plugin {
 	constructor( editor ) {
 	constructor( editor ) {
 		super( editor );
 		super( editor );
 		editor.data.processor = new GFMDataProcessor( editor.data.viewDocument );
 		editor.data.processor = new GFMDataProcessor( editor.data.viewDocument );
@@ -23,21 +22,23 @@ class Markdown extends Plugin {
 function getEditor( initialData = '' ) {
 function getEditor( initialData = '' ) {
 	return ClassicTestEditor
 	return ClassicTestEditor
 		.create( initialData, {
 		.create( initialData, {
-			plugins: [ Markdown, CodeBlockEditing, Enter, Paragraph ]
+			plugins: [ CodeBlockIntegration, CodeBlockEditing, Enter, Paragraph ]
 		} );
 		} );
 }
 }
 
 
-describe( 'Markdown', () => {
-	it( 'should be loaded and returned from the editor', async () => {
-		const markdown =
-			'```\n' +
-			'test()\n' +
-			'```';
+describe( 'CodeBlock - integration', () => {
+	describe( 'with Markdown GFM', () => {
+		it( 'should be loaded and returned from the editor', async () => {
+			const markdown =
+				'```\n' +
+				'test()\n' +
+				'```';
 
 
-		const editor = await getEditor( markdown );
+			const editor = await getEditor( markdown );
 
 
-		expect( editor.getData() ).to.equal( markdown );
+			expect( editor.getData() ).to.equal( markdown );
 
 
-		await editor.destroy();
+			await editor.destroy();
+		} );
 	} );
 	} );
 } );
 } );