Elian Doran 78544e5c99 Add '_regroup/ckeditor5-math/' from commit '6231df7f0e9df7f4d6982b103c02400d4f0b8937'
git-subtree-dir: _regroup/ckeditor5-math
git-subtree-mainline: 034cd58833a2c9c7ba49f6217dc5aeff274e0174
git-subtree-split: 6231df7f0e9df7f4d6982b103c02400d4f0b8937
2025-05-04 21:20:21 +03:00

56 lines
1.5 KiB
TypeScript

import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import Mathematics from '../src/math';
import MathEditing from '../src/mathediting';
import MathUI from '../src/mathui';
import AutoMath from '../src/automath';
import Widget from '@ckeditor/ckeditor5-widget/src/widget';
import global from '@ckeditor/ckeditor5-utils/src/dom/global';
import { expect } from 'chai';
describe( 'Math', () => {
let editorElement: HTMLDivElement, editor: ClassicEditor;
beforeEach( async () => {
editorElement = document.createElement( 'div' );
document.body.appendChild( editorElement );
return ClassicEditor
.create( editorElement, {
plugins: [ Mathematics ]
} )
.then( newEditor => {
editor = newEditor;
} );
} );
afterEach( () => {
editorElement.remove();
return editor.destroy();
} );
it( 'should be loaded', () => {
expect( editor.plugins.get( Mathematics ) ).to.instanceOf( Mathematics );
} );
it( 'should load MathEditing plugin', () => {
expect( editor.plugins.get( MathEditing ) ).to.instanceOf( MathEditing );
} );
it( 'should load Widget plugin', () => {
expect( editor.plugins.get( Widget ) ).to.instanceOf( Widget );
} );
it( 'should load MathUI plugin', () => {
expect( editor.plugins.get( MathUI ) ).to.instanceOf( MathUI );
} );
it( 'should load AutoMath plugin', () => {
expect( editor.plugins.get( AutoMath ) ).to.instanceOf( AutoMath );
} );
it( 'has proper name', () => {
expect( Mathematics.pluginName ).to.equal( 'Math' );
} );
} );