Merge pull request #7197 from mermaid-js/fix/5496-gantt-tickinterval-app-crash

5496 : fixed UI crash from excessive tick generation with invalid dates/intervals
This commit is contained in:
Shubham P
2025-11-27 17:09:07 +00:00
committed by shubhamparikh2704
parent 762b44cf33
commit de7ed10339
5 changed files with 183 additions and 52 deletions

View File

@@ -833,4 +833,34 @@ describe('Gantt diagram', () => {
{}
);
});
it('should handle seconds-only format with tickInterval (issue #5496)', () => {
imgSnapshotTest(
`
gantt
tickInterval 1second
dateFormat ss
axisFormat %s
section Network Request
RTT : rtt, 0, 20
`,
{}
);
});
it('should handle dates with year typo like 202 instead of 2024 (issue #5496)', () => {
imgSnapshotTest(
`
gantt
title Schedule
dateFormat YYYY-MM-DD
tickInterval 1week
axisFormat %m-%d
section Vacation
London : 2024-12-01, 7d
London : 202-12-01, 7d
`,
{}
);
});
});