浏览代码

Tests: Stub TableSelection tests.

Maciej Gołaszewski 7 年之前
父节点
当前提交
c19778c0b7
共有 1 个文件被更改,包括 52 次插入0 次删除
  1. 52 0
      packages/ckeditor5-table/tests/tableselection.js

+ 52 - 0
packages/ckeditor5-table/tests/tableselection.js

@@ -0,0 +1,52 @@
+/**
+ * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
+import { setData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
+
+import { defaultConversion, defaultSchema, modelTable } from './_utils/utils';
+
+import TableSelection from '../src/tableselection';
+
+describe( 'TableSelection', () => {
+	let editor, model, root, tableSelection;
+
+	beforeEach( () => {
+		return VirtualTestEditor.create( {
+			plugins: [ TableSelection ]
+		} ).then( newEditor => {
+			editor = newEditor;
+			model = editor.model;
+			root = model.document.getRoot( 'main' );
+			tableSelection = editor.plugins.get( TableSelection );
+
+			defaultSchema( model.schema );
+			defaultConversion( editor.conversion );
+		} );
+	} );
+
+	afterEach( () => {
+		return editor.destroy();
+	} );
+
+	describe( '#pluginName', () => {
+		it( 'should provide plugin name', () => {
+			expect( TableSelection.pluginName ).to.equal( 'TableSelection' );
+		} );
+	} );
+
+	describe.only( 'start()', () => {
+		it( 'should...', () => {
+			setData( model, modelTable( [
+				[ { rowspan: 2, colspan: 2, contents: '00[]' }, '02' ],
+				[ '12' ]
+			] ) );
+
+			const nodeByPath = root.getNodeByPath( [ 0, 0, 0 ] );
+
+			tableSelection.startSelection( nodeByPath );
+		} );
+	} );
+} );