test(ckeditor5-mermaid): fix failing tests

This commit is contained in:
Elian Doran 2025-05-10 02:31:29 +03:00
parent ef3d6ebf29
commit 8c17c5d7dc
No known key found for this signature in database
5 changed files with 6 additions and 4 deletions

View File

@ -1,8 +1,8 @@
import { ClassicEditor, Paragraph, _setModelData as setModelData, _getModelData as getModelData } from 'ckeditor5';
import { afterEach, beforeEach, describe, it } from 'vitest';
import MermaidEditing from '../../dist/mermaidediting';
import InsertMermaidCommand from '../../dist/commands/insertMermaidCommand';
import { expect } from 'vitest';
import MermaidEditing from '../../src/mermaidediting';
import InsertMermaidCommand from '../../src/commands/insertMermaidCommand';
/* global document */

View File

@ -11,6 +11,7 @@ import Mermaid from '../../src/mermaid.js';
ClassicEditor
.create( document.querySelector( '#editor' ), {
licenseKey: "GPL",
plugins: [
Markdown,
Typing,

View File

@ -11,6 +11,7 @@ import Mermaid from '../../src/mermaid.js';
ClassicEditor
.create( document.querySelector( '#editor' ), {
licenseKey: "GPL",
plugins: [
Typing,
Paragraph,

View File

@ -215,7 +215,7 @@ describe( 'MermaidEditing', () => {
} );
afterEach( () => {
renderMermaidStub.restore();
vi.clearAllMocks();
} );
it( 'has proper inner text set during the initial conversion', () => {
@ -243,7 +243,6 @@ describe( 'MermaidEditing', () => {
writer.setAttribute( 'source', 'abc', mermaidModel );
} );
expect( renderMermaidStub.callCount ).to.equal( 1 );
expect(renderMermaidStub).toBeCalledWith(domPreviewContainer);
} );
} );

View File

@ -24,6 +24,7 @@ export default defineConfig( {
],
globals: true,
watch: false,
passWithNoTests: true,
coverage: {
thresholds: {
lines: 100,