summaryrefslogtreecommitdiff
path: root/themes/blowfish/assets/lib/mermaid/tests
diff options
context:
space:
mode:
Diffstat (limited to 'themes/blowfish/assets/lib/mermaid/tests')
-rw-r--r--themes/blowfish/assets/lib/mermaid/tests/MockedD3.d.ts45
-rw-r--r--themes/blowfish/assets/lib/mermaid/tests/setup.d.ts1
-rw-r--r--themes/blowfish/assets/lib/mermaid/tests/util.d.ts3
3 files changed, 49 insertions, 0 deletions
diff --git a/themes/blowfish/assets/lib/mermaid/tests/MockedD3.d.ts b/themes/blowfish/assets/lib/mermaid/tests/MockedD3.d.ts
new file mode 100644
index 0000000..87dfbac
--- /dev/null
+++ b/themes/blowfish/assets/lib/mermaid/tests/MockedD3.d.ts
@@ -0,0 +1,45 @@
+/**
+ * This is a mocked/stubbed version of the d3 Selection type. Each of the main functions are all
+ * mocked (via vi.fn()) so you can track if they have been called, etc.
+ *
+ * Note that node() returns a HTML Element with tag 'svg'. It is an empty element (no innerHTML, no children, etc).
+ * This potentially allows testing of mermaidAPI render().
+ */
+export declare class MockedD3 {
+ attribs: Map<string, string>;
+ id: string | undefined;
+ _children: MockedD3[];
+ _containingHTMLdoc: Document;
+ constructor(givenId?: string);
+ /** Helpful utility during development/debugging. This is not a real d3 function */
+ listChildren(): string;
+ select: import("@vitest/spy").Mock<any, any>;
+ selectAll: import("@vitest/spy").Mock<any, any>;
+ append: import("@vitest/spy").Mock<any, any>;
+ insert: (type: string, beforeSelector?: string, id?: string) => MockedD3;
+ attr(attrName: string): undefined | string;
+ attr(attrName: string, attrValue: string): MockedD3;
+ lower(attrValue?: string): this;
+ style(attrValue?: string): this;
+ text(attrValue?: string): this;
+ node: import("@vitest/spy").Mock<any, any>;
+ nodes: import("@vitest/spy").Mock<any, any>;
+ getBBox: () => {
+ x: string | number | undefined;
+ y: string | number | undefined;
+ width: string | number | undefined;
+ height: string | number | undefined;
+ };
+ insertBefore: import("@vitest/spy").Mock<any, any>;
+ curveBasis: import("@vitest/spy").Mock<any, any>;
+ curveBasisClosed: import("@vitest/spy").Mock<any, any>;
+ curveBasisOpen: import("@vitest/spy").Mock<any, any>;
+ curveLinear: import("@vitest/spy").Mock<any, any>;
+ curveLinearClosed: import("@vitest/spy").Mock<any, any>;
+ curveMonotoneX: import("@vitest/spy").Mock<any, any>;
+ curveMonotoneY: import("@vitest/spy").Mock<any, any>;
+ curveNatural: import("@vitest/spy").Mock<any, any>;
+ curveStep: import("@vitest/spy").Mock<any, any>;
+ curveStepAfter: import("@vitest/spy").Mock<any, any>;
+ curveStepBefore: import("@vitest/spy").Mock<any, any>;
+}
diff --git a/themes/blowfish/assets/lib/mermaid/tests/setup.d.ts b/themes/blowfish/assets/lib/mermaid/tests/setup.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/themes/blowfish/assets/lib/mermaid/tests/setup.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/themes/blowfish/assets/lib/mermaid/tests/util.d.ts b/themes/blowfish/assets/lib/mermaid/tests/util.d.ts
new file mode 100644
index 0000000..66bdc66
--- /dev/null
+++ b/themes/blowfish/assets/lib/mermaid/tests/util.d.ts
@@ -0,0 +1,3 @@
+export declare const convert: (template: TemplateStringsArray, ...params: unknown[]) => {
+ [k: string]: unknown;
+}[];