mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
chore(ckeditor5-*): remove default tests
This commit is contained in:
parent
f5d9789e83
commit
3eeed5790a
@ -1,56 +0,0 @@
|
|||||||
import { describe, expect, it, beforeEach, afterEach } from 'vitest';
|
|
||||||
import { ClassicEditor, Essentials, Paragraph, Heading } from 'ckeditor5';
|
|
||||||
import Footnotes from '../src/footnotes.js';
|
|
||||||
|
|
||||||
describe( 'Footnotes', () => {
|
|
||||||
it( 'should be named', () => {
|
|
||||||
expect( Footnotes.pluginName ).to.equal( 'Footnotes' );
|
|
||||||
} );
|
|
||||||
|
|
||||||
describe( 'init()', () => {
|
|
||||||
let domElement: HTMLElement, editor: ClassicEditor;
|
|
||||||
|
|
||||||
beforeEach( async () => {
|
|
||||||
domElement = document.createElement( 'div' );
|
|
||||||
document.body.appendChild( domElement );
|
|
||||||
|
|
||||||
editor = await ClassicEditor.create( domElement, {
|
|
||||||
licenseKey: 'GPL',
|
|
||||||
plugins: [
|
|
||||||
Paragraph,
|
|
||||||
Heading,
|
|
||||||
Essentials,
|
|
||||||
Footnotes
|
|
||||||
],
|
|
||||||
toolbar: [
|
|
||||||
'footnotes'
|
|
||||||
]
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
|
|
||||||
afterEach( () => {
|
|
||||||
domElement.remove();
|
|
||||||
return editor.destroy();
|
|
||||||
} );
|
|
||||||
|
|
||||||
it( 'should load Footnotes', () => {
|
|
||||||
const myPlugin = editor.plugins.get( 'Footnotes' );
|
|
||||||
|
|
||||||
expect( myPlugin ).to.be.an.instanceof( Footnotes );
|
|
||||||
} );
|
|
||||||
|
|
||||||
it( 'should add an icon to the toolbar', () => {
|
|
||||||
expect( editor.ui.componentFactory.has( 'footnotes' ) ).to.equal( true );
|
|
||||||
} );
|
|
||||||
|
|
||||||
it( 'should add a text into the editor after clicking the icon', () => {
|
|
||||||
const icon = editor.ui.componentFactory.create( 'footnotes' );
|
|
||||||
|
|
||||||
expect( editor.getData() ).to.equal( '' );
|
|
||||||
|
|
||||||
icon.fire( 'execute' );
|
|
||||||
|
|
||||||
expect( editor.getData() ).to.equal( '<p>Hello CKEditor 5!</p>' );
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
} );
|
|
@ -1,17 +0,0 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
|
||||||
import { Footnotes as FootnotesDll, icons } from '../src/index.js';
|
|
||||||
import Footnotes from '../src/footnotes.js';
|
|
||||||
|
|
||||||
import ckeditor from './../theme/icons/ckeditor.svg';
|
|
||||||
|
|
||||||
describe( 'CKEditor5 Footnotes DLL', () => {
|
|
||||||
it( 'exports Footnotes', () => {
|
|
||||||
expect( FootnotesDll ).to.equal( Footnotes );
|
|
||||||
} );
|
|
||||||
|
|
||||||
describe( 'icons', () => {
|
|
||||||
it( 'exports the "ckeditor" icon', () => {
|
|
||||||
expect( icons.ckeditor ).to.equal( ckeditor );
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
} );
|
|
@ -24,6 +24,7 @@ export default defineConfig( {
|
|||||||
],
|
],
|
||||||
globals: true,
|
globals: true,
|
||||||
watch: false,
|
watch: false,
|
||||||
|
passWithNoTests: true,
|
||||||
coverage: {
|
coverage: {
|
||||||
thresholds: {
|
thresholds: {
|
||||||
lines: 100,
|
lines: 100,
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
|
||||||
import { KeyboardMarker as KeyboardMarkerDll, icons } from '../src/index.js';
|
|
||||||
import KeyboardMarker from '../src/keyboardmarker.js';
|
|
||||||
|
|
||||||
import ckeditor from './../theme/icons/ckeditor.svg';
|
|
||||||
|
|
||||||
describe( 'CKEditor5 KeyboardMarker DLL', () => {
|
|
||||||
it( 'exports KeyboardMarker', () => {
|
|
||||||
expect( KeyboardMarkerDll ).to.equal( KeyboardMarker );
|
|
||||||
} );
|
|
||||||
|
|
||||||
describe( 'icons', () => {
|
|
||||||
it( 'exports the "ckeditor" icon', () => {
|
|
||||||
expect( icons.ckeditor ).to.equal( ckeditor );
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
} );
|
|
@ -1,56 +0,0 @@
|
|||||||
import { describe, expect, it, beforeEach, afterEach } from 'vitest';
|
|
||||||
import { ClassicEditor, Essentials, Paragraph, Heading } from 'ckeditor5';
|
|
||||||
import KeyboardMarker from '../src/keyboardmarker.js';
|
|
||||||
|
|
||||||
describe( 'KeyboardMarker', () => {
|
|
||||||
it( 'should be named', () => {
|
|
||||||
expect( KeyboardMarker.pluginName ).to.equal( 'KeyboardMarker' );
|
|
||||||
} );
|
|
||||||
|
|
||||||
describe( 'init()', () => {
|
|
||||||
let domElement: HTMLElement, editor: ClassicEditor;
|
|
||||||
|
|
||||||
beforeEach( async () => {
|
|
||||||
domElement = document.createElement( 'div' );
|
|
||||||
document.body.appendChild( domElement );
|
|
||||||
|
|
||||||
editor = await ClassicEditor.create( domElement, {
|
|
||||||
licenseKey: 'GPL',
|
|
||||||
plugins: [
|
|
||||||
Paragraph,
|
|
||||||
Heading,
|
|
||||||
Essentials,
|
|
||||||
KeyboardMarker
|
|
||||||
],
|
|
||||||
toolbar: [
|
|
||||||
'keyboardMarker'
|
|
||||||
]
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
|
|
||||||
afterEach( () => {
|
|
||||||
domElement.remove();
|
|
||||||
return editor.destroy();
|
|
||||||
} );
|
|
||||||
|
|
||||||
it( 'should load KeyboardMarker', () => {
|
|
||||||
const myPlugin = editor.plugins.get( 'KeyboardMarker' );
|
|
||||||
|
|
||||||
expect( myPlugin ).to.be.an.instanceof( KeyboardMarker );
|
|
||||||
} );
|
|
||||||
|
|
||||||
it( 'should add an icon to the toolbar', () => {
|
|
||||||
expect( editor.ui.componentFactory.has( 'keyboardMarker' ) ).to.equal( true );
|
|
||||||
} );
|
|
||||||
|
|
||||||
it( 'should add a text into the editor after clicking the icon', () => {
|
|
||||||
const icon = editor.ui.componentFactory.create( 'keyboardMarker' );
|
|
||||||
|
|
||||||
expect( editor.getData() ).to.equal( '' );
|
|
||||||
|
|
||||||
icon.fire( 'execute' );
|
|
||||||
|
|
||||||
expect( editor.getData() ).to.equal( '<p>Hello CKEditor 5!</p>' );
|
|
||||||
} );
|
|
||||||
} );
|
|
||||||
} );
|
|
@ -24,6 +24,7 @@ export default defineConfig( {
|
|||||||
],
|
],
|
||||||
globals: true,
|
globals: true,
|
||||||
watch: false,
|
watch: false,
|
||||||
|
passWithNoTests: true,
|
||||||
coverage: {
|
coverage: {
|
||||||
thresholds: {
|
thresholds: {
|
||||||
lines: 100,
|
lines: 100,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user