diff --git a/src/diagrams/git/gitGraphParserV2.spec.js b/src/diagrams/git/gitGraphParserV2.spec.js index b6c9c2459..8db1d6074 100644 --- a/src/diagrams/git/gitGraphParserV2.spec.js +++ b/src/diagrams/git/gitGraphParserV2.spec.js @@ -611,6 +611,22 @@ describe('when parsing a gitGraph', function () { ]); }); + it('should support cherry-picking commits', function () { + const str = `gitGraph + commit id: "ZERO" + branch develop + commit id:"A" + checkout main + cherry-pick id:"A" + `; + + parser.parse(str); + const commits = parser.yy.getCommits(); + const cherryPickCommitID = Object.keys(commits)[2]; + expect(commits[cherryPickCommitID].tag).toBe('cherry-pick:A'); + expect(commits[cherryPickCommitID].branch).toBe('main'); + }); + it('should throw error when try to branch existing branch: main', function () { const str = `gitGraph commit