mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
/* eslint-env jest */
|
|
import { imgSnapshotTest } from '../../helpers/util';
|
|
|
|
describe('Class diagram', () => {
|
|
it('should render a simple class diagram', () => {
|
|
imgSnapshotTest(
|
|
`
|
|
classDiagram
|
|
Class01 <|-- AveryLongClass : Cool
|
|
<<interface>> Class01
|
|
Class03 *-- Class04
|
|
Class05 o-- Class06
|
|
Class07 .. Class08
|
|
Class09 --> C2 : Where am i?
|
|
Class09 --* C3
|
|
Class09 --|> Class07
|
|
Class07 : equals()
|
|
Class07 : Object[] elementData
|
|
Class01 : size()
|
|
Class01 : int chimp
|
|
Class01 : int gorilla
|
|
Class08 <--> C2: Cool label
|
|
class Class10 {
|
|
<<service>>
|
|
int id
|
|
test()
|
|
}
|
|
`,
|
|
{}
|
|
);
|
|
cy.get('svg');
|
|
});
|
|
it('should render a simple class diagrams with cardinality', () => {
|
|
imgSnapshotTest(
|
|
`
|
|
classDiagram
|
|
Class01 "1" <|--|> "*" AveryLongClass : Cool
|
|
<<interface>> Class01
|
|
Class03 "1" *-- "*" Class04
|
|
Class05 "1" o-- "many" Class06
|
|
Class07 "1" .. "*" Class08
|
|
Class09 "1" --> "*" C2 : Where am i?
|
|
Class09 "*" --* "*" C3
|
|
Class09 "1" --|> "1" Class07
|
|
Class07 : equals()
|
|
Class07 : Object[] elementData
|
|
Class01 : size()
|
|
Class01 : int chimp
|
|
Class01 : int gorilla
|
|
Class08 "1" <--> "*" C2: Cool label
|
|
class Class10 {
|
|
<<service>>
|
|
int id
|
|
test()
|
|
}
|
|
`,
|
|
{}
|
|
);
|
|
cy.get('svg');
|
|
});
|
|
});
|