feat: add hideUnusedParticipants and some cleanup

This commit is contained in:
Yash-Singh1
2022-04-14 19:19:18 -07:00
parent 85485d850c
commit 4c93870580
14 changed files with 1455 additions and 2005 deletions

View File

@@ -610,6 +610,22 @@ context('Sequence diagram', () => {
}
);
});
it("shouldn't display unused participants", () => {
//Be aware that the syntax for "properties" is likely to be changed.
imgSnapshotTest(
`
%%{init: { "config": { "hideUnusedParticipants": true }}}%%
sequenceDiagram
participant a
`,
{
logLevel: 0,
sequence: { mirrorActors: false, noteFontSize: 18, noteFontFamily: 'Arial' },
},
false,
(svg) => expect(svg.get('rect')).to.be.empty()
);
});
});
context('svg size', () => {
it('should render a sequence diagram when useMaxWidth is true (default)', () => {