2019-09-18 18:25:06 +02:00
|
|
|
import { imgSnapshotTest } from '../../helpers/util.js';
|
2019-09-11 18:53:05 +02:00
|
|
|
|
2022-03-10 20:08:56 +01:00
|
|
|
describe('Git Graph diagram', () => {
|
2022-03-17 19:19:25 +01:00
|
|
|
it('1: should render a simple gitgraph with commit on main branch', () => {
|
2022-03-10 20:08:56 +01:00
|
|
|
imgSnapshotTest(
|
2022-03-17 19:07:16 +01:00
|
|
|
`gitGraph
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "1"
|
|
|
|
commit id: "2"
|
|
|
|
commit id: "3"
|
2022-03-10 20:08:56 +01:00
|
|
|
`,
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
});
|
2022-03-17 19:19:25 +01:00
|
|
|
it('2: should render a simple gitgraph with commit on main branch with Id', () => {
|
2022-03-10 20:08:56 +01:00
|
|
|
imgSnapshotTest(
|
2022-03-17 19:07:16 +01:00
|
|
|
`gitGraph
|
2022-03-10 20:08:56 +01:00
|
|
|
commit id: "One"
|
|
|
|
commit id: "Two"
|
|
|
|
commit id: "Three"
|
|
|
|
`,
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
});
|
2022-03-17 19:19:25 +01:00
|
|
|
it('3: should render a simple gitgraph with different commitTypes on main branch ', () => {
|
2022-03-10 20:08:56 +01:00
|
|
|
imgSnapshotTest(
|
2022-03-17 19:07:16 +01:00
|
|
|
`gitGraph
|
2022-03-10 20:08:56 +01:00
|
|
|
commit id: "Normal Commit"
|
2022-03-24 20:28:30 +01:00
|
|
|
commit id: "Reverse Commit" type: REVERSE
|
|
|
|
commit id: "Hightlight Commit" type: HIGHLIGHT
|
2022-03-10 20:08:56 +01:00
|
|
|
`,
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
});
|
2022-03-17 19:19:25 +01:00
|
|
|
it('4: should render a simple gitgraph with tags commitTypes on main branch ', () => {
|
2022-03-10 20:08:56 +01:00
|
|
|
imgSnapshotTest(
|
2022-03-17 19:07:16 +01:00
|
|
|
`gitGraph
|
2022-03-24 20:28:30 +01:00
|
|
|
commit id: "Normal Commit with tag" tag: "v1.0.0"
|
|
|
|
commit id: "Reverse Commit with tag" type: REVERSE tag: "RC_1"
|
|
|
|
commit id: "Hightlight Commit" type: HIGHLIGHT tag: "8.8.4"
|
2022-03-10 20:08:56 +01:00
|
|
|
`,
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
it('5: should render a simple gitgraph with two branches', () => {
|
|
|
|
imgSnapshotTest(
|
2022-03-17 19:07:16 +01:00
|
|
|
`gitGraph
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "1"
|
|
|
|
commit id: "2"
|
2022-03-10 20:08:56 +01:00
|
|
|
branch develop
|
|
|
|
checkout develop
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "3"
|
|
|
|
commit id: "4"
|
2022-03-17 19:19:25 +01:00
|
|
|
checkout main
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "5"
|
|
|
|
commit id: "6"
|
2022-03-10 20:08:56 +01:00
|
|
|
`,
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
it('6: should render a simple gitgraph with two branches and merge commit', () => {
|
|
|
|
imgSnapshotTest(
|
2022-03-17 19:07:16 +01:00
|
|
|
`gitGraph
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "1"
|
|
|
|
commit id: "2"
|
2022-03-10 20:08:56 +01:00
|
|
|
branch develop
|
|
|
|
checkout develop
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "3"
|
|
|
|
commit id: "4"
|
2022-03-17 19:19:25 +01:00
|
|
|
checkout main
|
2022-03-10 20:08:56 +01:00
|
|
|
merge develop
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "5"
|
|
|
|
commit id: "6"
|
2022-03-10 20:08:56 +01:00
|
|
|
`,
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
it('7: should render a simple gitgraph with three branches and merge commit', () => {
|
|
|
|
imgSnapshotTest(
|
2022-03-17 19:07:16 +01:00
|
|
|
`gitGraph
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "1"
|
|
|
|
commit id: "2"
|
2022-03-10 20:08:56 +01:00
|
|
|
branch nice_feature
|
|
|
|
checkout nice_feature
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "3"
|
2022-03-17 19:19:25 +01:00
|
|
|
checkout main
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "4"
|
2022-03-10 20:08:56 +01:00
|
|
|
checkout nice_feature
|
|
|
|
branch very_nice_feature
|
|
|
|
checkout very_nice_feature
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "5"
|
2022-03-17 19:19:25 +01:00
|
|
|
checkout main
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "6"
|
2022-03-10 20:08:56 +01:00
|
|
|
checkout nice_feature
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "7"
|
2022-03-17 19:19:25 +01:00
|
|
|
checkout main
|
2022-03-10 20:08:56 +01:00
|
|
|
merge nice_feature
|
|
|
|
checkout very_nice_feature
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "8"
|
2022-03-17 19:19:25 +01:00
|
|
|
checkout main
|
2022-03-31 19:49:42 +02:00
|
|
|
commit id: "9"
|
2022-03-10 20:08:56 +01:00
|
|
|
`,
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
});
|
2019-09-18 18:25:06 +02:00
|
|
|
});
|