Commit 55c6b8b1 authored by Phil Hughes's avatar Phil Hughes

fixed karma & eslint

parent d0378125
...@@ -69,9 +69,7 @@ export default { ...@@ -69,9 +69,7 @@ export default {
path: this.file.path, path: this.file.path,
baseSha: this.currentMergeRequest ? this.currentMergeRequest.baseCommitSha : '', baseSha: this.currentMergeRequest ? this.currentMergeRequest.baseCommitSha : '',
}) })
.then(() => { .then(() => this.updateViewer(this.file.pending ? 'diff' : this.viewer))
return this.updateViewer(this.file.pending ? 'diff' : 'editor');
})
.then(() => { .then(() => {
this.updateDelayViewerUpdated(false); this.updateDelayViewerUpdated(false);
this.createEditorInstance(); this.createEditorInstance();
......
...@@ -470,8 +470,9 @@ describe('IDE store file actions', () => { ...@@ -470,8 +470,9 @@ describe('IDE store file actions', () => {
testAction( testAction(
actions.stageChange, actions.stageChange,
'path', 'path',
null, store.state,
[{ type: types.STAGE_CHANGE, payload: 'path' }], [{ type: types.STAGE_CHANGE, payload: 'path' }],
[],
done, done,
); );
}); });
...@@ -482,8 +483,9 @@ describe('IDE store file actions', () => { ...@@ -482,8 +483,9 @@ describe('IDE store file actions', () => {
testAction( testAction(
actions.unstageChange, actions.unstageChange,
'path', 'path',
null, store.state,
[{ type: types.UNSTAGE_CHANGE, payload: 'path' }], [{ type: types.UNSTAGE_CHANGE, payload: 'path' }],
[],
done, done,
); );
}); });
...@@ -503,7 +505,7 @@ describe('IDE store file actions', () => { ...@@ -503,7 +505,7 @@ describe('IDE store file actions', () => {
it('makes file pending in openFiles', done => { it('makes file pending in openFiles', done => {
store store
.dispatch('openPendingTab', f) .dispatch('openPendingTab', { file: f, keyPrefix: 'pending' })
.then(() => { .then(() => {
expect(store.state.openFiles[0].pending).toBe(true); expect(store.state.openFiles[0].pending).toBe(true);
}) })
...@@ -513,7 +515,7 @@ describe('IDE store file actions', () => { ...@@ -513,7 +515,7 @@ describe('IDE store file actions', () => {
it('returns true when opened', done => { it('returns true when opened', done => {
store store
.dispatch('openPendingTab', f) .dispatch('openPendingTab', { file: f, keyPrefix: 'pending' })
.then(added => { .then(added => {
expect(added).toBe(true); expect(added).toBe(true);
}) })
...@@ -525,7 +527,7 @@ describe('IDE store file actions', () => { ...@@ -525,7 +527,7 @@ describe('IDE store file actions', () => {
store.state.currentBranchId = 'master'; store.state.currentBranchId = 'master';
store store
.dispatch('openPendingTab', f) .dispatch('openPendingTab', { file: f, keyPrefix: 'pending' })
.then(() => { .then(() => {
expect(router.push).toHaveBeenCalledWith('/project/123/tree/master/'); expect(router.push).toHaveBeenCalledWith('/project/123/tree/master/');
}) })
...@@ -539,7 +541,7 @@ describe('IDE store file actions', () => { ...@@ -539,7 +541,7 @@ describe('IDE store file actions', () => {
store._actions.scrollToTab = [scrollToTabSpy]; // eslint-disable-line store._actions.scrollToTab = [scrollToTabSpy]; // eslint-disable-line
store store
.dispatch('openPendingTab', f) .dispatch('openPendingTab', { file: f, keyPrefix: 'pending' })
.then(() => { .then(() => {
expect(scrollToTabSpy).toHaveBeenCalled(); expect(scrollToTabSpy).toHaveBeenCalled();
store._actions.scrollToTab = oldScrollToTab; // eslint-disable-line store._actions.scrollToTab = oldScrollToTab; // eslint-disable-line
...@@ -554,7 +556,7 @@ describe('IDE store file actions', () => { ...@@ -554,7 +556,7 @@ describe('IDE store file actions', () => {
store.state.viewer = 'diff'; store.state.viewer = 'diff';
store store
.dispatch('openPendingTab', f) .dispatch('openPendingTab', { file: f, keyPrefix: 'pending' })
.then(added => { .then(added => {
expect(added).toBe(false); expect(added).toBe(false);
}) })
......
...@@ -305,6 +305,7 @@ describe('Multi-file store actions', () => { ...@@ -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[0].path },
{ type: types.STAGE_CHANGE, payload: store.state.changedFiles[1].path }, { type: types.STAGE_CHANGE, payload: store.state.changedFiles[1].path },
], ],
[],
done, done,
); );
}); });
...@@ -322,6 +323,7 @@ describe('Multi-file store actions', () => { ...@@ -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[0].path },
{ type: types.UNSTAGE_CHANGE, payload: store.state.stagedFiles[1].path }, { type: types.UNSTAGE_CHANGE, payload: store.state.stagedFiles[1].path },
], ],
[],
done, done,
); );
}); });
......
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