mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-21 08:19:43 +02:00
more tests added
This commit is contained in:
@@ -75,21 +75,6 @@ describe('XY Chart', () => {
|
||||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
it('Multiple plots can be rendered', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
xychart-beta
|
||||
line [23, 46, 77, 34]
|
||||
line [45, 32, 33, 12]
|
||||
bar [87, 54, 99, 85]
|
||||
line [78, 88, 22, 4]
|
||||
line [22, 29, 75, 33]
|
||||
bar [52, 96, 35, 10]
|
||||
`,
|
||||
{}
|
||||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
it('Decimals and negative numbers are supported', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
@@ -323,7 +308,8 @@ describe('XY Chart', () => {
|
||||
});
|
||||
|
||||
describe('multiple datasets', () => {
|
||||
it('should render 3 datasets', () => {
|
||||
describe('vertical', () => {
|
||||
it('should render bar diagram for 3 datasets', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
xychart-beta
|
||||
@@ -339,7 +325,41 @@ describe('XY Chart', () => {
|
||||
cy.get('svg');
|
||||
});
|
||||
|
||||
it('should render 3 datasets in horizontal orientation', () => {
|
||||
it('should render line diagram for 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
|
||||
line "dogs" [0, 20, 40, 30]
|
||||
line "cats" [20, 40, 0, 30]
|
||||
line "birds" [30, 60, 50, 30]
|
||||
`,
|
||||
{}
|
||||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
|
||||
it('should render a mix of multiple bar and line plots', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
xychart-beta
|
||||
line [23, 46, 77, 34]
|
||||
line [45, 32, 33, 12]
|
||||
bar [87, 54, 99, 85]
|
||||
line [78, 88, 22, 4]
|
||||
line [22, 29, 75, 33]
|
||||
bar [52, 96, 35, 10]
|
||||
`,
|
||||
{}
|
||||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
});
|
||||
|
||||
describe('horizontal', () => {
|
||||
it('should render bar diagram for 3 datasets', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
xychart-beta horizontal
|
||||
@@ -354,5 +374,38 @@ describe('XY Chart', () => {
|
||||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
|
||||
it('should render line diagram for 3 datasets', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
xychart-beta horizontal
|
||||
title "Basic xychart with multiple datasets"
|
||||
x-axis "Relevant categories" [category1, "category 2", category3, category4]
|
||||
y-axis Animals 0 --> 160
|
||||
line "dogs" [0, 20, 40, 30]
|
||||
line "cats" [20, 40, 0, 30]
|
||||
line "birds" [30, 60, 50, 30]
|
||||
`,
|
||||
{}
|
||||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
|
||||
it('should render a mix of multiple bar and line plots', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
xychart-beta horizontal
|
||||
line [23, 46, 77, 34]
|
||||
line [45, 32, 33, 12]
|
||||
bar [87, 54, 99, 85]
|
||||
line [78, 88, 22, 4]
|
||||
line [22, 29, 75, 33]
|
||||
bar [52, 96, 35, 10]
|
||||
`,
|
||||
{}
|
||||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user