Updated er diagrams with the new syntax

This commit is contained in:
Knut Sveidqvist
2022-04-30 15:00:50 +02:00
parent 5e6b4d73e1
commit 5f4b7ae369
2 changed files with 34 additions and 9 deletions

View File

@@ -181,12 +181,31 @@ describe('when parsing ER diagram it...', function () {
expect(Object.keys(erDb.getEntities()).length).toBe(1);
});
it('should allow for a title and acc description', function () {
it('should allow for a accessibility title and description (accDescr)', function () {
const teacherRole = 'is teacher of';
const line1 = `TEACHER }o--o{ STUDENT : "${teacherRole}"`;
erDiagram.parser.parse(
`erDiagram\ntitle graph title\n accDescription this graph is about stuff\n${line1}`
`erDiagram
accTitle: graph title
accDescr: this graph is about stuff
${line1}`
);
expect(erDb.getTitle()).toBe('graph title');
expect(erDb.getAccDescription()).toBe('this graph is about stuff');
});
it('should allow for a accessibility title and multi line description (accDescr)', function () {
const teacherRole = 'is teacher of';
const line1 = `TEACHER }o--o{ STUDENT : "${teacherRole}"`;
erDiagram.parser.parse(
`erDiagram
accTitle: graph title
accDescr {
this graph is about stuff
}\n
${line1}`
);
expect(erDb.getTitle()).toBe('graph title');
expect(erDb.getAccDescription()).toBe('this graph is about stuff');