106 lines
2.4 KiB
JavaScript
Raw Normal View History

2019-09-18 18:25:06 +02:00
import { imgSnapshotTest } from '../../helpers/util.js';
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-10 20:08:56 +01:00
commit
commit
commit
`,
{}
);
});
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"
commit id: "Reverse Commit" commitType: REVERSE
commit id: "Hightlight Commit" commitType: HIGHLIGHT
`,
{}
);
});
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-10 20:08:56 +01:00
commit id: "Normal Commit with tag" teg: "v1.0.0"
commit id: "Reverse Commit with tag" commitType: REVERSE tag: "RC_1"
commit id: "Hightlight Commit" commitType: HIGHLIGHT tag: "8.8.4"
`,
{}
);
});
it('5: should render a simple gitgraph with two branches', () => {
imgSnapshotTest(
2022-03-17 19:07:16 +01:00
`gitGraph
2022-03-10 20:08:56 +01:00
commit
commit
branch develop
checkout develop
commit
commit
2022-03-17 19:19:25 +01:00
checkout main
2022-03-10 20:08:56 +01:00
commit
commit
`,
{}
);
});
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-10 20:08:56 +01:00
commit
commit
branch develop
checkout develop
commit
commit
2022-03-17 19:19:25 +01:00
checkout main
2022-03-10 20:08:56 +01:00
merge develop
commit
commit
`,
{}
);
});
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-10 20:08:56 +01:00
commit
commit
branch nice_feature
checkout nice_feature
commit
2022-03-17 19:19:25 +01:00
checkout main
2022-03-10 20:08:56 +01:00
commit
checkout nice_feature
branch very_nice_feature
checkout very_nice_feature
commit
2022-03-17 19:19:25 +01:00
checkout main
2022-03-10 20:08:56 +01:00
commit
checkout nice_feature
commit
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
commit
2022-03-17 19:19:25 +01:00
checkout main
2022-03-10 20:08:56 +01:00
commit
`,
{}
);
});
2019-09-18 18:25:06 +02:00
});