Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
iansan5653 committed May 14, 2024
1 parent 56c4f10 commit 6f56d94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/mermaid/src/mermaidAPI.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ vi.mock('stylis', () => {
import { compile, serialize } from 'stylis';
import { decodeEntities, encodeEntities } from './utils.js';
import { Diagram } from './Diagram.js';
import {toBase64} from './utils/base64.js';

/**
* @see https://vitest.dev/guide/mocking.html Mock part of a module
Expand Down Expand Up @@ -199,7 +200,7 @@ describe('mermaidAPI', () => {
});

it('sets src to base64 version of <body style="IFRAME_SVG_BODY_STYLE">svgCode<//body>', () => {
const base64encodedSrc = btoa('<body style="' + 'margin:0' + '">' + inputSvgCode + '</body>');
const base64encodedSrc = toBase64('<body style="' + 'margin:0' + '">' + inputSvgCode + '</body>');
const expectedRegExp = new RegExp('src="data:text/html;charset=UTF-8;base64,' + base64encodedSrc + '"');

const result = putIntoIFrame(inputSvgCode);
Expand Down

0 comments on commit 6f56d94

Please sign in to comment.