test: Update tests

This commit is contained in:
Sidharth Vinod 2023-12-06 22:27:00 +05:30
parent 479188bc40
commit 6871ad09e6
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD

View File

@ -682,14 +682,13 @@ describe('mermaidAPI', () => {
it('returns false for invalid definition with silent option', async () => { it('returns false for invalid definition with silent option', async () => {
await expect( await expect(
mermaidAPI.parse('this is not a mermaid diagram definition', { suppressErrors: true }) mermaidAPI.parse('this is not a mermaid diagram definition', { suppressErrors: true })
).resolves.toStrictEqual({ isValid: false }); ).resolves.toBe(false);
}); });
it('resolves for valid definition', async () => { it('resolves for valid definition', async () => {
await expect(mermaidAPI.parse('graph TD;A--x|text including URL space|B;')).resolves await expect(mermaidAPI.parse('graph TD;A--x|text including URL space|B;')).resolves
.toMatchInlineSnapshot(` .toMatchInlineSnapshot(`
{ {
"diagramType": "flowchart-v2", "diagramType": "flowchart-v2",
"isValid": true,
} }
`); `);
}); });
@ -699,7 +698,6 @@ describe('mermaidAPI', () => {
).resolves.toMatchInlineSnapshot(` ).resolves.toMatchInlineSnapshot(`
{ {
"diagramType": "flowchart-v2", "diagramType": "flowchart-v2",
"isValid": true,
} }
`); `);
}); });