feat: sequence diagram background rect

This commit is contained in:
Alexander Sage
2019-07-22 22:47:49 -07:00
parent 5d9018aeec
commit c8091c61c0
7 changed files with 163 additions and 80 deletions

View File

@@ -369,6 +369,28 @@ describe('when parsing a sequenceDiagram', function () {
expect(messages[0].from).toBe('Alice')
expect(messages[1].from).toBe('Bob')
})
it('it should handle rect statements', function () {
const str = `
sequenceDiagram
Alice->Bob: Hello Bob, how are you?
%% Comment
Note right of Bob: Bob thinks
rect rgb(200, 255, 200)
Bob-->Alice: I am good thanks
end
`
parser.parse(str)
const actors = parser.yy.getActors()
expect(actors.Alice.description).toBe('Alice')
actors.Bob.description = 'Bob'
const messages = parser.yy.getMessages()
expect(messages.length).toBe(5)
expect(messages[0].from).toBe('Alice')
expect(messages[1].from).toBe('Bob')
})
it('it should handle opt statements', function () {
const str = 'sequenceDiagram\n' +
'Alice->Bob: Hello Bob, how are you?\n\n' +