| 1 | import { imgSnapshotTest } from '../../helpers/util'; |
| 2 | |
| 3 | describe('Error Diagrams', () => { |
| 4 | beforeEach(() => { |
| 5 | cy.on('uncaught:exception', (err) => { |
| 6 | expect(err.message).to.include('error'); |
| 7 | // return false to prevent the error from |
| 8 | // failing this test |
| 9 | return false; |
| 10 | }); |
| 11 | }); |
| 12 | |
| 13 | it('should render a simple ER diagram', () => { |
| 14 | imgSnapshotTest( |
| 15 | ` |
| 16 | error |
| 17 | `, |
| 18 | { logLevel: 1 } |
| 19 | ); |
| 20 | }); |
| 21 | |
| 22 | it('should render error diagram for actual errors', () => { |
| 23 | imgSnapshotTest( |
| 24 | ` |
| 25 | flowchart TD |
| 26 | A[Christmas] --|Get money| B(Go shopping) |
| 27 | `, |
| 28 | { logLevel: 1 } |
| 29 | ); |
| 30 | }); |
| 31 | |
| 32 | it('should render error for wrong ER diagram', () => { |
| 33 | imgSnapshotTest( |
| 34 | ` |
| 35 | erDiagram |
| 36 | ATLAS-ORGANIZATION ||--|{ ATLAS-PROJECTS : "has many" |
| 37 | ATLAS-PROJECTS ||--|{ MONGODB-CLUSTERS : "has many" |
| 38 | ATLAS-PROJECTS ||--|{ ATLAS-TEAMS : "has many" |
| 39 | MONGODB-CLUSTERS ||..|{ |
| 40 | ATLAS-TEAMS ||..|{ |
| 41 | `, |
| 42 | { logLevel: 1 } |
| 43 | ); |
| 44 | }); |
| 45 | }); |
| 46 | |