chore(ckeditor5-*): remove default tests

This commit is contained in:
Elian Doran 2025-05-09 21:50:40 +03:00
parent f5d9789e83
commit 3eeed5790a
No known key found for this signature in database
6 changed files with 2 additions and 146 deletions

View File

@ -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>' );
} );
} );
} );

View File

@ -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 );
} );
} );
} );

View File

@ -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,

View File

@ -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 );
} );
} );
} );

View File

@ -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>' );
} );
} );
} );

View File

@ -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,