mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
58 lines
1.2 KiB
JavaScript
58 lines
1.2 KiB
JavaScript
/* eslint-env jest */
|
|
import { imgSnapshotTest } from '../../helpers/util';
|
|
|
|
describe('State diagram', () => {
|
|
it('should render a simple state diagrams', () => {
|
|
imgSnapshotTest(
|
|
`
|
|
stateDiagram
|
|
[*] --> State1
|
|
State1 --> [*]
|
|
`,
|
|
{ logLevel: 0 }
|
|
);
|
|
cy.get('svg');
|
|
});
|
|
it('should render a simple state diagrams', () => {
|
|
imgSnapshotTest(
|
|
`
|
|
stateDiagram
|
|
[*] --> State1
|
|
State1 --> State2
|
|
State1 --> State3
|
|
State1 --> [*]
|
|
`,
|
|
{ logLevel: 0 }
|
|
);
|
|
cy.get('svg');
|
|
});
|
|
it('should render a simple state diagrams with labels', () => {
|
|
imgSnapshotTest(
|
|
`
|
|
stateDiagram
|
|
[*] --> State1
|
|
State1 --> State2 : Transition 1
|
|
State1 --> State3 : Transition 2
|
|
State1 --> State4 : Transition 3
|
|
State1 --> State5 : Transition 4
|
|
State2 --> State3 : Transition 5
|
|
State1 --> [*]
|
|
`,
|
|
{ logLevel: 0 }
|
|
);
|
|
cy.get('svg');
|
|
});
|
|
it('should render state descriptions', () => {
|
|
imgSnapshotTest(
|
|
`
|
|
stateDiagram
|
|
state "Long state description" as XState1
|
|
state "Another Long state description" as XState2
|
|
XState2 : New line
|
|
`,
|
|
{ logLevel: 0 }
|
|
);
|
|
cy.get('svg');
|
|
});
|
|
});
|