test: Tweak flowchart tests

This commit is contained in:
Sidharth Vinod
2025-04-19 18:19:36 +05:30
parent 867484a2cc
commit 4077088f18
2 changed files with 7 additions and 11 deletions

View File

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

View File

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