tableui.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* global document */
  6. import TableEditing from '../src/tableediting';
  7. import TableUI from '../src/tableui';
  8. import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
  9. import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
  10. import { _clear as clearTranslations, add as addTranslations } from '@ckeditor/ckeditor5-utils/src/translation-service';
  11. testUtils.createSinonSandbox();
  12. describe( 'TableUI', () => {
  13. let editor, element;
  14. before( () => {
  15. addTranslations( 'en', {} );
  16. addTranslations( 'pl', {} );
  17. } );
  18. after( () => {
  19. clearTranslations();
  20. } );
  21. beforeEach( () => {
  22. element = document.createElement( 'div' );
  23. document.body.appendChild( element );
  24. return ClassicTestEditor
  25. .create( element, {
  26. plugins: [ TableEditing, TableUI ]
  27. } )
  28. .then( newEditor => {
  29. editor = newEditor;
  30. } );
  31. } );
  32. afterEach( () => {
  33. element.remove();
  34. return editor.destroy();
  35. } );
  36. } );