Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend_integration/test_helpers/factories/commit.js')
-rw-r--r--spec/frontend_integration/test_helpers/factories/commit.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/frontend_integration/test_helpers/factories/commit.js b/spec/frontend_integration/test_helpers/factories/commit.js
new file mode 100644
index 00000000000..1ee82e74ffe
--- /dev/null
+++ b/spec/frontend_integration/test_helpers/factories/commit.js
@@ -0,0 +1,15 @@
+import { withValues } from '../utils/obj';
+import { getCommit } from '../fixtures';
+import { createCommitId } from './commit_id';
+
+// eslint-disable-next-line import/prefer-default-export
+export const createNewCommit = ({ id = createCommitId(), message }, orig = getCommit()) => {
+ return withValues(orig, {
+ id,
+ short_id: id.substr(0, 8),
+ message,
+ title: message,
+ web_url: orig.web_url.replace(orig.id, id),
+ parent_ids: [orig.id],
+ });
+};