mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 00:40:22 +02:00
handle case when merge is a noop
This commit is contained in:
@@ -114,4 +114,22 @@ describe('when parsing a gitGraph',function() {
|
||||
expect(parser.yy.getHead().id).toEqual(parser.yy.getBranches()["newbranch"]);
|
||||
});
|
||||
|
||||
it('it should handle cases when merge is a noop', function () {
|
||||
var str = 'gitGraph:\n' +
|
||||
'commit\n' +
|
||||
'branch newbranch\n' +
|
||||
'checkout newbranch\n' +
|
||||
'commit\n' +
|
||||
'commit\n' +
|
||||
'merge master\n';
|
||||
|
||||
parser.parse(str);
|
||||
|
||||
var commits = parser.yy.getCommits();
|
||||
console.log(commits);
|
||||
expect(Object.keys(commits).length).toBe(3);
|
||||
expect(parser.yy.getCurrentBranch()).toBe("newbranch");
|
||||
expect(parser.yy.getBranches()["newbranch"]).not.toEqual(parser.yy.getBranches()["master"]);
|
||||
expect(parser.yy.getHead().id).toEqual(parser.yy.getBranches()["newbranch"]);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user