diff options
author | Phil Hughes <me@iamphill.com> | 2018-04-05 10:46:19 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-04-05 12:51:21 +0100 |
commit | 55c6b8b12cc4a9e1a271c22dda5c7124c3e96ff7 (patch) | |
tree | 9393f4d03c017b3536d0d9410618eab45da03789 | |
parent | d0378125afbd835b9245e15d66fb96eb7d32e0af (diff) | |
download | gitlab-ce-55c6b8b12cc4a9e1a271c22dda5c7124c3e96ff7.tar.gz |
fixed karma & eslint
-rw-r--r-- | app/assets/javascripts/ide/components/repo_editor.vue | 4 | ||||
-rw-r--r-- | spec/javascripts/ide/stores/actions/file_spec.js | 16 | ||||
-rw-r--r-- | spec/javascripts/ide/stores/actions_spec.js | 2 |
3 files changed, 12 insertions, 10 deletions
diff --git a/app/assets/javascripts/ide/components/repo_editor.vue b/app/assets/javascripts/ide/components/repo_editor.vue index 008b2a01b56..43c5c47b951 100644 --- a/app/assets/javascripts/ide/components/repo_editor.vue +++ b/app/assets/javascripts/ide/components/repo_editor.vue @@ -69,9 +69,7 @@ export default { path: this.file.path, baseSha: this.currentMergeRequest ? this.currentMergeRequest.baseCommitSha : '', }) - .then(() => { - return this.updateViewer(this.file.pending ? 'diff' : 'editor'); - }) + .then(() => this.updateViewer(this.file.pending ? 'diff' : this.viewer)) .then(() => { this.updateDelayViewerUpdated(false); this.createEditorInstance(); diff --git a/spec/javascripts/ide/stores/actions/file_spec.js b/spec/javascripts/ide/stores/actions/file_spec.js index 8613c718eed..a4452d8d975 100644 --- a/spec/javascripts/ide/stores/actions/file_spec.js +++ b/spec/javascripts/ide/stores/actions/file_spec.js @@ -470,8 +470,9 @@ describe('IDE store file actions', () => { testAction( actions.stageChange, 'path', - null, + store.state, [{ type: types.STAGE_CHANGE, payload: 'path' }], + [], done, ); }); @@ -482,8 +483,9 @@ describe('IDE store file actions', () => { testAction( actions.unstageChange, 'path', - null, + store.state, [{ type: types.UNSTAGE_CHANGE, payload: 'path' }], + [], done, ); }); @@ -503,7 +505,7 @@ describe('IDE store file actions', () => { it('makes file pending in openFiles', done => { store - .dispatch('openPendingTab', f) + .dispatch('openPendingTab', { file: f, keyPrefix: 'pending' }) .then(() => { expect(store.state.openFiles[0].pending).toBe(true); }) @@ -513,7 +515,7 @@ describe('IDE store file actions', () => { it('returns true when opened', done => { store - .dispatch('openPendingTab', f) + .dispatch('openPendingTab', { file: f, keyPrefix: 'pending' }) .then(added => { expect(added).toBe(true); }) @@ -525,7 +527,7 @@ describe('IDE store file actions', () => { store.state.currentBranchId = 'master'; store - .dispatch('openPendingTab', f) + .dispatch('openPendingTab', { file: f, keyPrefix: 'pending' }) .then(() => { expect(router.push).toHaveBeenCalledWith('/project/123/tree/master/'); }) @@ -539,7 +541,7 @@ describe('IDE store file actions', () => { store._actions.scrollToTab = [scrollToTabSpy]; // eslint-disable-line store - .dispatch('openPendingTab', f) + .dispatch('openPendingTab', { file: f, keyPrefix: 'pending' }) .then(() => { expect(scrollToTabSpy).toHaveBeenCalled(); store._actions.scrollToTab = oldScrollToTab; // eslint-disable-line @@ -554,7 +556,7 @@ describe('IDE store file actions', () => { store.state.viewer = 'diff'; store - .dispatch('openPendingTab', f) + .dispatch('openPendingTab', { file: f, keyPrefix: 'pending' }) .then(added => { expect(added).toBe(false); }) diff --git a/spec/javascripts/ide/stores/actions_spec.js b/spec/javascripts/ide/stores/actions_spec.js index ce8d11c9c69..22a7441ba92 100644 --- a/spec/javascripts/ide/stores/actions_spec.js +++ b/spec/javascripts/ide/stores/actions_spec.js @@ -305,6 +305,7 @@ describe('Multi-file store actions', () => { { type: types.STAGE_CHANGE, payload: store.state.changedFiles[0].path }, { type: types.STAGE_CHANGE, payload: store.state.changedFiles[1].path }, ], + [], done, ); }); @@ -322,6 +323,7 @@ describe('Multi-file store actions', () => { { type: types.UNSTAGE_CHANGE, payload: store.state.stagedFiles[0].path }, { type: types.UNSTAGE_CHANGE, payload: store.state.stagedFiles[1].path }, ], + [], done, ); }); |