mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-22 17:56:43 +02:00
test: Tweak flowchart tests
This commit is contained in:
@@ -2,9 +2,9 @@ import { imgSnapshotTest } from '../../helpers/util.ts';
|
|||||||
|
|
||||||
const themes = ['default', 'forest', 'dark', 'base', 'neutral'];
|
const themes = ['default', 'forest', 'dark', 'base', 'neutral'];
|
||||||
|
|
||||||
themes.forEach((theme, index) => {
|
describe('when rendering flowchart with icons', () => {
|
||||||
describe('Flowchart Icon', () => {
|
for (const theme of themes) {
|
||||||
it(`${index + 1}-icon: verify if icons are working from fontawesome library ${theme} theme`, () => {
|
it(`should render icons from fontawesome library on theme ${theme}`, () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`flowchart TD
|
`flowchart TD
|
||||||
A("fab:fa-twitter Twitter") --> B("fab:fa-facebook Facebook")
|
A("fab:fa-twitter Twitter") --> B("fab:fa-facebook Facebook")
|
||||||
@@ -15,12 +15,8 @@ themes.forEach((theme, index) => {
|
|||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
themes.forEach((theme, index) => {
|
it(`should render registered icons on theme ${theme}`, () => {
|
||||||
describe('Flowchart Icon', () => {
|
|
||||||
it(`${index + 1}-icon: verify if registered icons are working on ${theme} theme`, () => {
|
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`flowchart TD
|
`flowchart TD
|
||||||
A("fa:fa-bell Bell")
|
A("fa:fa-bell Bell")
|
||||||
@@ -28,5 +24,5 @@ themes.forEach((theme, index) => {
|
|||||||
{ theme }
|
{ theme }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
@@ -86,7 +86,7 @@ describe('Flowchart v2', () => {
|
|||||||
B --> C{Let me think}
|
B --> C{Let me think}
|
||||||
C -->|One| D[Laptop]
|
C -->|One| D[Laptop]
|
||||||
C -->|Two| E[iPhone]
|
C -->|Two| E[iPhone]
|
||||||
C -->|Three| F[Car]
|
C -->|Three| F[fa:fa-car Car]
|
||||||
`,
|
`,
|
||||||
{ flowchart: { useMaxWidth: true } }
|
{ flowchart: { useMaxWidth: true } }
|
||||||
);
|
);
|
||||||
@@ -109,7 +109,7 @@ describe('Flowchart v2', () => {
|
|||||||
B --> C{Let me think}
|
B --> C{Let me think}
|
||||||
C -->|One| D[Laptop]
|
C -->|One| D[Laptop]
|
||||||
C -->|Two| E[iPhone]
|
C -->|Two| E[iPhone]
|
||||||
C -->|Three| F[Car]
|
C -->|Three| F[fa:fa-car Car]
|
||||||
`,
|
`,
|
||||||
{ flowchart: { useMaxWidth: false } }
|
{ flowchart: { useMaxWidth: false } }
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user