mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-15 10:14:21 +01:00
fix: Sanitize check in unit test
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { describe, expect, it } from 'vitest';
|
import { describe, expect, it } from 'vitest';
|
||||||
import { replaceIconSubstring } from './createText.js';
|
import { sanitizeText } from '../diagram-api/diagramAPI.js';
|
||||||
import mermaid from '../mermaid.js';
|
import mermaid from '../mermaid.js';
|
||||||
|
import { replaceIconSubstring } from './createText.js';
|
||||||
|
|
||||||
describe('replaceIconSubstring', () => {
|
describe('replaceIconSubstring', () => {
|
||||||
it('converts FontAwesome icon notations to HTML tags', async () => {
|
it('converts FontAwesome icon notations to HTML tags', async () => {
|
||||||
@@ -56,7 +57,7 @@ describe('replaceIconSubstring', () => {
|
|||||||
]);
|
]);
|
||||||
const input = 'Icons galore: fa:fa-bell';
|
const input = 'Icons galore: fa:fa-bell';
|
||||||
const output = await replaceIconSubstring(input);
|
const output = await replaceIconSubstring(input);
|
||||||
const expected = staticBellIconPack.icons.bell.body;
|
const expected = sanitizeText(staticBellIconPack.icons.bell.body);
|
||||||
expect(output).toContain(expected);
|
expect(output).toContain(expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user