mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-18 19:54:17 +01:00
e2e tests added
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
|
||||||
|
|
||||||
describe('XY Chart', () => {
|
describe('XY Chart', () => {
|
||||||
|
describe('single dataset', () => {
|
||||||
it('should render the simplest possible chart', () => {
|
it('should render the simplest possible chart', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -320,3 +321,34 @@ describe('XY Chart', () => {
|
|||||||
cy.get('svg');
|
cy.get('svg');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('multiple datasets', () => {
|
||||||
|
it('should render 3 datasets', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
xychart-beta
|
||||||
|
title "Basic xychart with multiple datasets"
|
||||||
|
x-axis "Relevant categories" [category1, "category 2", category3, category4]
|
||||||
|
y-axis Animals 0 --> 160
|
||||||
|
bar [["dogs" [40, 20, 40, 30]],["cats" [20, 40, 50, 30]],["birds" [30, 60, 50, 30]]]
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render 3 datasets in horizontal orientation', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
xychart-beta horizontal
|
||||||
|
title "Basic xychart with multiple datasets"
|
||||||
|
x-axis "Relevant categories" [category1, "category 2", category3, category4]
|
||||||
|
y-axis Animals 0 --> 160
|
||||||
|
bar [["dogs" [40, 20, 40, 30]],["cats" [20, 40, 50, 30]],["birds" [30, 60, 50, 30]]]
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
cy.get('svg');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user