You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
success/packages/excalidraw/mermaid.test.ts

16 lines
708 B
TypeScript

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);
});
});