Skip to content

Commit

Permalink
chore: Simplify unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Aug 20, 2024
1 parent f63eb45 commit 262bf4e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions packages/mermaid/src/diagrams/timeline/timeline.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,13 @@ describe('when parsing a timeline ', function () {
timeline.parse(str);
expect(commonDb.getDiagramTitle()).equal(';my;title;');
expect(timelineDB.getSections()).to.deep.equal([';a;bc-123;']);
expect(timelineDB.getTasks()[0].task).equal(';ta;sk1;');
expect(timelineDB.getTasks()[0].events[0]).equal(';ev;ent1; ');
expect(timelineDB.getTasks()[0].events[1]).equal(';ev;ent2; ');
expect(timelineDB.getTasks()[0].events[2]).equal(';ev;ent3;');
expect(timelineDB.getTasks()[0].events).toMatchInlineSnapshot(`
[
";ev;ent1; ",
";ev;ent2; ",
";ev;ent3;",
]
`);
});

it('should handle a title, section, task, and events with hashtags', function () {
Expand All @@ -125,9 +128,13 @@ describe('when parsing a timeline ', function () {
expect(commonDb.getDiagramTitle()).equal('#my#title#');
expect(timelineDB.getSections()).to.deep.equal(['#a#bc-123#']);
expect(timelineDB.getTasks()[0].task).equal('task1');
expect(timelineDB.getTasks()[0].events[0]).equal('#ev#ent1# ');
expect(timelineDB.getTasks()[0].events[1]).equal('#ev#ent2# ');
expect(timelineDB.getTasks()[0].events[2]).equal('#ev#ent3#');
expect(timelineDB.getTasks()[0].events).toMatchInlineSnapshot(`
[
"#ev#ent1# ",
"#ev#ent2# ",
"#ev#ent3#",
]
`);
});
});
});

0 comments on commit 262bf4e

Please sign in to comment.