diff --git a/.build/jsonSchema.ts b/.build/jsonSchema.ts index 6fd8ca3f54..08367011dc 100644 --- a/.build/jsonSchema.ts +++ b/.build/jsonSchema.ts @@ -25,6 +25,7 @@ const MERMAID_CONFIG_DIAGRAM_KEYS = [ 'sankey', 'block', 'packet', + 'treeView', ] as const; /** diff --git a/cypress/integration/rendering/treeView.spec.ts b/cypress/integration/rendering/treeView.spec.ts new file mode 100644 index 0000000000..dcb1b20556 --- /dev/null +++ b/cypress/integration/rendering/treeView.spec.ts @@ -0,0 +1,45 @@ +import { imgSnapshotTest } from '../../helpers/util'; + +describe('TreeView Diagram', () => { + it('should render a simple treeView diagram', () => { + imgSnapshotTest( + `treeView-beta + file1.ts` + ); + }); + + it('should render a complex treeView diagram', () => { + imgSnapshotTest( + `treeView-beta + root + folder1 + file1.js + file2.ts + folder2 + file3.spec.ts + folder3 + file4.ts + file5.ts + folder4 + file6.ts + file7.ts` + ); + }); + + it('should render a complex treeView diagram with multiple roots', () => { + imgSnapshotTest( + `treeView-beta + folder1 + file1.js + file2.ts + folder2 + file3.spec.ts + folder3 + file4.ts + file5.ts + folder4 + file6.ts + file7.ts` + ); + }); +}); diff --git a/demos/index.html b/demos/index.html index 61a86a2aa0..6673864330 100644 --- a/demos/index.html +++ b/demos/index.html @@ -88,6 +88,9 @@