diff options
Diffstat (limited to 'spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js')
-rw-r--r-- | spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js b/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js index 6904e34db5d..1a3b151afa0 100644 --- a/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js +++ b/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js @@ -78,7 +78,7 @@ describe('AddContextCommitsModal', () => { findSearch().vm.$emit('input', searchText); expect(searchCommits).not.toBeCalled(); jest.advanceTimersByTime(500); - expect(searchCommits).toHaveBeenCalledWith(expect.anything(), searchText, undefined); + expect(searchCommits).toHaveBeenCalledWith(expect.anything(), searchText); }); it('disabled ok button when no row is selected', () => { @@ -119,18 +119,17 @@ describe('AddContextCommitsModal', () => { wrapper.vm.$store.state.selectedCommits = [{ ...commit, isSelected: true }]; findModal().vm.$emit('ok'); return wrapper.vm.$nextTick().then(() => { - expect(createContextCommits).toHaveBeenCalledWith( - expect.anything(), - { commits: [{ ...commit, isSelected: true }], forceReload: true }, - undefined, - ); + expect(createContextCommits).toHaveBeenCalledWith(expect.anything(), { + commits: [{ ...commit, isSelected: true }], + forceReload: true, + }); }); }); it('"removeContextCommits" when only added commits are to be removed ', () => { wrapper.vm.$store.state.toRemoveCommits = [commit.short_id]; findModal().vm.$emit('ok'); return wrapper.vm.$nextTick().then(() => { - expect(removeContextCommits).toHaveBeenCalledWith(expect.anything(), true, undefined); + expect(removeContextCommits).toHaveBeenCalledWith(expect.anything(), true); }); }); it('"createContextCommits" and "removeContextCommits" when new commits are to be added and old commits are to be removed', () => { @@ -138,12 +137,10 @@ describe('AddContextCommitsModal', () => { wrapper.vm.$store.state.toRemoveCommits = [commit.short_id]; findModal().vm.$emit('ok'); return wrapper.vm.$nextTick().then(() => { - expect(createContextCommits).toHaveBeenCalledWith( - expect.anything(), - { commits: [{ ...commit, isSelected: true }] }, - undefined, - ); - expect(removeContextCommits).toHaveBeenCalledWith(expect.anything(), undefined, undefined); + expect(createContextCommits).toHaveBeenCalledWith(expect.anything(), { + commits: [{ ...commit, isSelected: true }], + }); + expect(removeContextCommits).toHaveBeenCalledWith(expect.anything(), undefined); }); }); }); @@ -156,7 +153,7 @@ describe('AddContextCommitsModal', () => { }); it('"resetModalState" to reset all the modal state', () => { findModal().vm.$emit('cancel'); - expect(resetModalState).toHaveBeenCalledWith(expect.anything(), undefined, undefined); + expect(resetModalState).toHaveBeenCalledWith(expect.anything(), undefined); }); }); @@ -168,7 +165,7 @@ describe('AddContextCommitsModal', () => { }); it('"resetModalState" to reset all the modal state', () => { findModal().vm.$emit('close'); - expect(resetModalState).toHaveBeenCalledWith(expect.anything(), undefined, undefined); + expect(resetModalState).toHaveBeenCalledWith(expect.anything(), undefined); }); }); }); |