) {
+ // get HTML Element from jquery element
+ const svgElement = $p[0];
+ expect(svgElement.nodeName).equal('svg');
+
+ const sectionRoots = svgElement.getElementsByClassName('mindmap-node section-root');
+ // mindmap should have at least one root section
+ expect(sectionRoots).to.have.lengthOf.at.least(1);
+}
+
+describe('Mindmaps', () => {
+ it('Only a root', () => {
+ imgSnapshotTest(
+ `mindmap
+root
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ });
+
+ it('a root with a shape', () => {
+ imgSnapshotTest(
+ `mindmap
+root[root]
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ });
+
+ it('a root with wrapping text and a shape', () => {
+ imgSnapshotTest(
+ `mindmap
+root[A root with a long text that wraps to keep the node size in check]
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ });
+
+ it('a root with an icon', () => {
+ imgSnapshotTest(
+ `mindmap
+root[root]
+::icon(mdi mdi-fire)
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ });
+
+ it('Blang and cloud shape', () => {
+ imgSnapshotTest(
+ `mindmap
+root))bang((
+ ::icon(mdi mdi-fire)
+ a))Another bang((
+ ::icon(mdi mdi-fire)
+ a)A cloud(
+ ::icon(mdi mdi-fire)
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ });
+
+ it('Blang and cloud shape with icons', () => {
+ imgSnapshotTest(
+ `mindmap
+root))bang((
+
+ a))Another bang((
+ a)A cloud(
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ });
+
+ it('braches', () => {
+ imgSnapshotTest(
+ `mindmap
+root
+ child1
+ grandchild 1
+ grandchild 2
+ child2
+ grandchild 3
+ grandchild 4
+ child3
+ grandchild 5
+ grandchild 6
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ });
+
+ it('braches with shapes and labels', () => {
+ imgSnapshotTest(
+ `mindmap
+root
+ child1((Circle))
+ grandchild 1
+ grandchild 2
+ child2(Round rectangle)
+ grandchild 3
+ grandchild 4
+ child3[Square]
+ grandchild 5
+ ::icon(mdi mdi-fire)
+ gc6((grand
child 6))
+ ::icon(mdi mdi-fire)
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ });
+ it('text shouhld wrap with icon', () => {
+ imgSnapshotTest(
+ `mindmap
+root
+ Child3(A node with an icon and with a long text that wraps to keep the node size in check)
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ });
+ it('square shape', () => {
+ imgSnapshotTest(
+ `
+mindmap
+ root[
+ The root
+ ]
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ cy.get('svg');
+ });
+ it('rounded rect shape', () => {
+ imgSnapshotTest(
+ `
+mindmap
+ root((
+ The root
+ ))
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ cy.get('svg');
+ });
+ it('circle shape', () => {
+ imgSnapshotTest(
+ `
+mindmap
+ root(
+ The root
+ )
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ cy.get('svg');
+ });
+ it('default shape', () => {
+ imgSnapshotTest(
+ `
+mindmap
+ The root
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ cy.get('svg');
+ });
+ it('adding children', () => {
+ imgSnapshotTest(
+ `
+mindmap
+ The root
+ child1
+ child2
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ cy.get('svg');
+ });
+ it('adding grand children', () => {
+ imgSnapshotTest(
+ `
+mindmap
+ The root
+ child1
+ child2
+ child3
+ `,
+ {},
+ undefined,
+ shouldHaveRoot
+ );
+ cy.get('svg');
+ });
+ /* The end */
+});
diff --git a/cypress/integration/rendering/requirement.spec.js b/cypress/integration/rendering/requirement.spec.js
index be27f39fa..8a8d188ff 100644
--- a/cypress/integration/rendering/requirement.spec.js
+++ b/cypress/integration/rendering/requirement.spec.js
@@ -96,7 +96,7 @@ describe('Requirement diagram', () => {
);
cy.get('svg').should((svg) => {
const el = svg.get(0);
- const children = Array.from(el.children);
+ const children = [...el.children];
const titleEl = children.find(function (node) {
return node.tagName === 'title';
diff --git a/cypress/integration/rendering/stateDiagram-v2.spec.js b/cypress/integration/rendering/stateDiagram-v2.spec.js
index 5b43c890c..0eca01873 100644
--- a/cypress/integration/rendering/stateDiagram-v2.spec.js
+++ b/cypress/integration/rendering/stateDiagram-v2.spec.js
@@ -559,4 +559,16 @@ stateDiagram-v2
);
});
});
+ it('1433: should render a simple state diagram with a title', () => {
+ imgSnapshotTest(
+ `---
+title: simple state diagram
+---
+stateDiagram-v2
+[*] --> State1
+State1 --> [*]
+`,
+ {}
+ );
+ });
});
diff --git a/cypress/integration/rendering/theme.spec.js b/cypress/integration/rendering/theme.spec.js
index 0eb8d111b..ef3bd9a4b 100644
--- a/cypress/integration/rendering/theme.spec.js
+++ b/cypress/integration/rendering/theme.spec.js
@@ -25,6 +25,7 @@ describe('themeCSS balancing, it', () => {
});
});
+// TODO: Delete/Rename this describe, keeping the inner contents.
describe('Pie Chart', () => {
// beforeEach(()=>{
// cy.clock((new Date('2014-06-09')).getTime());
diff --git a/cypress/platform/knsv2.html b/cypress/platform/knsv2.html
index 084b8151e..ba7f41601 100644
--- a/cypress/platform/knsv2.html
+++ b/cypress/platform/knsv2.html
@@ -56,10 +56,11 @@
Security check
-flowchart TD
- A --> B
- B --> C
- A --> C
+graph LR
+ subgraph external
+ inside
+ end
+ outside --> external
mindmap
@@ -91,9 +92,13 @@ mindmap
-
+
-
+
+