From 75815769b0b606f3d0c096009d14b864a5b876b0 Mon Sep 17 00:00:00 2001 From: jumpyoshim Date: Fri, 16 Nov 2018 06:29:53 +0900 Subject: Fix typo pipline to pipeline --- spec/javascripts/ide/stores/modules/pipelines/actions_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/javascripts/ide') diff --git a/spec/javascripts/ide/stores/modules/pipelines/actions_spec.js b/spec/javascripts/ide/stores/modules/pipelines/actions_spec.js index d85354c3681..c9c09ee9afe 100644 --- a/spec/javascripts/ide/stores/modules/pipelines/actions_spec.js +++ b/spec/javascripts/ide/stores/modules/pipelines/actions_spec.js @@ -77,7 +77,7 @@ describe('IDE pipelines actions', () => { { type: 'setErrorMessage', payload: { - text: 'An error occured whilst fetching the latest pipline.', + text: 'An error occured whilst fetching the latest pipeline.', action: jasmine.any(Function), actionText: 'Please try again', actionPayload: null, -- cgit v1.2.1 From ac8895b7413080a0f1a1bfe92227d3871e0ba1c7 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 20 Nov 2018 11:44:42 +0000 Subject: Open first 10 merge request files in IDE Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51635 --- spec/javascripts/ide/stores/actions/merge_request_spec.js | 1 + 1 file changed, 1 insertion(+) (limited to 'spec/javascripts/ide') diff --git a/spec/javascripts/ide/stores/actions/merge_request_spec.js b/spec/javascripts/ide/stores/actions/merge_request_spec.js index 3a4e0d7507f..950c447f924 100644 --- a/spec/javascripts/ide/stores/actions/merge_request_spec.js +++ b/spec/javascripts/ide/stores/actions/merge_request_spec.js @@ -321,6 +321,7 @@ describe('IDE store merge request actions', () => { expect(store.dispatch).toHaveBeenCalledWith('getFileData', { path: change.new_path, makeFileActive: i === 0, + openFile: true, }); }); }) -- cgit v1.2.1 From b24316b2fe757324b037aea7e06ce52d8dfa53d8 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 20 Nov 2018 15:11:33 +0000 Subject: Added a test for open merge request files --- .../ide/stores/actions/merge_request_spec.js | 30 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'spec/javascripts/ide') diff --git a/spec/javascripts/ide/stores/actions/merge_request_spec.js b/spec/javascripts/ide/stores/actions/merge_request_spec.js index 950c447f924..d8e9260e932 100644 --- a/spec/javascripts/ide/stores/actions/merge_request_spec.js +++ b/spec/javascripts/ide/stores/actions/merge_request_spec.js @@ -262,16 +262,28 @@ describe('IDE store merge request actions', () => { bar: {}, }; - spyOn(store, 'dispatch').and.callFake(type => { + const originalDispatch = store.dispatch; + + spyOn(store, 'dispatch').and.callFake((type, payload) => { switch (type) { case 'getMergeRequestData': return Promise.resolve(testMergeRequest); case 'getMergeRequestChanges': return Promise.resolve(testMergeRequestChanges); - default: + case 'getFiles': + case 'getMergeRequestVersions': + case 'getBranchData': + case 'setFileMrChange': return Promise.resolve(); + default: + return originalDispatch(type, payload); } }); + spyOn(service, 'getFileData').and.callFake(() => + Promise.resolve({ + headers: {}, + }), + ); }); it('dispatch actions for merge request data', done => { @@ -303,7 +315,17 @@ describe('IDE store merge request actions', () => { }); it('updates activity bar view and gets file data, if changes are found', done => { - testMergeRequestChanges.changes = [{ new_path: 'foo' }, { new_path: 'bar' }]; + store.state.entries.foo = { + url: 'test', + }; + store.state.entries.bar = { + url: 'test', + }; + + testMergeRequestChanges.changes = [ + { new_path: 'foo', path: 'foo' }, + { new_path: 'bar', path: 'bar' }, + ]; openMergeRequest(store, mr) .then(() => { @@ -324,6 +346,8 @@ describe('IDE store merge request actions', () => { openFile: true, }); }); + + expect(store.state.openFiles.length).toBe(testMergeRequestChanges.changes.length); }) .then(done) .catch(done.fail); -- cgit v1.2.1