Commit eb4687d0 authored by Sarah Groff Hennigh-Palermo's avatar Sarah Groff Hennigh-Palermo

Merge branch 'renovate-vue/vuex-3.x' into 'master'

Update dependency vuex to ^3.5.1

Closes #227151

See merge request gitlab-org/gitlab!39201
parents b3c05ea9 02c8bb06
---
title: Update dependency vuex to ^3.5.1
merge_request: 39201
author:
type: other
...@@ -241,7 +241,7 @@ describe('CodeReviewAnalyticsApp component', () => { ...@@ -241,7 +241,7 @@ describe('CodeReviewAnalyticsApp component', () => {
}); });
it('should call the setPage action', () => { it('should call the setPage action', () => {
expect(setPage).toHaveBeenCalledWith(expect.anything(), 2, undefined); expect(setPage).toHaveBeenCalledWith(expect.anything(), 2);
}); });
it('should call fetchMergeRequests action', () => { it('should call fetchMergeRequests action', () => {
......
...@@ -115,14 +115,10 @@ describe('FilteredSearchBar', () => { ...@@ -115,14 +115,10 @@ describe('FilteredSearchBar', () => {
expect(utils.processFilters).toHaveBeenCalledWith(filters); expect(utils.processFilters).toHaveBeenCalledWith(filters);
expect(setFiltersMock).toHaveBeenCalledWith( expect(setFiltersMock).toHaveBeenCalledWith(expect.anything(), {
expect.anything(),
{
selectedLabelList: [{ value: 'my-label', operator: '=' }], selectedLabelList: [{ value: 'my-label', operator: '=' }],
selectedMilestone: { value: 'my-milestone', operator: '=' }, selectedMilestone: { value: 'my-milestone', operator: '=' },
}, });
undefined,
);
}); });
}); });
}); });
...@@ -105,7 +105,6 @@ describe('DurationChart', () => { ...@@ -105,7 +105,6 @@ describe('DurationChart', () => {
expect(actionSpies.updateSelectedDurationChartStages).toHaveBeenCalledWith( expect(actionSpies.updateSelectedDurationChartStages).toHaveBeenCalledWith(
expect.any(Object), expect.any(Object),
selectedStages, selectedStages,
undefined,
); );
}); });
}); });
......
...@@ -168,16 +168,12 @@ describe('Filter bar', () => { ...@@ -168,16 +168,12 @@ describe('Filter bar', () => {
expect(utils.processFilters).toHaveBeenCalledWith(filters); expect(utils.processFilters).toHaveBeenCalledWith(filters);
expect(setFiltersMock).toHaveBeenCalledWith( expect(setFiltersMock).toHaveBeenCalledWith(expect.anything(), {
expect.anything(),
{
selectedLabelList: [{ value: selectedLabelList[0].title, operator: '=' }], selectedLabelList: [{ value: selectedLabelList[0].title, operator: '=' }],
selectedMilestone: { value: selectedMilestone[0].title, operator: '=' }, selectedMilestone: { value: selectedMilestone[0].title, operator: '=' },
selectedAssigneeList: [], selectedAssigneeList: [],
selectedAuthor: null, selectedAuthor: null,
}, });
undefined,
);
}); });
}); });
......
...@@ -110,11 +110,7 @@ describe('TypeOfWorkCharts', () => { ...@@ -110,11 +110,7 @@ describe('TypeOfWorkCharts', () => {
}); });
it('calls the setTasksByTypeFilters method', () => { it('calls the setTasksByTypeFilters method', () => {
expect(actionSpies.setTasksByTypeFilters).toHaveBeenCalledWith( expect(actionSpies.setTasksByTypeFilters).toHaveBeenCalledWith(expect.any(Object), payload);
expect.any(Object),
payload,
undefined,
);
}); });
}); });
......
...@@ -162,11 +162,9 @@ describe('ValueStreamSelect', () => { ...@@ -162,11 +162,9 @@ describe('ValueStreamSelect', () => {
}); });
it('calls the "createValueStream" event when submitted', () => { it('calls the "createValueStream" event when submitted', () => {
expect(createValueStreamMock).toHaveBeenCalledWith( expect(createValueStreamMock).toHaveBeenCalledWith(expect.any(Object), {
expect.any(Object), name: streamName,
{ name: streamName }, });
undefined,
);
}); });
it('clears the name field', () => { it('clears the name field', () => {
......
...@@ -60,11 +60,9 @@ describe('EE Approvals App', () => { ...@@ -60,11 +60,9 @@ describe('EE Approvals App', () => {
store.state.settings.mrSettingsPath = null; store.state.settings.mrSettingsPath = null;
factory(); factory();
expect(store.modules.approvals.actions.fetchRules).toHaveBeenCalledWith( expect(store.modules.approvals.actions.fetchRules).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), targetBranch: targetBranchName,
{ targetBranch: targetBranchName }, });
undefined,
);
}); });
it('passes the target branch name in fetchRules for MR edit path', () => { it('passes the target branch name in fetchRules for MR edit path', () => {
...@@ -72,11 +70,9 @@ describe('EE Approvals App', () => { ...@@ -72,11 +70,9 @@ describe('EE Approvals App', () => {
store.state.settings.mrSettingsPath = 'some/path'; store.state.settings.mrSettingsPath = 'some/path';
factory(); factory();
expect(store.modules.approvals.actions.fetchRules).toHaveBeenCalledWith( expect(store.modules.approvals.actions.fetchRules).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), targetBranch: targetBranchName,
{ targetBranch: targetBranchName }, });
undefined,
);
}); });
it('does not pass the target branch name in fetchRules for project settings path', () => { it('does not pass the target branch name in fetchRules for project settings path', () => {
...@@ -84,11 +80,9 @@ describe('EE Approvals App', () => { ...@@ -84,11 +80,9 @@ describe('EE Approvals App', () => {
store.modules.approvals.state.targetBranch = null; store.modules.approvals.state.targetBranch = null;
factory(); factory();
expect(store.modules.approvals.actions.fetchRules).toHaveBeenCalledWith( expect(store.modules.approvals.actions.fetchRules).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), targetBranch: null,
{ targetBranch: null }, });
undefined,
);
}); });
}); });
...@@ -188,7 +182,6 @@ describe('EE Approvals App', () => { ...@@ -188,7 +182,6 @@ describe('EE Approvals App', () => {
expect(store.modules.createModal.actions.open).toHaveBeenCalledWith( expect(store.modules.createModal.actions.open).toHaveBeenCalledWith(
expect.anything(), expect.anything(),
null, null,
undefined,
); );
}); });
}); });
...@@ -226,7 +219,6 @@ describe('EE Approvals App', () => { ...@@ -226,7 +219,6 @@ describe('EE Approvals App', () => {
expect(store.modules.approvals.actions.fetchRules).toHaveBeenLastCalledWith( expect(store.modules.approvals.actions.fetchRules).toHaveBeenLastCalledWith(
expect.anything(), expect.anything(),
{ targetBranch, resetToDefault: true }, { targetBranch, resetToDefault: true },
undefined,
); );
expect(showToast).toHaveBeenCalledWith('Approval rules reset to project defaults', { expect(showToast).toHaveBeenCalledWith('Approval rules reset to project defaults', {
action: { action: {
......
...@@ -126,7 +126,6 @@ describe('EE Approvals LicenseCompliance', () => { ...@@ -126,7 +126,6 @@ describe('EE Approvals LicenseCompliance', () => {
expect(store.modules.approvalsModal.actions.open).toHaveBeenCalledWith( expect(store.modules.approvalsModal.actions.open).toHaveBeenCalledWith(
expect.any(Object), expect.any(Object),
mockLicenseCheckRule, mockLicenseCheckRule,
undefined,
); );
}); });
}); });
......
...@@ -97,6 +97,6 @@ describe('Approvals ModalRuleRemove', () => { ...@@ -97,6 +97,6 @@ describe('Approvals ModalRuleRemove', () => {
const modal = wrapper.find(GlModalVuex); const modal = wrapper.find(GlModalVuex);
modal.vm.$emit('ok', new Event('submit')); modal.vm.$emit('ok', new Event('submit'));
expect(actions.deleteRule).toHaveBeenCalledWith(expect.anything(), TEST_RULE.id, undefined); expect(actions.deleteRule).toHaveBeenCalledWith(expect.anything(), TEST_RULE.id);
}); });
}); });
...@@ -83,11 +83,7 @@ describe('Rule Input', () => { ...@@ -83,11 +83,7 @@ describe('Rule Input', () => {
jest.runAllTimers(); jest.runAllTimers();
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(action).toHaveBeenCalledWith( expect(action).toHaveBeenCalledWith(expect.anything(), { approvalsRequired: 10, id: 5 });
expect.anything(),
{ approvalsRequired: 10, id: 5 },
undefined,
);
}); });
}); });
}); });
...@@ -32,7 +32,7 @@ describe('Approvals ProjectRules', () => { ...@@ -32,7 +32,7 @@ describe('Approvals ProjectRules', () => {
let store; let store;
const factory = (props = {}, options = {}) => { const factory = (props = {}, options = {}) => {
wrapper = mount(localVue.extend(ProjectRules), { wrapper = mount(ProjectRules, {
propsData: props, propsData: props,
store: new Vuex.Store(store), store: new Vuex.Store(store),
localVue, localVue,
...@@ -100,8 +100,6 @@ describe('Approvals ProjectRules', () => { ...@@ -100,8 +100,6 @@ describe('Approvals ProjectRules', () => {
}); });
it('should only display 1 rule', () => { it('should only display 1 rule', () => {
factory();
expect(store.modules.approvals.state.rules.length).toBe(1); expect(store.modules.approvals.state.rules.length).toBe(1);
}); });
}); });
......
...@@ -70,7 +70,6 @@ describe('EE Approvals RuleControls', () => { ...@@ -70,7 +70,6 @@ describe('EE Approvals RuleControls', () => {
expect(store.modules.approvals.actions.requestEditRule).toHaveBeenCalledWith( expect(store.modules.approvals.actions.requestEditRule).toHaveBeenCalledWith(
expect.anything(), expect.anything(),
TEST_RULE, TEST_RULE,
undefined,
); );
}); });
}); });
...@@ -95,7 +94,6 @@ describe('EE Approvals RuleControls', () => { ...@@ -95,7 +94,6 @@ describe('EE Approvals RuleControls', () => {
expect(store.modules.approvals.actions.requestDeleteRule).toHaveBeenCalledWith( expect(store.modules.approvals.actions.requestDeleteRule).toHaveBeenCalledWith(
expect.anything(), expect.anything(),
TEST_RULE, TEST_RULE,
undefined,
); );
}); });
}); });
......
...@@ -49,7 +49,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -49,7 +49,7 @@ describe('EE Approvals RuleForm', () => {
let actions; let actions;
const createComponent = (props = {}, options = {}) => { const createComponent = (props = {}, options = {}) => {
wrapper = shallowMount(localVue.extend(RuleForm), { wrapper = shallowMount(RuleForm, {
propsData: props, propsData: props,
store: new Vuex.Store(store), store: new Vuex.Store(store),
localVue, localVue,
...@@ -176,7 +176,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -176,7 +176,7 @@ describe('EE Approvals RuleForm', () => {
wrapper.vm.submit(); wrapper.vm.submit();
expect(actions.postRule).toHaveBeenCalledWith(expect.anything(), expected, undefined); expect(actions.postRule).toHaveBeenCalledWith(expect.anything(), expected);
}); });
}); });
}); });
...@@ -279,7 +279,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -279,7 +279,7 @@ describe('EE Approvals RuleForm', () => {
it('on submit, posts rule', () => { it('on submit, posts rule', () => {
wrapper.vm.submit(); wrapper.vm.submit();
expect(actions.postRule).toHaveBeenCalledWith(expect.anything(), expected, undefined); expect(actions.postRule).toHaveBeenCalledWith(expect.anything(), expected);
}); });
it('when submitted with a duplicate name, shows the "taken name" validation', async () => { it('when submitted with a duplicate name, shows the "taken name" validation', async () => {
...@@ -358,7 +358,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -358,7 +358,7 @@ describe('EE Approvals RuleForm', () => {
it('on submit, puts rule', () => { it('on submit, puts rule', () => {
wrapper.vm.submit(); wrapper.vm.submit();
expect(actions.putRule).toHaveBeenCalledWith(expect.anything(), expected, undefined); expect(actions.putRule).toHaveBeenCalledWith(expect.anything(), expected);
}); });
it('when submitted with a duplicate name, shows the "taken name" validation', async () => { it('when submitted with a duplicate name, shows the "taken name" validation', async () => {
...@@ -402,11 +402,9 @@ describe('EE Approvals RuleForm', () => { ...@@ -402,11 +402,9 @@ describe('EE Approvals RuleForm', () => {
}); });
it('puts fallback rule', () => { it('puts fallback rule', () => {
expect(actions.putFallbackRule).toHaveBeenCalledWith( expect(actions.putFallbackRule).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), approvalsRequired: TEST_APPROVALS_REQUIRED,
{ approvalsRequired: TEST_APPROVALS_REQUIRED }, });
undefined,
);
}); });
it('does not show any validation errors', () => { it('does not show any validation errors', () => {
...@@ -495,7 +493,6 @@ describe('EE Approvals RuleForm', () => { ...@@ -495,7 +493,6 @@ describe('EE Approvals RuleForm', () => {
expect.objectContaining({ expect.objectContaining({
removeHiddenGroups: false, removeHiddenGroups: false,
}), }),
undefined,
); );
}); });
...@@ -512,7 +509,6 @@ describe('EE Approvals RuleForm', () => { ...@@ -512,7 +509,6 @@ describe('EE Approvals RuleForm', () => {
expect.objectContaining({ expect.objectContaining({
removeHiddenGroups: true, removeHiddenGroups: true,
}), }),
undefined,
); );
}); });
}); });
...@@ -662,7 +658,6 @@ describe('EE Approvals RuleForm', () => { ...@@ -662,7 +658,6 @@ describe('EE Approvals RuleForm', () => {
approvalsRequired: TEST_APPROVALS_REQUIRED, approvalsRequired: TEST_APPROVALS_REQUIRED,
users: TEST_APPROVERS.map(x => x.id), users: TEST_APPROVERS.map(x => x.id),
}), }),
undefined,
); );
}); });
}); });
...@@ -675,11 +670,9 @@ describe('EE Approvals RuleForm', () => { ...@@ -675,11 +670,9 @@ describe('EE Approvals RuleForm', () => {
}); });
it('puts fallback rule', () => { it('puts fallback rule', () => {
expect(actions.putFallbackRule).toHaveBeenCalledWith( expect(actions.putFallbackRule).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), approvalsRequired: TEST_APPROVALS_REQUIRED,
{ approvalsRequired: TEST_APPROVALS_REQUIRED }, });
undefined,
);
}); });
}); });
}); });
...@@ -708,19 +701,13 @@ describe('EE Approvals RuleForm', () => { ...@@ -708,19 +701,13 @@ describe('EE Approvals RuleForm', () => {
}); });
it('deletes rule', () => { it('deletes rule', () => {
expect(actions.deleteRule).toHaveBeenCalledWith( expect(actions.deleteRule).toHaveBeenCalledWith(expect.anything(), TEST_RULE.id);
expect.anything(),
TEST_RULE.id,
undefined,
);
}); });
it('puts fallback rule', () => { it('puts fallback rule', () => {
expect(actions.putFallbackRule).toHaveBeenCalledWith( expect(actions.putFallbackRule).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), approvalsRequired: TEST_APPROVALS_REQUIRED,
{ approvalsRequired: TEST_APPROVALS_REQUIRED }, });
undefined,
);
}); });
}); });
...@@ -742,7 +729,6 @@ describe('EE Approvals RuleForm', () => { ...@@ -742,7 +729,6 @@ describe('EE Approvals RuleForm', () => {
approvalsRequired: TEST_APPROVALS_REQUIRED, approvalsRequired: TEST_APPROVALS_REQUIRED,
users: TEST_APPROVERS.map(x => x.id), users: TEST_APPROVERS.map(x => x.id),
}), }),
undefined,
); );
}); });
}); });
......
...@@ -80,7 +80,6 @@ describe('GeoNodeFormNamespaces', () => { ...@@ -80,7 +80,6 @@ describe('GeoNodeFormNamespaces', () => {
expect(actionSpies.fetchSyncNamespaces).toHaveBeenCalledWith( expect(actionSpies.fetchSyncNamespaces).toHaveBeenCalledWith(
expect.any(Object), expect.any(Object),
namespaceSearch, namespaceSearch,
undefined,
); );
}); });
}); });
......
...@@ -78,7 +78,7 @@ describe('GeoReplicableFilterBar', () => { ...@@ -78,7 +78,7 @@ describe('GeoReplicableFilterBar', () => {
.at(index) .at(index)
.vm.$emit('click'); .vm.$emit('click');
expect(actionSpies.setFilter).toHaveBeenCalledWith(expect.any(Object), index, undefined); expect(actionSpies.setFilter).toHaveBeenCalledWith(expect.any(Object), index);
}); });
}); });
...@@ -99,11 +99,7 @@ describe('GeoReplicableFilterBar', () => { ...@@ -99,11 +99,7 @@ describe('GeoReplicableFilterBar', () => {
}); });
it('calls fetchSyncNamespaces when input event is fired from GlSearchBoxByType', () => { it('calls fetchSyncNamespaces when input event is fired from GlSearchBoxByType', () => {
expect(actionSpies.setSearch).toHaveBeenCalledWith( expect(actionSpies.setSearch).toHaveBeenCalledWith(expect.any(Object), testSearch);
expect.any(Object),
testSearch,
undefined,
);
expect(actionSpies.fetchReplicableItems).toHaveBeenCalled(); expect(actionSpies.fetchReplicableItems).toHaveBeenCalled();
}); });
}); });
...@@ -130,7 +126,7 @@ describe('GeoReplicableFilterBar', () => { ...@@ -130,7 +126,7 @@ describe('GeoReplicableFilterBar', () => {
}); });
it('should call setFilter with the filterIndex', () => { it('should call setFilter with the filterIndex', () => {
expect(actionSpies.setFilter).toHaveBeenCalledWith(expect.any(Object), testValue, undefined); expect(actionSpies.setFilter).toHaveBeenCalledWith(expect.any(Object), testValue);
}); });
it('should call fetchReplicableItems', () => { it('should call fetchReplicableItems', () => {
......
...@@ -83,15 +83,11 @@ describe('GeoReplicableItem', () => { ...@@ -83,15 +83,11 @@ describe('GeoReplicableItem', () => {
it('calls initiateReplicableSync when clicked', () => { it('calls initiateReplicableSync when clicked', () => {
findGlButton().trigger('click'); findGlButton().trigger('click');
expect(actionSpies.initiateReplicableSync).toHaveBeenCalledWith( expect(actionSpies.initiateReplicableSync).toHaveBeenCalledWith(expect.any(Object), {
expect.any(Object),
{
projectId: mockReplicable.projectId, projectId: mockReplicable.projectId,
name: mockReplicable.name, name: mockReplicable.name,
action: ACTION_TYPES.RESYNC, action: ACTION_TYPES.RESYNC,
}, });
undefined,
);
}); });
}); });
}); });
......
...@@ -71,7 +71,7 @@ describe('SAML providers members app', () => { ...@@ -71,7 +71,7 @@ describe('SAML providers members app', () => {
const changeFn = wrapper.find(TablePagination).props('change'); const changeFn = wrapper.find(TablePagination).props('change');
changeFn(2); changeFn(2);
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(fetchPageMock).toHaveBeenCalledWith(expect.anything(), 2, undefined); expect(fetchPageMock).toHaveBeenCalledWith(expect.anything(), 2);
}); });
}); });
}); });
......
...@@ -98,7 +98,6 @@ describe('DeleteConfirmationModal', () => { ...@@ -98,7 +98,6 @@ describe('DeleteConfirmationModal', () => {
expect(actions.deleteLicense).toHaveBeenCalledWith( expect(actions.deleteLicense).toHaveBeenCalledWith(
expect.any(Object), expect.any(Object),
store.state.licenseManagement.currentLicenseInModal, store.state.licenseManagement.currentLicenseInModal,
undefined,
); );
}); });
}); });
......
...@@ -300,7 +300,6 @@ describe('SetApprovalModal', () => { ...@@ -300,7 +300,6 @@ describe('SetApprovalModal', () => {
expect(actions.allowLicense).toHaveBeenCalledWith( expect(actions.allowLicense).toHaveBeenCalledWith(
expect.any(Object), expect.any(Object),
store.state.licenseManagement.currentLicenseInModal, store.state.licenseManagement.currentLicenseInModal,
undefined,
); );
}); });
}); });
...@@ -313,7 +312,6 @@ describe('SetApprovalModal', () => { ...@@ -313,7 +312,6 @@ describe('SetApprovalModal', () => {
expect(actions.denyLicense).toHaveBeenCalledWith( expect(actions.denyLicense).toHaveBeenCalledWith(
expect.any(Object), expect.any(Object),
store.state.licenseManagement.currentLicenseInModal, store.state.licenseManagement.currentLicenseInModal,
undefined,
); );
}); });
}); });
......
...@@ -121,11 +121,7 @@ describe('License Management', () => { ...@@ -121,11 +121,7 @@ describe('License Management', () => {
isAdmin, isAdmin,
}); });
expect(fetchManagedLicensesMock).toHaveBeenCalledWith( expect(fetchManagedLicensesMock).toHaveBeenCalledWith(expect.any(Object), undefined);
expect.any(Object),
undefined,
undefined,
);
}); });
}); });
}); });
......
...@@ -347,27 +347,18 @@ describe('License Report MR Widget', () => { ...@@ -347,27 +347,18 @@ describe('License Report MR Widget', () => {
}; };
mountComponent({ actions }); mountComponent({ actions });
expect(actions.setAPISettings).toHaveBeenCalledWith( expect(actions.setAPISettings).toHaveBeenCalledWith(expect.any(Object), {
expect.any(Object),
{
apiUrlManageLicenses: apiUrl, apiUrlManageLicenses: apiUrl,
licensesApiPath: defaultProps.licensesApiPath, licensesApiPath: defaultProps.licensesApiPath,
approvalsApiPath: defaultProps.approvalsApiPath, approvalsApiPath: defaultProps.approvalsApiPath,
canManageLicenses: true, canManageLicenses: true,
}, });
undefined,
);
expect(actions.fetchParsedLicenseReport).toHaveBeenCalledWith( expect(actions.fetchParsedLicenseReport).toHaveBeenCalledWith(expect.any(Object), undefined);
expect.any(Object),
undefined,
undefined,
);
expect(actions.fetchLicenseCheckApprovalRule).toHaveBeenCalledWith( expect(actions.fetchLicenseCheckApprovalRule).toHaveBeenCalledWith(
expect.any(Object), expect.any(Object),
undefined, undefined,
undefined,
); );
}); });
......
...@@ -78,7 +78,7 @@ describe('AddContextCommitsModal', () => { ...@@ -78,7 +78,7 @@ describe('AddContextCommitsModal', () => {
findSearch().vm.$emit('input', searchText); findSearch().vm.$emit('input', searchText);
expect(searchCommits).not.toBeCalled(); expect(searchCommits).not.toBeCalled();
jest.advanceTimersByTime(500); 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', () => { it('disabled ok button when no row is selected', () => {
...@@ -119,18 +119,17 @@ describe('AddContextCommitsModal', () => { ...@@ -119,18 +119,17 @@ describe('AddContextCommitsModal', () => {
wrapper.vm.$store.state.selectedCommits = [{ ...commit, isSelected: true }]; wrapper.vm.$store.state.selectedCommits = [{ ...commit, isSelected: true }];
findModal().vm.$emit('ok'); findModal().vm.$emit('ok');
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(createContextCommits).toHaveBeenCalledWith( expect(createContextCommits).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), commits: [{ ...commit, isSelected: true }],
{ commits: [{ ...commit, isSelected: true }], forceReload: true }, forceReload: true,
undefined, });
);
}); });
}); });
it('"removeContextCommits" when only added commits are to be removed ', () => { it('"removeContextCommits" when only added commits are to be removed ', () => {
wrapper.vm.$store.state.toRemoveCommits = [commit.short_id]; wrapper.vm.$store.state.toRemoveCommits = [commit.short_id];
findModal().vm.$emit('ok'); findModal().vm.$emit('ok');
return wrapper.vm.$nextTick().then(() => { 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', () => { it('"createContextCommits" and "removeContextCommits" when new commits are to be added and old commits are to be removed', () => {
...@@ -138,12 +137,10 @@ describe('AddContextCommitsModal', () => { ...@@ -138,12 +137,10 @@ describe('AddContextCommitsModal', () => {
wrapper.vm.$store.state.toRemoveCommits = [commit.short_id]; wrapper.vm.$store.state.toRemoveCommits = [commit.short_id];
findModal().vm.$emit('ok'); findModal().vm.$emit('ok');
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(createContextCommits).toHaveBeenCalledWith( expect(createContextCommits).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), commits: [{ ...commit, isSelected: true }],
{ commits: [{ ...commit, isSelected: true }] }, });
undefined, expect(removeContextCommits).toHaveBeenCalledWith(expect.anything(), undefined);
);
expect(removeContextCommits).toHaveBeenCalledWith(expect.anything(), undefined, undefined);
}); });
}); });
}); });
...@@ -156,7 +153,7 @@ describe('AddContextCommitsModal', () => { ...@@ -156,7 +153,7 @@ describe('AddContextCommitsModal', () => {
}); });
it('"resetModalState" to reset all the modal state', () => { it('"resetModalState" to reset all the modal state', () => {
findModal().vm.$emit('cancel'); findModal().vm.$emit('cancel');
expect(resetModalState).toHaveBeenCalledWith(expect.anything(), undefined, undefined); expect(resetModalState).toHaveBeenCalledWith(expect.anything(), undefined);
}); });
}); });
...@@ -168,7 +165,7 @@ describe('AddContextCommitsModal', () => { ...@@ -168,7 +165,7 @@ describe('AddContextCommitsModal', () => {
}); });
it('"resetModalState" to reset all the modal state', () => { it('"resetModalState" to reset all the modal state', () => {
findModal().vm.$emit('close'); findModal().vm.$emit('close');
expect(resetModalState).toHaveBeenCalledWith(expect.anything(), undefined, undefined); expect(resetModalState).toHaveBeenCalledWith(expect.anything(), undefined);
}); });
}); });
}); });
...@@ -401,43 +401,33 @@ describe('EksClusterConfigurationForm', () => { ...@@ -401,43 +401,33 @@ describe('EksClusterConfigurationForm', () => {
}); });
it('dispatches setRegion action', () => { it('dispatches setRegion action', () => {
expect(actions.setRegion).toHaveBeenCalledWith(expect.anything(), { region }, undefined); expect(actions.setRegion).toHaveBeenCalledWith(expect.anything(), { region });
}); });
it('fetches available vpcs', () => { it('fetches available vpcs', () => {
expect(vpcsActions.fetchItems).toHaveBeenCalledWith(expect.anything(), { region }, undefined); expect(vpcsActions.fetchItems).toHaveBeenCalledWith(expect.anything(), { region });
}); });
it('fetches available key pairs', () => { it('fetches available key pairs', () => {
expect(keyPairsActions.fetchItems).toHaveBeenCalledWith( expect(keyPairsActions.fetchItems).toHaveBeenCalledWith(expect.anything(), { region });
expect.anything(),
{ region },
undefined,
);
}); });
it('cleans selected vpc', () => { it('cleans selected vpc', () => {
expect(actions.setVpc).toHaveBeenCalledWith(expect.anything(), { vpc: null }, undefined); expect(actions.setVpc).toHaveBeenCalledWith(expect.anything(), { vpc: null });
}); });
it('cleans selected key pair', () => { it('cleans selected key pair', () => {
expect(actions.setKeyPair).toHaveBeenCalledWith( expect(actions.setKeyPair).toHaveBeenCalledWith(expect.anything(), { keyPair: null });
expect.anything(),
{ keyPair: null },
undefined,
);
}); });
it('cleans selected subnet', () => { it('cleans selected subnet', () => {
expect(actions.setSubnet).toHaveBeenCalledWith(expect.anything(), { subnet: [] }, undefined); expect(actions.setSubnet).toHaveBeenCalledWith(expect.anything(), { subnet: [] });
}); });
it('cleans selected security group', () => { it('cleans selected security group', () => {
expect(actions.setSecurityGroup).toHaveBeenCalledWith( expect(actions.setSecurityGroup).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), securityGroup: null,
{ securityGroup: null }, });
undefined,
);
}); });
}); });
...@@ -446,11 +436,7 @@ describe('EksClusterConfigurationForm', () => { ...@@ -446,11 +436,7 @@ describe('EksClusterConfigurationForm', () => {
findClusterNameInput().vm.$emit('input', clusterName); findClusterNameInput().vm.$emit('input', clusterName);
expect(actions.setClusterName).toHaveBeenCalledWith( expect(actions.setClusterName).toHaveBeenCalledWith(expect.anything(), { clusterName });
expect.anything(),
{ clusterName },
undefined,
);
}); });
it('dispatches setEnvironmentScope when environment scope input changes', () => { it('dispatches setEnvironmentScope when environment scope input changes', () => {
...@@ -458,11 +444,9 @@ describe('EksClusterConfigurationForm', () => { ...@@ -458,11 +444,9 @@ describe('EksClusterConfigurationForm', () => {
findEnvironmentScopeInput().vm.$emit('input', environmentScope); findEnvironmentScopeInput().vm.$emit('input', environmentScope);
expect(actions.setEnvironmentScope).toHaveBeenCalledWith( expect(actions.setEnvironmentScope).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), environmentScope,
{ environmentScope }, });
undefined,
);
}); });
it('dispatches setKubernetesVersion when kubernetes version dropdown changes', () => { it('dispatches setKubernetesVersion when kubernetes version dropdown changes', () => {
...@@ -470,11 +454,9 @@ describe('EksClusterConfigurationForm', () => { ...@@ -470,11 +454,9 @@ describe('EksClusterConfigurationForm', () => {
findKubernetesVersionDropdown().vm.$emit('input', kubernetesVersion); findKubernetesVersionDropdown().vm.$emit('input', kubernetesVersion);
expect(actions.setKubernetesVersion).toHaveBeenCalledWith( expect(actions.setKubernetesVersion).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), kubernetesVersion,
{ kubernetesVersion }, });
undefined,
);
}); });
it('dispatches setGitlabManagedCluster when gitlab managed cluster input changes', () => { it('dispatches setGitlabManagedCluster when gitlab managed cluster input changes', () => {
...@@ -482,11 +464,9 @@ describe('EksClusterConfigurationForm', () => { ...@@ -482,11 +464,9 @@ describe('EksClusterConfigurationForm', () => {
findGitlabManagedClusterCheckbox().vm.$emit('input', gitlabManagedCluster); findGitlabManagedClusterCheckbox().vm.$emit('input', gitlabManagedCluster);
expect(actions.setGitlabManagedCluster).toHaveBeenCalledWith( expect(actions.setGitlabManagedCluster).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), gitlabManagedCluster,
{ gitlabManagedCluster }, });
undefined,
);
}); });
describe('when vpc is selected', () => { describe('when vpc is selected', () => {
...@@ -499,35 +479,28 @@ describe('EksClusterConfigurationForm', () => { ...@@ -499,35 +479,28 @@ describe('EksClusterConfigurationForm', () => {
}); });
it('dispatches setVpc action', () => { it('dispatches setVpc action', () => {
expect(actions.setVpc).toHaveBeenCalledWith(expect.anything(), { vpc }, undefined); expect(actions.setVpc).toHaveBeenCalledWith(expect.anything(), { vpc });
}); });
it('cleans selected subnet', () => { it('cleans selected subnet', () => {
expect(actions.setSubnet).toHaveBeenCalledWith(expect.anything(), { subnet: [] }, undefined); expect(actions.setSubnet).toHaveBeenCalledWith(expect.anything(), { subnet: [] });
}); });
it('cleans selected security group', () => { it('cleans selected security group', () => {
expect(actions.setSecurityGroup).toHaveBeenCalledWith( expect(actions.setSecurityGroup).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), securityGroup: null,
{ securityGroup: null }, });
undefined,
);
}); });
it('dispatches fetchSubnets action', () => { it('dispatches fetchSubnets action', () => {
expect(subnetsActions.fetchItems).toHaveBeenCalledWith( expect(subnetsActions.fetchItems).toHaveBeenCalledWith(expect.anything(), { vpc, region });
expect.anything(),
{ vpc, region },
undefined,
);
}); });
it('dispatches fetchSecurityGroups action', () => { it('dispatches fetchSecurityGroups action', () => {
expect(securityGroupsActions.fetchItems).toHaveBeenCalledWith( expect(securityGroupsActions.fetchItems).toHaveBeenCalledWith(expect.anything(), {
expect.anything(), vpc,
{ vpc, region }, region,
undefined, });
);
}); });
}); });
...@@ -539,7 +512,7 @@ describe('EksClusterConfigurationForm', () => { ...@@ -539,7 +512,7 @@ describe('EksClusterConfigurationForm', () => {
}); });
it('dispatches setSubnet action', () => { it('dispatches setSubnet action', () => {
expect(actions.setSubnet).toHaveBeenCalledWith(expect.anything(), { subnet }, undefined); expect(actions.setSubnet).toHaveBeenCalledWith(expect.anything(), { subnet });
}); });
}); });
...@@ -551,7 +524,7 @@ describe('EksClusterConfigurationForm', () => { ...@@ -551,7 +524,7 @@ describe('EksClusterConfigurationForm', () => {
}); });
it('dispatches setRole action', () => { it('dispatches setRole action', () => {
expect(actions.setRole).toHaveBeenCalledWith(expect.anything(), { role }, undefined); expect(actions.setRole).toHaveBeenCalledWith(expect.anything(), { role });
}); });
}); });
...@@ -563,7 +536,7 @@ describe('EksClusterConfigurationForm', () => { ...@@ -563,7 +536,7 @@ describe('EksClusterConfigurationForm', () => {
}); });
it('dispatches setKeyPair action', () => { it('dispatches setKeyPair action', () => {
expect(actions.setKeyPair).toHaveBeenCalledWith(expect.anything(), { keyPair }, undefined); expect(actions.setKeyPair).toHaveBeenCalledWith(expect.anything(), { keyPair });
}); });
}); });
...@@ -575,11 +548,7 @@ describe('EksClusterConfigurationForm', () => { ...@@ -575,11 +548,7 @@ describe('EksClusterConfigurationForm', () => {
}); });
it('dispatches setSecurityGroup action', () => { it('dispatches setSecurityGroup action', () => {
expect(actions.setSecurityGroup).toHaveBeenCalledWith( expect(actions.setSecurityGroup).toHaveBeenCalledWith(expect.anything(), { securityGroup });
expect.anything(),
{ securityGroup },
undefined,
);
}); });
}); });
...@@ -591,11 +560,7 @@ describe('EksClusterConfigurationForm', () => { ...@@ -591,11 +560,7 @@ describe('EksClusterConfigurationForm', () => {
}); });
it('dispatches setInstanceType action', () => { it('dispatches setInstanceType action', () => {
expect(actions.setInstanceType).toHaveBeenCalledWith( expect(actions.setInstanceType).toHaveBeenCalledWith(expect.anything(), { instanceType });
expect.anything(),
{ instanceType },
undefined,
);
}); });
}); });
...@@ -604,7 +569,7 @@ describe('EksClusterConfigurationForm', () => { ...@@ -604,7 +569,7 @@ describe('EksClusterConfigurationForm', () => {
findNodeCountInput().vm.$emit('input', nodeCount); findNodeCountInput().vm.$emit('input', nodeCount);
expect(actions.setNodeCount).toHaveBeenCalledWith(expect.anything(), { nodeCount }, undefined); expect(actions.setNodeCount).toHaveBeenCalledWith(expect.anything(), { nodeCount });
}); });
describe('when all cluster configuration fields are set', () => { describe('when all cluster configuration fields are set', () => {
......
...@@ -124,11 +124,7 @@ describe('GkeMachineTypeDropdown', () => { ...@@ -124,11 +124,7 @@ describe('GkeMachineTypeDropdown', () => {
wrapper.find('.dropdown-content button').trigger('click'); wrapper.find('.dropdown-content button').trigger('click');
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(setMachineType).toHaveBeenCalledWith( expect(setMachineType).toHaveBeenCalledWith(expect.anything(), selectedMachineTypeMock);
expect.anything(),
selectedMachineTypeMock,
undefined,
);
}); });
}); });
}); });
......
...@@ -121,23 +121,19 @@ describe('GkeNetworkDropdown', () => { ...@@ -121,23 +121,19 @@ describe('GkeNetworkDropdown', () => {
}); });
it('cleans selected subnetwork', () => { it('cleans selected subnetwork', () => {
expect(setSubnetwork).toHaveBeenCalledWith(expect.anything(), '', undefined); expect(setSubnetwork).toHaveBeenCalledWith(expect.anything(), '');
}); });
it('dispatches the setNetwork action', () => { it('dispatches the setNetwork action', () => {
expect(setNetwork).toHaveBeenCalledWith(expect.anything(), selectedNetwork, undefined); expect(setNetwork).toHaveBeenCalledWith(expect.anything(), selectedNetwork);
}); });
it('fetches subnetworks for the selected project, region, and network', () => { it('fetches subnetworks for the selected project, region, and network', () => {
expect(fetchSubnetworks).toHaveBeenCalledWith( expect(fetchSubnetworks).toHaveBeenCalledWith(expect.anything(), {
expect.anything(),
{
project: projectId, project: projectId,
region, region,
network: selectedNetwork.selfLink, network: selectedNetwork.selfLink,
}, });
undefined,
);
}); });
}); });
}); });
...@@ -130,7 +130,6 @@ describe('GkeProjectIdDropdown', () => { ...@@ -130,7 +130,6 @@ describe('GkeProjectIdDropdown', () => {
expect(setProject).toHaveBeenCalledWith( expect(setProject).toHaveBeenCalledWith(
expect.anything(), expect.anything(),
gapiProjectsResponseMock.projects[0], gapiProjectsResponseMock.projects[0],
undefined,
); );
}); });
}); });
......
...@@ -107,7 +107,7 @@ describe('GkeSubnetworkDropdown', () => { ...@@ -107,7 +107,7 @@ describe('GkeSubnetworkDropdown', () => {
wrapper.find(ClusterFormDropdown).vm.$emit('input', selectedSubnetwork); wrapper.find(ClusterFormDropdown).vm.$emit('input', selectedSubnetwork);
expect(setSubnetwork).toHaveBeenCalledWith(expect.anything(), selectedSubnetwork, undefined); expect(setSubnetwork).toHaveBeenCalledWith(expect.anything(), selectedSubnetwork);
}); });
}); });
}); });
...@@ -177,9 +177,7 @@ describe('DiffContent', () => { ...@@ -177,9 +177,7 @@ describe('DiffContent', () => {
}); });
wrapper.find(NoteForm).vm.$emit('handleFormUpdate', noteStub); wrapper.find(NoteForm).vm.$emit('handleFormUpdate', noteStub);
expect(saveDiffDiscussionMock).toHaveBeenCalledWith( expect(saveDiffDiscussionMock).toHaveBeenCalledWith(expect.any(Object), {
expect.any(Object),
{
note: noteStub, note: noteStub,
formData: { formData: {
noteableData: expect.any(Object), noteableData: expect.any(Object),
...@@ -191,9 +189,7 @@ describe('DiffContent', () => { ...@@ -191,9 +189,7 @@ describe('DiffContent', () => {
height: undefined, height: undefined,
noteableType: undefined, noteableType: undefined,
}, },
}, });
undefined,
);
}); });
}); });
}); });
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { GlIcon } from '@gitlab/ui'; import { GlIcon } from '@gitlab/ui';
import { cloneDeep } from 'lodash';
import DiffFileHeader from '~/diffs/components/diff_file_header.vue'; import DiffFileHeader from '~/diffs/components/diff_file_header.vue';
import EditButton from '~/diffs/components/edit_button.vue'; import EditButton from '~/diffs/components/edit_button.vue';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
...@@ -26,12 +27,16 @@ const diffFile = Object.freeze( ...@@ -26,12 +27,16 @@ const diffFile = Object.freeze(
}), }),
); );
const localVue = createLocalVue();
localVue.use(Vuex);
describe('DiffFileHeader component', () => { describe('DiffFileHeader component', () => {
let wrapper; let wrapper;
let mockStoreConfig;
const diffHasExpandedDiscussionsResultMock = jest.fn(); const diffHasExpandedDiscussionsResultMock = jest.fn();
const diffHasDiscussionsResultMock = jest.fn(); const diffHasDiscussionsResultMock = jest.fn();
const mockStoreConfig = { const defaultMockStoreConfig = {
state: {}, state: {},
modules: { modules: {
diffs: { diffs: {
...@@ -56,6 +61,8 @@ describe('DiffFileHeader component', () => { ...@@ -56,6 +61,8 @@ describe('DiffFileHeader component', () => {
diffHasExpandedDiscussionsResultMock, diffHasExpandedDiscussionsResultMock,
...Object.values(mockStoreConfig.modules.diffs.actions), ...Object.values(mockStoreConfig.modules.diffs.actions),
].forEach(mock => mock.mockReset()); ].forEach(mock => mock.mockReset());
wrapper.destroy();
}); });
const findHeader = () => wrapper.find({ ref: 'header' }); const findHeader = () => wrapper.find({ ref: 'header' });
...@@ -80,8 +87,7 @@ describe('DiffFileHeader component', () => { ...@@ -80,8 +87,7 @@ describe('DiffFileHeader component', () => {
}; };
const createComponent = props => { const createComponent = props => {
const localVue = createLocalVue(); mockStoreConfig = cloneDeep(defaultMockStoreConfig);
localVue.use(Vuex);
const store = new Vuex.Store(mockStoreConfig); const store = new Vuex.Store(mockStoreConfig);
wrapper = shallowMount(DiffFileHeader, { wrapper = shallowMount(DiffFileHeader, {
...@@ -286,7 +292,7 @@ describe('DiffFileHeader component', () => { ...@@ -286,7 +292,7 @@ describe('DiffFileHeader component', () => {
findToggleDiscussionsButton().vm.$emit('click'); findToggleDiscussionsButton().vm.$emit('click');
expect( expect(
mockStoreConfig.modules.diffs.actions.toggleFileDiscussionWrappers, mockStoreConfig.modules.diffs.actions.toggleFileDiscussionWrappers,
).toHaveBeenCalledWith(expect.any(Object), diffFile, undefined); ).toHaveBeenCalledWith(expect.any(Object), diffFile);
}); });
}); });
......
...@@ -50,7 +50,7 @@ describe('Diff settings dropdown component', () => { ...@@ -50,7 +50,7 @@ describe('Diff settings dropdown component', () => {
vm.find('.js-list-view').trigger('click'); vm.find('.js-list-view').trigger('click');
expect(actions.setRenderTreeList).toHaveBeenCalledWith(expect.anything(), false, undefined); expect(actions.setRenderTreeList).toHaveBeenCalledWith(expect.anything(), false);
}); });
it('tree view button dispatches setRenderTreeList with true', () => { it('tree view button dispatches setRenderTreeList with true', () => {
...@@ -58,7 +58,7 @@ describe('Diff settings dropdown component', () => { ...@@ -58,7 +58,7 @@ describe('Diff settings dropdown component', () => {
vm.find('.js-tree-view').trigger('click'); vm.find('.js-tree-view').trigger('click');
expect(actions.setRenderTreeList).toHaveBeenCalledWith(expect.anything(), true, undefined); expect(actions.setRenderTreeList).toHaveBeenCalledWith(expect.anything(), true);
}); });
it('sets list button as selected when renderTreeList is false', () => { it('sets list button as selected when renderTreeList is false', () => {
...@@ -153,14 +153,10 @@ describe('Diff settings dropdown component', () => { ...@@ -153,14 +153,10 @@ describe('Diff settings dropdown component', () => {
checkbox.element.checked = true; checkbox.element.checked = true;
checkbox.trigger('change'); checkbox.trigger('change');
expect(actions.setShowWhitespace).toHaveBeenCalledWith( expect(actions.setShowWhitespace).toHaveBeenCalledWith(expect.anything(), {
expect.anything(),
{
showWhitespace: true, showWhitespace: true,
pushState: true, pushState: true,
}, });
undefined,
);
}); });
}); });
}); });
...@@ -259,23 +259,15 @@ describe('ErrorTrackingList', () => { ...@@ -259,23 +259,15 @@ describe('ErrorTrackingList', () => {
errorId: errorsList[0].id, errorId: errorsList[0].id,
status: 'ignored', status: 'ignored',
}); });
expect(actions.updateStatus).toHaveBeenCalledWith( expect(actions.updateStatus).toHaveBeenCalledWith(expect.anything(), {
expect.anything(),
{
endpoint: `/project/test/-/error_tracking/${errorsList[0].id}.json`, endpoint: `/project/test/-/error_tracking/${errorsList[0].id}.json`,
status: 'ignored', status: 'ignored',
}, });
undefined,
);
}); });
it('calls an action to remove the item from the list', () => { it('calls an action to remove the item from the list', () => {
findErrorActions().vm.$emit('update-issue-status', { errorId: '1', status: undefined }); findErrorActions().vm.$emit('update-issue-status', { errorId: '1', status: undefined });
expect(actions.removeIgnoredResolvedErrors).toHaveBeenCalledWith( expect(actions.removeIgnoredResolvedErrors).toHaveBeenCalledWith(expect.anything(), '1');
expect.anything(),
'1',
undefined,
);
}); });
}); });
...@@ -298,23 +290,15 @@ describe('ErrorTrackingList', () => { ...@@ -298,23 +290,15 @@ describe('ErrorTrackingList', () => {
errorId: errorsList[0].id, errorId: errorsList[0].id,
status: 'resolved', status: 'resolved',
}); });
expect(actions.updateStatus).toHaveBeenCalledWith( expect(actions.updateStatus).toHaveBeenCalledWith(expect.anything(), {
expect.anything(),
{
endpoint: `/project/test/-/error_tracking/${errorsList[0].id}.json`, endpoint: `/project/test/-/error_tracking/${errorsList[0].id}.json`,
status: 'resolved', status: 'resolved',
}, });
undefined,
);
}); });
it('calls an action to remove the item from the list', () => { it('calls an action to remove the item from the list', () => {
findErrorActions().vm.$emit('update-issue-status', { errorId: '1', status: undefined }); findErrorActions().vm.$emit('update-issue-status', { errorId: '1', status: undefined });
expect(actions.removeIgnoredResolvedErrors).toHaveBeenCalledWith( expect(actions.removeIgnoredResolvedErrors).toHaveBeenCalledWith(expect.anything(), '1');
expect.anything(),
'1',
undefined,
);
}); });
}); });
...@@ -443,7 +427,6 @@ describe('ErrorTrackingList', () => { ...@@ -443,7 +427,6 @@ describe('ErrorTrackingList', () => {
expect(actions.fetchPaginatedResults).toHaveBeenLastCalledWith( expect(actions.fetchPaginatedResults).toHaveBeenLastCalledWith(
expect.anything(), expect.anything(),
'previousCursor', 'previousCursor',
undefined,
); );
}); });
}); });
...@@ -462,7 +445,6 @@ describe('ErrorTrackingList', () => { ...@@ -462,7 +445,6 @@ describe('ErrorTrackingList', () => {
expect(actions.fetchPaginatedResults).toHaveBeenLastCalledWith( expect(actions.fetchPaginatedResults).toHaveBeenLastCalledWith(
expect.anything(), expect.anything(),
'nextCursor', 'nextCursor',
undefined,
); );
}); });
}); });
......
...@@ -51,7 +51,7 @@ describe('IDE error message component', () => { ...@@ -51,7 +51,7 @@ describe('IDE error message component', () => {
createComponent(); createComponent();
findDismissButton().trigger('click'); findDismissButton().trigger('click');
expect(setErrorMessageMock).toHaveBeenCalledWith(expect.any(Object), null, undefined); expect(setErrorMessageMock).toHaveBeenCalledWith(expect.any(Object), null);
}); });
describe('with action', () => { describe('with action', () => {
......
...@@ -99,11 +99,7 @@ describe('IDE stages list', () => { ...@@ -99,11 +99,7 @@ describe('IDE stages list', () => {
it('calls toggleStageCollapsed when clicking stage header', () => { it('calls toggleStageCollapsed when clicking stage header', () => {
findCardHeader().trigger('click'); findCardHeader().trigger('click');
expect(storeActions.toggleStageCollapsed).toHaveBeenCalledWith( expect(storeActions.toggleStageCollapsed).toHaveBeenCalledWith(expect.any(Object), 0);
expect.any(Object),
0,
undefined,
);
}); });
it('calls fetchJobs when stage is mounted', () => { it('calls fetchJobs when stage is mounted', () => {
......
...@@ -56,14 +56,10 @@ describe('IDE merge requests list', () => { ...@@ -56,14 +56,10 @@ describe('IDE merge requests list', () => {
it('calls fetch on mounted', () => { it('calls fetch on mounted', () => {
createComponent(); createComponent();
expect(fetchMergeRequestsMock).toHaveBeenCalledWith( expect(fetchMergeRequestsMock).toHaveBeenCalledWith(expect.any(Object), {
expect.any(Object),
{
search: '', search: '',
type: '', type: '',
}, });
undefined,
);
}); });
it('renders loading icon when merge request is loading', () => { it('renders loading icon when merge request is loading', () => {
...@@ -95,14 +91,10 @@ describe('IDE merge requests list', () => { ...@@ -95,14 +91,10 @@ describe('IDE merge requests list', () => {
const searchType = wrapper.vm.$options.searchTypes[0]; const searchType = wrapper.vm.$options.searchTypes[0];
expect(findTokenedInput().props('tokens')).toEqual([searchType]); expect(findTokenedInput().props('tokens')).toEqual([searchType]);
expect(fetchMergeRequestsMock).toHaveBeenCalledWith( expect(fetchMergeRequestsMock).toHaveBeenCalledWith(expect.any(Object), {
expect.any(Object),
{
type: searchType.type, type: searchType.type,
search: '', search: '',
}, });
undefined,
);
}); });
}); });
...@@ -136,14 +128,10 @@ describe('IDE merge requests list', () => { ...@@ -136,14 +128,10 @@ describe('IDE merge requests list', () => {
input.vm.$emit('input', 'something'); input.vm.$emit('input', 'something');
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(fetchMergeRequestsMock).toHaveBeenCalledWith( expect(fetchMergeRequestsMock).toHaveBeenCalledWith(expect.any(Object), {
expect.any(Object),
{
search: 'something', search: 'something',
type: '', type: '',
}, });
undefined,
);
}); });
}); });
}); });
......
...@@ -279,24 +279,16 @@ describe('IDE clientside preview', () => { ...@@ -279,24 +279,16 @@ describe('IDE clientside preview', () => {
}); });
it('calls getFileData', () => { it('calls getFileData', () => {
expect(storeActions.getFileData).toHaveBeenCalledWith( expect(storeActions.getFileData).toHaveBeenCalledWith(expect.any(Object), {
expect.any(Object),
{
path: 'package.json', path: 'package.json',
makeFileActive: false, makeFileActive: false,
}, });
undefined, // vuex callback
);
}); });
it('calls getRawFileData', () => { it('calls getRawFileData', () => {
expect(storeActions.getRawFileData).toHaveBeenCalledWith( expect(storeActions.getRawFileData).toHaveBeenCalledWith(expect.any(Object), {
expect.any(Object),
{
path: 'package.json', path: 'package.json',
}, });
undefined, // vuex callback
);
}); });
}); });
......
...@@ -194,13 +194,9 @@ describe('Discussion navigation mixin', () => { ...@@ -194,13 +194,9 @@ describe('Discussion navigation mixin', () => {
}); });
it('expands discussion', () => { it('expands discussion', () => {
expect(expandDiscussion).toHaveBeenCalledWith( expect(expandDiscussion).toHaveBeenCalledWith(expect.anything(), {
expect.anything(),
{
discussionId: expected, discussionId: expected,
}, });
undefined,
);
}); });
it('scrolls to discussion', () => { it('scrolls to discussion', () => {
......
...@@ -133,11 +133,7 @@ describe('Author Select', () => { ...@@ -133,11 +133,7 @@ describe('Author Select', () => {
const authorName = 'lorem'; const authorName = 'lorem';
findSearchBox().vm.$emit('input', authorName); findSearchBox().vm.$emit('input', authorName);
expect(store.actions.fetchAuthors).toHaveBeenCalledWith( expect(store.actions.fetchAuthors).toHaveBeenCalledWith(expect.anything(), authorName);
expect.anything(),
authorName,
undefined,
);
}); });
}); });
......
...@@ -115,14 +115,10 @@ describe('Release edit component', () => { ...@@ -115,14 +115,10 @@ describe('Release edit component', () => {
const expectStoreMethodToBeCalled = () => { const expectStoreMethodToBeCalled = () => {
expect(actions.updateAssetLinkUrl).toHaveBeenCalledTimes(1); expect(actions.updateAssetLinkUrl).toHaveBeenCalledTimes(1);
expect(actions.updateAssetLinkUrl).toHaveBeenCalledWith( expect(actions.updateAssetLinkUrl).toHaveBeenCalledWith(expect.anything(), {
expect.anything(),
{
linkIdToUpdate, linkIdToUpdate,
newUrl, newUrl,
}, });
undefined,
);
}; };
it('calls the "updateAssetLinkUrl" store method when text is entered into the "URL" input field', () => { it('calls the "updateAssetLinkUrl" store method when text is entered into the "URL" input field', () => {
...@@ -177,14 +173,10 @@ describe('Release edit component', () => { ...@@ -177,14 +173,10 @@ describe('Release edit component', () => {
const expectStoreMethodToBeCalled = () => { const expectStoreMethodToBeCalled = () => {
expect(actions.updateAssetLinkName).toHaveBeenCalledTimes(1); expect(actions.updateAssetLinkName).toHaveBeenCalledTimes(1);
expect(actions.updateAssetLinkName).toHaveBeenCalledWith( expect(actions.updateAssetLinkName).toHaveBeenCalledWith(expect.anything(), {
expect.anything(),
{
linkIdToUpdate, linkIdToUpdate,
newName, newName,
}, });
undefined,
);
}; };
it('calls the "updateAssetLinkName" store method when text is entered into the "Link title" input field', () => { it('calls the "updateAssetLinkName" store method when text is entered into the "Link title" input field', () => {
...@@ -225,14 +217,10 @@ describe('Release edit component', () => { ...@@ -225,14 +217,10 @@ describe('Release edit component', () => {
wrapper.find({ ref: 'typeSelect' }).vm.$emit('change', newType); wrapper.find({ ref: 'typeSelect' }).vm.$emit('change', newType);
expect(actions.updateAssetLinkType).toHaveBeenCalledTimes(1); expect(actions.updateAssetLinkType).toHaveBeenCalledTimes(1);
expect(actions.updateAssetLinkType).toHaveBeenCalledWith( expect(actions.updateAssetLinkType).toHaveBeenCalledWith(expect.anything(), {
expect.anything(),
{
linkIdToUpdate, linkIdToUpdate,
newType, newType,
}, });
undefined,
);
}); });
it('selects the default asset type if no type was provided by the backend', () => { it('selects the default asset type if no type was provided by the backend', () => {
......
...@@ -12340,10 +12340,10 @@ vuedraggable@^2.23.0: ...@@ -12340,10 +12340,10 @@ vuedraggable@^2.23.0:
dependencies: dependencies:
sortablejs "^1.9.0" sortablejs "^1.9.0"
vuex@^3.1.0: vuex@^3.5.1:
version "3.1.0" version "3.5.1"
resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.1.0.tgz#634b81515cf0cfe976bd1ffe9601755e51f843b9" resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.5.1.tgz#f1b8dcea649bc25254cf4f4358081dbf5da18b3d"
integrity sha512-mdHeHT/7u4BncpUZMlxNaIdcN/HIt1GsGG5LKByArvYG/v6DvHcOxvDCts+7SRdCoIRGllK8IMZvQtQXLppDYg== integrity sha512-w7oJzmHQs0FM9LXodfskhw9wgKBiaB+totOdb8sNzbTB2KDCEEwEs29NzBZFh/lmEK1t5tDmM1vtsO7ubG1DFw==
w3c-hr-time@^1.0.1, w3c-hr-time@^1.0.2: w3c-hr-time@^1.0.1, w3c-hr-time@^1.0.2:
version "1.0.2" version "1.0.2"
......
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