mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-04 12:54:08 +01:00 
			
		
		
		
	Support attribute definitions for entities in ERDs
This commit is contained in:
		@@ -157,5 +157,33 @@ describe('Entity Relationship Diagram', () => {
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should render entities with and without attributes', () => {
 | 
			
		||||
    renderGraph(
 | 
			
		||||
      `
 | 
			
		||||
    erDiagram
 | 
			
		||||
        BOOK { string title }
 | 
			
		||||
        AUTHOR }|..|{ BOOK : writes
 | 
			
		||||
        BOOK { float price }
 | 
			
		||||
      `,
 | 
			
		||||
      { logLevel : 1 }
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should render entities and attributes with big and small entity names', () => {
 | 
			
		||||
    renderGraph(
 | 
			
		||||
      `
 | 
			
		||||
    erDiagram
 | 
			
		||||
        PRIVATE_FINANCIAL_INSTITUTION { 
 | 
			
		||||
          string name
 | 
			
		||||
          int    turnover
 | 
			
		||||
        }
 | 
			
		||||
        PRIVATE_FINANCIAL_INSTITUTION ||..|{ EMPLOYEE : employs
 | 
			
		||||
        EMPLOYEE { bool officer_of_firm }
 | 
			
		||||
      `,
 | 
			
		||||
      { logLevel : 1 }
 | 
			
		||||
    );
 | 
			
		||||
    cy.get('svg');
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user