e2e tests added

This commit is contained in:
Axel Müller
2024-01-08 16:41:53 +01:00
parent e1d085925e
commit 1273f440a8

View File

@@ -1,6 +1,7 @@
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
describe('XY Chart', () => {
describe('single dataset', () => {
it('should render the simplest possible chart', () => {
imgSnapshotTest(
`
@@ -320,3 +321,34 @@ describe('XY Chart', () => {
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');
});
});
});