Code refactoring, add e2e test

This commit is contained in:
Jeremy Funk
2023-03-23 23:45:59 +01:00
parent f054609e02
commit 8c0550b2b7
8 changed files with 78 additions and 37 deletions

View File

@@ -2,7 +2,7 @@ import { imgSnapshotTest, renderGraph } from '../../helpers/util.js';
describe('Gantt diagram', () => {
beforeEach(() => {
cy.clock(new Date('1010-10-10').getTime());
cy.clock(new Date('2010-10-10').getTime());
});
it('should render a gantt chart', () => {
imgSnapshotTest(
@@ -435,4 +435,37 @@ describe('Gantt diagram', () => {
{ gantt: { topAxis: true } }
);
});
it('should render when compact is true', () => {
imgSnapshotTest(
`
gantt
title GANTT compact
dateFormat HH:mm:ss
axisFormat %Hh%M
compact
section DB Clean
Clean: 12:00:00, 10m
Clean: 12:30:00, 12m
Clean: 13:00:00, 8m
Clean: 13:30:00, 9m
Clean: 14:00:00, 13m
Clean: 14:30:00, 10m
Clean: 15:00:00, 11m
section Sessions
A: 12:00:00, 63m
B: 12:30:00, 12m
C: 13:05:00, 12m
D: 13:06:00, 33m
E: 13:15:00, 55m
F: 13:20:00, 12m
G: 13:32:00, 18m
H: 13:50:00, 20m
I: 14:10:00, 10m
`,
{}
);
});
});