mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-27 16:14:16 +01:00
fix: handle uncaught exceptions in Gantt chart rendering test for invalid dates
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
@@ -118,6 +118,15 @@ 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
|
||||
@@ -150,12 +159,16 @@ 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', () => {
|
||||
|
||||
Reference in New Issue
Block a user