mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-10-31 02:44:17 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			46 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import { imgSnapshotTest } from '../../helpers/util';
 | |
| 
 | |
| describe('Error Diagrams', () => {
 | |
|   beforeEach(() => {
 | |
|     cy.on('uncaught:exception', (err) => {
 | |
|       expect(err.message).to.include('error');
 | |
|       // return false to prevent the error from
 | |
|       // failing this test
 | |
|       return false;
 | |
|     });
 | |
|   });
 | |
| 
 | |
|   it('should render a simple ER diagram', () => {
 | |
|     imgSnapshotTest(
 | |
|       `
 | |
|       error
 | |
|       `,
 | |
|       { logLevel: 1 }
 | |
|     );
 | |
|   });
 | |
| 
 | |
|   it('should render error diagram for actual errors', () => {
 | |
|     imgSnapshotTest(
 | |
|       `
 | |
|     flowchart TD
 | |
|       A[Christmas] --|Get money| B(Go shopping)
 | |
|       `,
 | |
|       { logLevel: 1 }
 | |
|     );
 | |
|   });
 | |
| 
 | |
|   it('should render error for wrong ER diagram', () => {
 | |
|     imgSnapshotTest(
 | |
|       `
 | |
|     erDiagram
 | |
|         ATLAS-ORGANIZATION ||--|{ ATLAS-PROJECTS : "has many"
 | |
|         ATLAS-PROJECTS ||--|{ MONGODB-CLUSTERS : "has many"
 | |
|         ATLAS-PROJECTS ||--|{ ATLAS-TEAMS : "has many"
 | |
|         MONGODB-CLUSTERS ||..|{
 | |
|         ATLAS-TEAMS ||..|{
 | |
|       `,
 | |
|       { logLevel: 1 }
 | |
|     );
 | |
|   });
 | |
| });
 | 
