Commit b46cb345 authored by derek-knox's avatar derek-knox

Fix tests, submit content branch portion

parent dd2d9a7f
...@@ -34,6 +34,9 @@ export const savedContentMeta = { ...@@ -34,6 +34,9 @@ export const savedContentMeta = {
}; };
export const submitChangesError = 'Could not save changes'; export const submitChangesError = 'Could not save changes';
export const commitBranchResponse = {
web_url: '/tree/root-master-patch-88195',
};
export const commitMultipleResponse = { export const commitMultipleResponse = {
short_id: 'ed899a2f4b5', short_id: 'ed899a2f4b5',
web_url: '/commit/ed899a2f4b5', web_url: '/commit/ed899a2f4b5',
......
...@@ -13,6 +13,7 @@ import submitContentChanges from '~/static_site_editor/services/submit_content_c ...@@ -13,6 +13,7 @@ import submitContentChanges from '~/static_site_editor/services/submit_content_c
import { import {
username, username,
projectId, projectId,
commitBranchResponse,
commitMultipleResponse, commitMultipleResponse,
createMergeRequestResponse, createMergeRequestResponse,
sourcePath, sourcePath,
...@@ -26,7 +27,7 @@ describe('submitContentChanges', () => { ...@@ -26,7 +27,7 @@ describe('submitContentChanges', () => {
const branch = 'branch-name'; const branch = 'branch-name';
beforeEach(() => { beforeEach(() => {
jest.spyOn(Api, 'createBranch').mockResolvedValue(); jest.spyOn(Api, 'createBranch').mockResolvedValue({ data: commitBranchResponse });
jest.spyOn(Api, 'commitMultiple').mockResolvedValue({ data: commitMultipleResponse }); jest.spyOn(Api, 'commitMultiple').mockResolvedValue({ data: commitMultipleResponse });
jest jest
.spyOn(Api, 'createProjectMergeRequest') .spyOn(Api, 'createProjectMergeRequest')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment