diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2019-06-26 17:07:56 +0300 |
---|---|---|
committer | Markus Koller <mkoller@gitlab.com> | 2019-07-18 10:19:18 +0300 |
commit | d4cc92db09a0c765556882943b7508075a0ab0e2 (patch) | |
tree | 67808ab5294ddeab1ac21d0fa916ffb017c5a22c /spec/frontend/ide | |
parent | f8cecafb07792bcaf9d7ffa85766c3b33c1dd252 (diff) |
FE remove create branch call in IDE commit
Previously `start_sha` was intercepted on the frontend to create the
correct branch in a separate API call. Now that the commits API supports
the `start_sha` parameter directly this workaround is not needed
anymore.
Diffstat (limited to 'spec/frontend/ide')
-rw-r--r-- | spec/frontend/ide/services/index_spec.js | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/spec/frontend/ide/services/index_spec.js b/spec/frontend/ide/services/index_spec.js index 499fa8fc012..3d5ed4b5c0c 100644 --- a/spec/frontend/ide/services/index_spec.js +++ b/spec/frontend/ide/services/index_spec.js @@ -16,40 +16,16 @@ describe('IDE services', () => { branch: TEST_BRANCH, commit_message: 'Hello world', actions: [], - start_sha: undefined, + start_sha: TEST_COMMIT_SHA, }; - Api.createBranch.mockReturnValue(Promise.resolve()); Api.commitMultiple.mockReturnValue(Promise.resolve()); }); - describe.each` - startSha | shouldCreateBranch - ${undefined} | ${false} - ${TEST_COMMIT_SHA} | ${true} - `('when start_sha is $startSha', ({ startSha, shouldCreateBranch }) => { - beforeEach(() => { - payload.start_sha = startSha; + it('should commit', () => { + services.commit(TEST_PROJECT_ID, payload); - return services.commit(TEST_PROJECT_ID, payload); - }); - - if (shouldCreateBranch) { - it('should create branch', () => { - expect(Api.createBranch).toHaveBeenCalledWith(TEST_PROJECT_ID, { - ref: TEST_COMMIT_SHA, - branch: TEST_BRANCH, - }); - }); - } else { - it('should not create branch', () => { - expect(Api.createBranch).not.toHaveBeenCalled(); - }); - } - - it('should commit', () => { - expect(Api.commitMultiple).toHaveBeenCalledWith(TEST_PROJECT_ID, payload); - }); + expect(Api.commitMultiple).toHaveBeenCalledWith(TEST_PROJECT_ID, payload); }); }); }); |