mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-20 15:59:51 +02:00
#931 Aligning with code standard
This commit is contained in:
@@ -1,38 +1,37 @@
|
||||
import flowDb from '../flowDb'
|
||||
import flow from './flow'
|
||||
import { setConfig } from '../../../config'
|
||||
import flowDb from '../flowDb';
|
||||
import flow from './flow';
|
||||
import { setConfig } from '../../../config';
|
||||
|
||||
setConfig({
|
||||
securityLevel: 'strict',
|
||||
})
|
||||
securityLevel: 'strict'
|
||||
});
|
||||
|
||||
describe('when parsing flowcharts', function () {
|
||||
beforeEach(function () {
|
||||
flow.parser.yy = flowDb
|
||||
flow.parser.yy.clear()
|
||||
})
|
||||
describe('when parsing flowcharts', function() {
|
||||
beforeEach(function() {
|
||||
flow.parser.yy = flowDb;
|
||||
flow.parser.yy.clear();
|
||||
});
|
||||
|
||||
it('should handle chaining of vertices', function () {
|
||||
it('should handle chaining of vertices', function() {
|
||||
const res = flow.parser.parse(`
|
||||
graph TD
|
||||
A-->B-->C;
|
||||
`);
|
||||
|
||||
const vert = flow.parser.yy.getVertices()
|
||||
const edges = flow.parser.yy.getEdges()
|
||||
const vert = flow.parser.yy.getVertices();
|
||||
const edges = flow.parser.yy.getEdges();
|
||||
|
||||
expect(vert['A'].id).toBe('A')
|
||||
expect(vert['B'].id).toBe('B')
|
||||
expect(vert['C'].id).toBe('C')
|
||||
expect(edges.length).toBe(2)
|
||||
expect(edges[0].start).toBe('A')
|
||||
expect(edges[0].end).toBe('B')
|
||||
expect(edges[0].type).toBe('arrow')
|
||||
expect(edges[0].text).toBe('')
|
||||
expect(edges[1].start).toBe('B')
|
||||
expect(edges[1].end).toBe('C')
|
||||
expect(edges[1].type).toBe('arrow')
|
||||
expect(edges[1].text).toBe('')
|
||||
})
|
||||
|
||||
})
|
||||
expect(vert['A'].id).toBe('A');
|
||||
expect(vert['B'].id).toBe('B');
|
||||
expect(vert['C'].id).toBe('C');
|
||||
expect(edges.length).toBe(2);
|
||||
expect(edges[0].start).toBe('A');
|
||||
expect(edges[0].end).toBe('B');
|
||||
expect(edges[0].type).toBe('arrow');
|
||||
expect(edges[0].text).toBe('');
|
||||
expect(edges[1].start).toBe('B');
|
||||
expect(edges[1].end).toBe('C');
|
||||
expect(edges[1].type).toBe('arrow');
|
||||
expect(edges[1].text).toBe('');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user