Named argument in setupSuccess

parent f0d7f7e8
...@@ -73,7 +73,7 @@ describe('OnDemandScansForm', () => { ...@@ -73,7 +73,7 @@ describe('OnDemandScansForm', () => {
findSiteProfilesSelector().vm.$emit('input', nonValidatedSiteProfile.id); findSiteProfilesSelector().vm.$emit('input', nonValidatedSiteProfile.id);
return subject.vm.$nextTick(); return subject.vm.$nextTick();
}; };
const setupSuccess = (edit = false) => { const setupSuccess = ({ edit = false } = {}) => {
jest.spyOn(subject.vm.$apollo, 'mutate').mockResolvedValue({ jest.spyOn(subject.vm.$apollo, 'mutate').mockResolvedValue({
data: { data: {
[edit ? 'dastScanUpdate' : 'dastScanCreate']: { [edit ? 'dastScanUpdate' : 'dastScanCreate']: {
...@@ -294,7 +294,7 @@ describe('OnDemandScansForm', () => { ...@@ -294,7 +294,7 @@ describe('OnDemandScansForm', () => {
dastScan, dastScan,
}, },
}); });
await setupSuccess(true); await setupSuccess({ edit: true });
actionFunction(); actionFunction();
}); });
......
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