diff options
author | Phil Hughes <me@iamphill.com> | 2019-07-05 13:14:56 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-07-05 14:16:46 +0300 |
commit | 77c35d5d001a0ce0626bc8aeec574eca36c2233b (patch) | |
tree | 2a98e40e56b6d5820d8ee95a75675276e11b603b /spec/javascripts | |
parent | 9a4b5f08dbf5e0900145b5127f50e7ab3578d05c (diff) |
Create private merge requests in forks
https://gitlab.com/gitlab-org/gitlab-ce/issues/58583
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/create_merge_request_dropdown_spec.js | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/spec/javascripts/create_merge_request_dropdown_spec.js b/spec/javascripts/create_merge_request_dropdown_spec.js deleted file mode 100644 index 00fe3f451f5..00000000000 --- a/spec/javascripts/create_merge_request_dropdown_spec.js +++ /dev/null @@ -1,68 +0,0 @@ -import axios from '~/lib/utils/axios_utils'; -import MockAdapter from 'axios-mock-adapter'; -import CreateMergeRequestDropdown from '~/create_merge_request_dropdown'; -import { TEST_HOST } from 'spec/test_constants'; - -describe('CreateMergeRequestDropdown', () => { - let axiosMock; - let dropdown; - - beforeEach(() => { - axiosMock = new MockAdapter(axios); - - setFixtures(` - <div id="dummy-wrapper-element"> - <div class="available"></div> - <div class="unavailable"> - <div class="fa"></div> - <div class="text"></div> - </div> - <div class="js-ref"></div> - <div class="js-create-merge-request"></div> - <div class="js-create-target"></div> - <div class="js-dropdown-toggle"></div> - </div> - `); - - const dummyElement = document.getElementById('dummy-wrapper-element'); - dropdown = new CreateMergeRequestDropdown(dummyElement); - dropdown.refsPath = `${TEST_HOST}/dummy/refs?search=`; - }); - - afterEach(() => { - axiosMock.restore(); - }); - - describe('getRef', () => { - it('escapes branch names correctly', done => { - const endpoint = `${dropdown.refsPath}contains%23hash`; - spyOn(axios, 'get').and.callThrough(); - axiosMock.onGet(endpoint).replyOnce({}); - - dropdown - .getRef('contains#hash') - .then(() => { - expect(axios.get).toHaveBeenCalledWith(endpoint); - }) - .then(done) - .catch(done.fail); - }); - }); - - describe('updateCreatePaths', () => { - it('escapes branch names correctly', () => { - dropdown.createBranchPath = `${TEST_HOST}/branches?branch_name=some-branch&issue=42`; - dropdown.createMrPath = `${TEST_HOST}/create_merge_request?branch_name=some-branch&ref=master`; - - dropdown.updateCreatePaths('branch', 'contains#hash'); - - expect(dropdown.createBranchPath).toBe( - `${TEST_HOST}/branches?branch_name=contains%23hash&issue=42`, - ); - - expect(dropdown.createMrPath).toBe( - `${TEST_HOST}/create_merge_request?branch_name=contains%23hash&ref=master`, - ); - }); - }); -}); |