mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 10:32:27 +08:00

git-subtree-dir: _regroup/ckeditor5-math git-subtree-mainline: 034cd58833a2c9c7ba49f6217dc5aeff274e0174 git-subtree-split: 6231df7f0e9df7f4d6982b103c02400d4f0b8937
56 lines
1.5 KiB
TypeScript
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' );
|
|
} );
|
|
} );
|