Trimming whitespace after participant id

This commit is contained in:
IOrlandoni
2019-07-14 11:51:20 -04:00
parent e5bd0e6dc7
commit e93cc85e9b
3 changed files with 42 additions and 32 deletions

View File

@@ -770,6 +770,19 @@ describe('when rendering a sequenceDiagram', function () {
expect(bounds.stopy).toBe(conf.height)
})
})
it('it should handle same actor with different whitespace properly', function () {
renderer.bounds.init()
const str = 'sequenceDiagram\n' +
'participant Alice\n' +
'participant Alice \n' +
'participant Alice \n'
parser.parse(str)
const actors = parser.yy.getActors()
expect(Object.keys(actors)).toEqual(['Alice'])
})
it('it should handle one actor and a centered note', function () {
renderer.bounds.init()
const str = 'sequenceDiagram\n' +