mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-12-01 10:06:25 +01:00
fix: improve error handling for invalid date formats in Gantt chart
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
@@ -118,15 +118,6 @@ describe('Gantt diagram', () => {
|
||||
);
|
||||
});
|
||||
it('should FAIL rendering a gantt chart for issue #1060 with invalid date', () => {
|
||||
let errorCaught = false;
|
||||
|
||||
cy.on('uncaught:exception', (err) => {
|
||||
// Expect error related to invalid or missing date format
|
||||
expect(err.message).to.include('Invalid date');
|
||||
errorCaught = true;
|
||||
return false; // prevent Cypress from failing the test
|
||||
});
|
||||
|
||||
imgSnapshotTest(
|
||||
`
|
||||
gantt
|
||||
@@ -159,16 +150,12 @@ describe('Gantt diagram', () => {
|
||||
|
||||
section Plasma Calls & updates
|
||||
OVM :ovm, 2019-07-12, 120d
|
||||
Plasma call 26 :pc26, 2019-08-21, 1d
|
||||
Plasma call 27 :pc27, 2019-09-03, 1d
|
||||
Plasma call 28 :pc28, 2019-09-17, 1d
|
||||
`,
|
||||
Plasma call 26 :pc26, 2019-08-21, 1d
|
||||
Plasma call 27 :pc27, 2019-09-03, 1d
|
||||
Plasma call 28 :pc28, 2019-09-17, 1d
|
||||
`,
|
||||
{}
|
||||
);
|
||||
|
||||
cy.then(() => {
|
||||
expect(errorCaught, 'Expected rendering to fail with invalid date error').to.equal(true);
|
||||
});
|
||||
});
|
||||
|
||||
it('should default to showing today marker', () => {
|
||||
|
||||
@@ -286,9 +286,9 @@ erDiagram
|
||||
accTitle: This is a title
|
||||
accDescr: This is a description
|
||||
|
||||
dateFormat YYYY-MM-DD
|
||||
dateFormat :YYYY-MM-DD
|
||||
title :Adding GANTT diagram functionality to mermaid
|
||||
excludes :excludes the named dates/days from being included in a charted task.
|
||||
excludes :excludes the named dates/days from being included in a charted task..
|
||||
section A section
|
||||
Completed task :done, des1, 2014-01-06,2014-01-08
|
||||
Active task :active, des2, 2014-01-09, 3d
|
||||
|
||||
Reference in New Issue
Block a user