snapshot of https://github.com/excalidraw/excalidraw.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Tests / test (push) Failing after 15s
Some checks failed
Tests / test (push) Failing after 15s
This commit is contained in:
15
packages/excalidraw/mermaid.test.ts
Normal file
15
packages/excalidraw/mermaid.test.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { isMaybeMermaidDefinition } from "./mermaid";
|
||||
|
||||
describe("isMaybeMermaidDefinition", () => {
|
||||
it("should return true for a valid mermaid definition", () => {
|
||||
expect(isMaybeMermaidDefinition("flowchart")).toBe(true);
|
||||
expect(isMaybeMermaidDefinition("flowchart LR")).toBe(true);
|
||||
expect(isMaybeMermaidDefinition("flowchart LR\nola")).toBe(true);
|
||||
expect(isMaybeMermaidDefinition("%%{}%%flowchart")).toBe(true);
|
||||
expect(isMaybeMermaidDefinition("%%{}%% flowchart")).toBe(true);
|
||||
|
||||
expect(isMaybeMermaidDefinition("graphs")).toBe(false);
|
||||
expect(isMaybeMermaidDefinition("this flowchart")).toBe(false);
|
||||
expect(isMaybeMermaidDefinition("this\nflowchart")).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user