Commit 3b1593f2 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 29 files - 52 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 39bb37cc
......@@ -1531,37 +1531,6 @@ ee/spec/frontend/roadmap/components/epic_item_timeline_spec.js
ee/spec/frontend/roadmap/components/epics_list_empty_spec.js
ee/spec/frontend/roadmap/components/milestones_list_section_spec.js
## interesting-galileo
ee/spec/frontend/vue_shared/license_compliance/license_management_spec.js
ee/spec/frontend/vue_shared/license_compliance/mock_data.js
ee/spec/frontend/vue_shared/license_compliance/mr_widget_license_report_spec.js
ee/spec/frontend/vue_shared/license_compliance/store/actions_spec.js
ee/spec/frontend/vue_shared/license_compliance/store/getters_spec.js
ee/spec/frontend/vue_shared/security_reports/components/dast_modal_spec.js
ee/spec/frontend/vue_shared/security_reports/components/dismiss_button_spec.js
ee/spec/frontend/vue_shared/security_reports/components/modal_footer_spec.js
ee/spec/frontend/vue_shared/security_reports/components/modal_spec.js
ee/spec/frontend/vue_shared/security_reports/components/security_issue_body_spec.js
ee/spec/frontend/vue_shared/security_reports/components/split_button_spec.js
ee/spec/frontend/vue_shared/security_reports/components/vulnerability_details_spec.js
ee/spec/frontend/vue_shared/security_reports/grouped_security_reports_app_spec.js
ee/spec/frontend/vue_shared/security_reports/store/actions_spec.js
ee/spec/frontend/vue_shared/security_reports/store/getters_spec.js
ee/spec/frontend/vue_shared/security_reports/store/mediator_spec.js
ee/spec/frontend/vue_shared/security_reports/store/modules/api_fuzzing/actions_spec.js
ee/spec/frontend/vue_shared/security_reports/store/modules/sast/actions_spec.js
ee/spec/frontend/vue_shared/security_reports/store/modules/secret_detection/actions_spec.js
ee/spec/frontend/vulnerabilities/details_spec.js
ee/spec/frontend/vulnerabilities/header_spec.js
ee/spec/frontend/vulnerabilities/helpers_spec.js
ee/spec/frontend/vulnerabilities/history_comment_editor_spec.js
ee/spec/frontend/vulnerabilities/history_comment_spec.js
ee/spec/frontend/vulnerabilities/history_entry_spec.js
ee/spec/frontend/vulnerabilities/issue_link_spec.js
ee/spec/frontend/vulnerabilities/related_issues_spec.js
ee/spec/frontend/vulnerabilities/status_description_spec.js
ee/spec/frontend/vulnerabilities/vulnerability_state_dropdown_spec.js
## relaxed-goldwasser
spec/frontend/__mocks__/@gitlab/ui.js
spec/frontend/__mocks__/lodash/debounce.js
......
......@@ -178,7 +178,7 @@ describe('License Management', () => {
describe.each([true, false])(
'when licenseComplianceDeniesMr feature flag is %p',
licenseComplianceDeniesMr => {
(licenseComplianceDeniesMr) => {
it('should not show the developer only tooltip', () => {
createComponent({
state: { isLoadingManagedLicenses: false },
......
......@@ -62,7 +62,7 @@ export const generateReportGroup = ({ status = 'some-status', numberOfLicenses =
status,
name: `${status} group-name`,
description: `${status} group-description`,
licenses: range(numberOfLicenses).map(i => ({
licenses: range(numberOfLicenses).map((i) => ({
name: `${status} license-name-${i}`,
status,
})),
......
......@@ -225,7 +225,7 @@ describe('License Report MR Widget', () => {
`(
'given reports for: $givenStatuses it has $expectedNumberOfReportHeadings report headings',
({ givenStatuses, expectedNumberOfReportHeadings }) => {
const mockReportGroups = givenStatuses.map(status => generateReportGroup({ status }));
const mockReportGroups = givenStatuses.map((status) => generateReportGroup({ status }));
mountComponent({
getters: {
......@@ -245,7 +245,7 @@ describe('License Report MR Widget', () => {
it.each([0, 1, 2])(
'should include %d report items when section has that many licenses',
numberOfLicenses => {
(numberOfLicenses) => {
const mockReportGroups = [
generateReportGroup({
numberOfLicenses,
......
......@@ -46,7 +46,7 @@ describe('License store actions', () => {
});
describe('setAPISettings', () => {
it('commits SET_API_SETTINGS', done => {
it('commits SET_API_SETTINGS', (done) => {
const payload = { apiUrlManageLicenses };
testAction(
actions.setAPISettings,
......@@ -61,7 +61,7 @@ describe('License store actions', () => {
});
describe('setKnownLicenses', () => {
it('commits SET_KNOWN_LICENSES', done => {
it('commits SET_KNOWN_LICENSES', (done) => {
const payload = [{ name: 'BSD' }, { name: 'Apache' }];
testAction(
actions.setKnownLicenses,
......@@ -76,7 +76,7 @@ describe('License store actions', () => {
});
describe('setLicenseInModal', () => {
it('commits SET_LICENSE_IN_MODAL with license', done => {
it('commits SET_LICENSE_IN_MODAL with license', (done) => {
testAction(
actions.setLicenseInModal,
approvedLicense,
......@@ -90,7 +90,7 @@ describe('License store actions', () => {
});
describe('setIsAdmin', () => {
it('commits SET_IS_ADMIN', done => {
it('commits SET_IS_ADMIN', (done) => {
testAction(
actions.setIsAdmin,
false,
......@@ -104,7 +104,7 @@ describe('License store actions', () => {
});
describe('resetLicenseInModal', () => {
it('commits RESET_LICENSE_IN_MODAL', done => {
it('commits RESET_LICENSE_IN_MODAL', (done) => {
testAction(
actions.resetLicenseInModal,
null,
......@@ -118,7 +118,7 @@ describe('License store actions', () => {
});
describe('requestDeleteLicense', () => {
it('commits REQUEST_DELETE_LICENSE', done => {
it('commits REQUEST_DELETE_LICENSE', (done) => {
testAction(
actions.requestDeleteLicense,
null,
......@@ -142,7 +142,7 @@ describe('License store actions', () => {
});
describe('receiveDeleteLicenseError', () => {
it('commits RECEIVE_DELETE_LICENSE_ERROR', done => {
it('commits RECEIVE_DELETE_LICENSE_ERROR', (done) => {
const error = new Error('Test');
testAction(
actions.receiveDeleteLicenseError,
......@@ -166,7 +166,7 @@ describe('License store actions', () => {
});
it('dispatches requestDeleteLicense, addPendingLicense and receiveDeleteLicense for successful response', () => {
endpointMock.replyOnce(req => {
endpointMock.replyOnce((req) => {
expect(req.url).toBe(deleteUrl);
return [200, ''];
});
......@@ -179,7 +179,7 @@ describe('License store actions', () => {
});
it('dispatches requestDeleteLicense, addPendingLicense, receiveDeleteLicenseError and removePendingLicense for error response', () => {
endpointMock.replyOnce(req => {
endpointMock.replyOnce((req) => {
expect(req.url).toBe(deleteUrl);
return [500, ''];
});
......@@ -194,7 +194,7 @@ describe('License store actions', () => {
});
describe('requestSetLicenseApproval', () => {
it('commits REQUEST_SET_LICENSE_APPROVAL', done => {
it('commits REQUEST_SET_LICENSE_APPROVAL', (done) => {
testAction(
actions.requestSetLicenseApproval,
null,
......@@ -209,7 +209,7 @@ describe('License store actions', () => {
describe('receiveSetLicenseApproval', () => {
describe('given the licensesApiPath is provided', () => {
it('commits RECEIVE_SET_LICENSE_APPROVAL and dispatches fetchParsedLicenseReport', done => {
it('commits RECEIVE_SET_LICENSE_APPROVAL and dispatches fetchParsedLicenseReport', (done) => {
testAction(
actions.receiveSetLicenseApproval,
null,
......@@ -234,7 +234,7 @@ describe('License store actions', () => {
});
describe('receiveSetLicenseApprovalError', () => {
it('commits RECEIVE_SET_LICENSE_APPROVAL_ERROR', done => {
it('commits RECEIVE_SET_LICENSE_APPROVAL_ERROR', (done) => {
const error = new Error('Test');
testAction(
actions.receiveSetLicenseApprovalError,
......@@ -261,7 +261,7 @@ describe('License store actions', () => {
});
it('dispatches requestSetLicenseApproval, addPendingLicense and receiveSetLicenseApproval for successful response', () => {
putEndpointMock.replyOnce(req => {
putEndpointMock.replyOnce((req) => {
const { approval_status, name } = JSON.parse(req.data);
expect(req.url).toBe(apiUrlManageLicenses);
......@@ -278,7 +278,7 @@ describe('License store actions', () => {
});
it('dispatches requestSetLicenseApproval, addPendingLicense, receiveSetLicenseApprovalError and removePendingLicense for error response', () => {
putEndpointMock.replyOnce(req => {
putEndpointMock.replyOnce((req) => {
expect(req.url).toBe(apiUrlManageLicenses);
return [500, ''];
});
......@@ -302,7 +302,7 @@ describe('License store actions', () => {
});
it('dispatches requestSetLicenseApproval, addPendingLicense and receiveSetLicenseApproval for successful response', () => {
patchEndpointMock.replyOnce(req => {
patchEndpointMock.replyOnce((req) => {
expect(req.url).toBe(licenseUrl);
const { approval_status, name } = JSON.parse(req.data);
......@@ -321,7 +321,7 @@ describe('License store actions', () => {
});
it('dispatches requestSetLicenseApproval, addPendingLicense, receiveSetLicenseApprovalError and removePendingLicense for error response', () => {
patchEndpointMock.replyOnce(req => {
patchEndpointMock.replyOnce((req) => {
expect(req.url).toBe(licenseUrl);
return [500, ''];
});
......@@ -341,7 +341,7 @@ describe('License store actions', () => {
describe('allowLicense', () => {
const newStatus = LICENSE_APPROVAL_STATUS.ALLOWED;
it('dispatches setLicenseApproval for un-approved licenses', done => {
it('dispatches setLicenseApproval for un-approved licenses', (done) => {
const license = { name: 'FOO' };
testAction(
......@@ -355,7 +355,7 @@ describe('License store actions', () => {
.catch(done.fail);
});
it('dispatches setLicenseApproval for blacklisted licenses', done => {
it('dispatches setLicenseApproval for blacklisted licenses', (done) => {
const license = blacklistedLicense;
testAction(
......@@ -369,7 +369,7 @@ describe('License store actions', () => {
.catch(done.fail);
});
it('does not dispatch setLicenseApproval for approved licenses', done => {
it('does not dispatch setLicenseApproval for approved licenses', (done) => {
testAction(actions.allowLicense, approvedLicense, state, [], []).then(done).catch(done.fail);
});
});
......@@ -377,7 +377,7 @@ describe('License store actions', () => {
describe('denyLicense', () => {
const newStatus = LICENSE_APPROVAL_STATUS.DENIED;
it('dispatches setLicenseApproval for un-approved licenses', done => {
it('dispatches setLicenseApproval for un-approved licenses', (done) => {
const license = { name: 'FOO' };
testAction(
......@@ -391,7 +391,7 @@ describe('License store actions', () => {
.catch(done.fail);
});
it('dispatches setLicenseApproval for approved licenses', done => {
it('dispatches setLicenseApproval for approved licenses', (done) => {
const license = approvedLicense;
testAction(
......@@ -405,7 +405,7 @@ describe('License store actions', () => {
.catch(done.fail);
});
it('does not dispatch setLicenseApproval for blacklisted licenses', done => {
it('does not dispatch setLicenseApproval for blacklisted licenses', (done) => {
testAction(actions.denyLicense, blacklistedLicense, state, [], [])
.then(done)
.catch(done.fail);
......@@ -413,7 +413,7 @@ describe('License store actions', () => {
});
describe('requestManagedLicenses', () => {
it('commits REQUEST_MANAGED_LICENSES', done => {
it('commits REQUEST_MANAGED_LICENSES', (done) => {
testAction(
actions.requestManagedLicenses,
null,
......@@ -427,7 +427,7 @@ describe('License store actions', () => {
});
describe('receiveManagedLicensesSuccess', () => {
it('commits RECEIVE_MANAGED_LICENSES_SUCCESS', done => {
it('commits RECEIVE_MANAGED_LICENSES_SUCCESS', (done) => {
const payload = [approvedLicense];
testAction(
actions.receiveManagedLicensesSuccess,
......@@ -442,7 +442,7 @@ describe('License store actions', () => {
});
describe('receiveManagedLicensesError', () => {
it('commits RECEIVE_MANAGED_LICENSES_ERROR', done => {
it('commits RECEIVE_MANAGED_LICENSES_ERROR', (done) => {
const error = new Error('Test');
testAction(
actions.receiveManagedLicensesError,
......@@ -463,7 +463,7 @@ describe('License store actions', () => {
endpointMock = axiosMock.onGet(apiUrlManageLicenses, { params: { per_page: 100 } });
});
it('dispatches requestManagedLicenses and receiveManagedLicensesSuccess for successful response', done => {
it('dispatches requestManagedLicenses and receiveManagedLicensesSuccess for successful response', (done) => {
const payload = [{ name: 'foo', approval_status: LICENSE_APPROVAL_STATUS.DENIED }];
endpointMock.replyOnce(() => [200, payload]);
......@@ -478,7 +478,7 @@ describe('License store actions', () => {
.catch(done.fail);
});
it('dispatches requestManagedLicenses and receiveManagedLicensesError for error response', done => {
it('dispatches requestManagedLicenses and receiveManagedLicensesError for error response', (done) => {
endpointMock.replyOnce(() => [500, '']);
testAction(
......@@ -497,7 +497,7 @@ describe('License store actions', () => {
});
describe('fetchLicenseCheckApprovalRule ', () => {
it('dispatches request/receive with detected approval rule', done => {
it('dispatches request/receive with detected approval rule', (done) => {
const APPROVAL_RULE_RESPONSE = {
approval_rules_left: [{ name: LICENSE_CHECK_NAME }],
};
......@@ -520,7 +520,7 @@ describe('License store actions', () => {
);
});
it('dispatches request/receive without detected approval rule', done => {
it('dispatches request/receive without detected approval rule', (done) => {
const APPROVAL_RULE_RESPONSE = {
approval_rules_left: [{ name: 'Another Approval Rule' }],
};
......@@ -543,7 +543,7 @@ describe('License store actions', () => {
);
});
it('dispatches request/receive error when no approvalsAPiPath is provided', done => {
it('dispatches request/receive error when no approvalsAPiPath is provided', (done) => {
const error = new Error('approvalsApiPath not provided');
axiosMock.onGet(approvalsApiPath).replyOnce(500);
......@@ -560,7 +560,7 @@ describe('License store actions', () => {
);
});
it('dispatches request/receive on error', done => {
it('dispatches request/receive on error', (done) => {
const error = new Error('Request failed with status code 500');
axiosMock.onGet(approvalsApiPath).replyOnce(500);
......@@ -579,7 +579,7 @@ describe('License store actions', () => {
});
describe('requestLicenseCheckApprovalRule', () => {
it('commits REQUEST_LICENSE_CHECK_APPROVAL_RULE', done => {
it('commits REQUEST_LICENSE_CHECK_APPROVAL_RULE', (done) => {
testAction(
actions.requestLicenseCheckApprovalRule,
null,
......@@ -593,7 +593,7 @@ describe('License store actions', () => {
});
describe('receiveLicenseCheckApprovalRuleSuccess', () => {
it('commits REQUEST_LICENSE_CHECK_APPROVAL_RULE', done => {
it('commits REQUEST_LICENSE_CHECK_APPROVAL_RULE', (done) => {
const hasLicenseCheckApprovalRule = true;
testAction(
......@@ -614,7 +614,7 @@ describe('License store actions', () => {
});
describe('receiveLicenseCheckApprovalRuleError', () => {
it('commits RECEIVE_LICENSE_CHECK_APPROVAL_RULE_ERROR', done => {
it('commits RECEIVE_LICENSE_CHECK_APPROVAL_RULE_ERROR', (done) => {
const error = new Error('Error');
testAction(
......@@ -630,7 +630,7 @@ describe('License store actions', () => {
});
describe('requestParsedLicenseReport', () => {
it(`should commit ${mutationTypes.REQUEST_PARSED_LICENSE_REPORT}`, done => {
it(`should commit ${mutationTypes.REQUEST_PARSED_LICENSE_REPORT}`, (done) => {
testAction(
actions.requestParsedLicenseReport,
null,
......@@ -644,7 +644,7 @@ describe('License store actions', () => {
});
describe('receiveParsedLicenseReportSuccess', () => {
it(`should commit ${mutationTypes.RECEIVE_PARSED_LICENSE_REPORT_SUCCESS} with the correct payload`, done => {
it(`should commit ${mutationTypes.RECEIVE_PARSED_LICENSE_REPORT_SUCCESS} with the correct payload`, (done) => {
const payload = { newLicenses: [{ name: 'foo' }] };
testAction(
......@@ -660,7 +660,7 @@ describe('License store actions', () => {
});
describe('receiveParsedLicenseReportError', () => {
it(`should commit ${mutationTypes.RECEIVE_PARSED_LICENSE_REPORT_ERROR}`, done => {
it(`should commit ${mutationTypes.RECEIVE_PARSED_LICENSE_REPORT_ERROR}`, (done) => {
const payload = new Error('Test');
testAction(
......@@ -700,7 +700,7 @@ describe('License store actions', () => {
];
});
it('should fetch, parse, and dispatch the new licenses on a successful request', done => {
it('should fetch, parse, and dispatch the new licenses on a successful request', (done) => {
licensesApiMock.replyOnce(() => [200, rawLicenseReport]);
const parsedLicenses = {
......@@ -730,7 +730,7 @@ describe('License store actions', () => {
.catch(done.fail);
});
it('should send an error on an unsuccesful request', done => {
it('should send an error on an unsuccesful request', (done) => {
licensesApiMock.replyOnce(400);
testAction(
......@@ -780,7 +780,7 @@ describe('License store actions', () => {
};
});
it('should fetch, parse, and dispatch the new licenses on a successful request', done => {
it('should fetch, parse, and dispatch the new licenses on a successful request', (done) => {
licensesApiMock.replyOnce(() => [200, rawLicenseReport]);
const parsedLicenses = {
......
......@@ -33,7 +33,7 @@ describe('getters', () => {
state = createState();
});
it.each([5, null])('returns true if given license is being updated', licenseId => {
it.each([5, null])('returns true if given license is being updated', (licenseId) => {
state.pendingLicenses = [licenseId];
expect(getters.isLicenseBeingUpdated(state)(licenseId)).toBe(true);
......@@ -60,7 +60,7 @@ describe('getters', () => {
});
describe('isAddingNewLicense', () => {
it.each([true, false])('calls isLicenseBeingUpdated internally', returnValue => {
it.each([true, false])('calls isLicenseBeingUpdated internally', (returnValue) => {
const isLicenseBeingUpdatedMock = jest.fn().mockImplementation(() => returnValue);
expect(
getters.isAddingNewLicense({}, { isLicenseBeingUpdated: isLicenseBeingUpdatedMock }),
......@@ -131,7 +131,7 @@ describe('getters', () => {
it.each(['failed', 'neutral', 'success'])(
`it filters report-groups that don't have the given status: %s`,
status => {
(status) => {
const newLicenses = [{ status }];
expect(getters.licenseReportGroups({ newLicenses })).toEqual([
......
......@@ -13,7 +13,7 @@ describe('DAST Modal', () => {
const findDownloadLink = () => wrapper.find('[data-testid="download-link"]');
const createWrapper = propsData => {
const createWrapper = (propsData) => {
wrapper = shallowMount(Component, {
propsData: {
...defaultProps,
......
......@@ -5,7 +5,7 @@ import component from 'ee/vue_shared/security_reports/components/dismiss_button.
describe('DismissalButton', () => {
let wrapper;
const mountComponent = options => {
const mountComponent = (options) => {
wrapper = mount(component, options);
};
......
......@@ -7,7 +7,7 @@ import createState from 'ee/vue_shared/security_reports/store/state';
describe('Security Reports modal footer', () => {
let wrapper;
const mountComponent = propsData => {
const mountComponent = (propsData) => {
wrapper = mount(component, {
propsData: {
isCreatingIssue: false,
......
......@@ -101,7 +101,7 @@ describe('Security Reports modal', () => {
});
describe('with merge request created', () => {
it('renders the issue button as a single button', done => {
it('renders the issue button as a single button', (done) => {
const propsData = {
modal: createState().modal,
canCreateIssue: true,
......
......@@ -22,7 +22,7 @@ describe('Security Issue Body', () => {
const findReportLink = () => wrapper.find(ReportLink);
const createComponent = issue => {
const createComponent = (issue) => {
wrapper = shallowMount(SecurityIssueBody, {
propsData: {
issue,
......
......@@ -23,7 +23,7 @@ describe('Split Button', () => {
const findDropdown = () => wrapper.find(GlDropdown);
const findDropdownItems = () => wrapper.findAll(GlDropdownItem);
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(SplitButton, {
propsData: {
...props,
......
......@@ -16,7 +16,7 @@ function makeVulnerability(changes = {}) {
describe('VulnerabilityDetails component', () => {
let wrapper;
const componentFactory = vulnerability => {
const componentFactory = (vulnerability) => {
wrapper = mount(VulnerabilityDetails, {
propsData: { vulnerability },
});
......@@ -31,7 +31,7 @@ describe('VulnerabilityDetails component', () => {
}
};
const findLink = name => wrapper.find({ ref: `${name}Link` });
const findLink = (name) => wrapper.find({ ref: `${name}Link` });
const findRequest = () => wrapper.find({ ref: 'request' });
const findRecordedResponse = () => wrapper.find({ ref: 'recordedResponse' });
const findUnmodifiedResponse = () => wrapper.find({ ref: 'unmodifiedResponse' });
......@@ -343,7 +343,7 @@ describe('VulnerabilityDetails component', () => {
});
describe('pin test', () => {
const factory = vulnFinding => {
const factory = (vulnFinding) => {
wrapper = shallowMount(VulnerabilityDetails, {
propsData: {
vulnerability: vulnFinding,
......
......@@ -417,7 +417,7 @@ describe('Grouped security reports app', () => {
});
describe('coverage fuzzing reports', () => {
describe.each([true, false])('given featureEnabled is %s', shouldShowFuzzing => {
describe.each([true, false])('given featureEnabled is %s', (shouldShowFuzzing) => {
beforeEach(() => {
createWrapper(
{
......@@ -692,7 +692,7 @@ describe('Grouped security reports app', () => {
};
describe('with active MR', () => {
beforeEach(done => {
beforeEach((done) => {
createComponent({ mrState: mrStates.open }, done);
});
......@@ -704,7 +704,7 @@ describe('Grouped security reports app', () => {
});
describe('with active MR and diverged commit', () => {
beforeEach(done => {
beforeEach((done) => {
createComponent({ mrState: mrStates.open, divergedCommitsCount: 1 }, done);
});
......@@ -716,7 +716,7 @@ describe('Grouped security reports app', () => {
});
describe('with closed MR', () => {
beforeEach(done => {
beforeEach((done) => {
createComponent({ mrState: mrStates.closed }, done);
});
......@@ -726,7 +726,7 @@ describe('Grouped security reports app', () => {
});
describe('with merged MR', () => {
beforeEach(done => {
beforeEach((done) => {
createComponent({ mrState: mrStates.merged }, done);
});
......
......@@ -78,11 +78,11 @@ jest.mock('~/lib/utils/url_utility', () => ({
jest.mock('~/vue_shared/plugins/global_toast', () => jest.fn());
const createVulnerability = options => ({
const createVulnerability = (options) => ({
...options,
});
const createNonDismissedVulnerability = options =>
const createNonDismissedVulnerability = (options) =>
createVulnerability({
...options,
isDismissed: false,
......@@ -90,7 +90,7 @@ const createNonDismissedVulnerability = options =>
dismissal_feedback: null,
});
const createDismissedVulnerability = options =>
const createDismissedVulnerability = (options) =>
createVulnerability({
...options,
isDismissed: true,
......@@ -115,7 +115,7 @@ describe('security reports actions', () => {
});
describe('setHeadBlobPath', () => {
it('should commit set head blob path', done => {
it('should commit set head blob path', (done) => {
testAction(
setHeadBlobPath,
'path',
......@@ -133,7 +133,7 @@ describe('security reports actions', () => {
});
describe('setBaseBlobPath', () => {
it('should commit set head blob path', done => {
it('should commit set head blob path', (done) => {
testAction(
setBaseBlobPath,
'path',
......@@ -151,7 +151,7 @@ describe('security reports actions', () => {
});
describe('setCanReadVulnerabilityFeedback', () => {
it('should commit set vulnerabulity feedback path', done => {
it('should commit set vulnerabulity feedback path', (done) => {
testAction(
setCanReadVulnerabilityFeedback,
true,
......@@ -169,7 +169,7 @@ describe('security reports actions', () => {
});
describe('setVulnerabilityFeedbackPath', () => {
it('should commit set vulnerabulity feedback path', done => {
it('should commit set vulnerabulity feedback path', (done) => {
testAction(
setVulnerabilityFeedbackPath,
'path',
......@@ -187,7 +187,7 @@ describe('security reports actions', () => {
});
describe('setPipelineId', () => {
it('should commit set vulnerability feedback path', done => {
it('should commit set vulnerability feedback path', (done) => {
testAction(
setPipelineId,
123,
......@@ -205,7 +205,7 @@ describe('security reports actions', () => {
});
describe('requestContainerScanningDiff', () => {
it('should commit request mutation', done => {
it('should commit request mutation', (done) => {
testAction(
requestContainerScanningDiff,
null,
......@@ -222,7 +222,7 @@ describe('security reports actions', () => {
});
describe('requestDastDiff', () => {
it('should commit request mutation', done => {
it('should commit request mutation', (done) => {
testAction(
requestDastDiff,
null,
......@@ -239,7 +239,7 @@ describe('security reports actions', () => {
});
describe('requestDependencyScanningDiff', () => {
it('should commit request mutation', done => {
it('should commit request mutation', (done) => {
testAction(
requestDependencyScanningDiff,
null,
......@@ -256,7 +256,7 @@ describe('security reports actions', () => {
});
describe('requestCoverageFuzzingDiff', () => {
it('should commit request mutation', done => {
it('should commit request mutation', (done) => {
testAction(
requestCoverageFuzzingDiff,
null,
......@@ -273,7 +273,7 @@ describe('security reports actions', () => {
});
describe('openModal', () => {
it('dispatches setModalData action', done => {
it('dispatches setModalData action', (done) => {
testAction(
openModal,
{ issue: { id: 1 }, status: 'failed' },
......@@ -291,7 +291,7 @@ describe('security reports actions', () => {
});
describe('setModalData', () => {
it('commits set issue modal data', done => {
it('commits set issue modal data', (done) => {
testAction(
setModalData,
{ issue: { id: 1 }, status: 'success' },
......@@ -309,7 +309,7 @@ describe('security reports actions', () => {
});
describe('requestDismissVulnerability', () => {
it('commits request dismiss issue', done => {
it('commits request dismiss issue', (done) => {
testAction(
requestDismissVulnerability,
null,
......@@ -326,7 +326,7 @@ describe('security reports actions', () => {
});
describe('receiveDismissVulnerability', () => {
it(`should pass the payload to the ${types.RECEIVE_DISMISS_VULNERABILITY_SUCCESS} mutation`, done => {
it(`should pass the payload to the ${types.RECEIVE_DISMISS_VULNERABILITY_SUCCESS} mutation`, (done) => {
const payload = createDismissedVulnerability();
testAction(
......@@ -346,7 +346,7 @@ describe('security reports actions', () => {
});
describe('receiveDismissVulnerabilityError', () => {
it('commits receive dismiss issue error with payload', done => {
it('commits receive dismiss issue error with payload', (done) => {
testAction(
receiveDismissVulnerabilityError,
'error',
......@@ -380,7 +380,7 @@ describe('security reports actions', () => {
mockedState.createVulnerabilityFeedbackDismissalPath = 'dismiss_vulnerability_path';
});
it(`should dispatch receiveDismissVulnerability`, done => {
it(`should dispatch receiveDismissVulnerability`, (done) => {
testAction(
dismissVulnerability,
payload,
......@@ -402,7 +402,7 @@ describe('security reports actions', () => {
);
});
it('show dismiss vulnerability toast message', done => {
it('show dismiss vulnerability toast message', (done) => {
const checkToastMessage = () => {
expect(toasted).toHaveBeenCalledTimes(1);
done();
......@@ -430,7 +430,7 @@ describe('security reports actions', () => {
});
});
it('with error should dispatch `receiveDismissVulnerabilityError`', done => {
it('with error should dispatch `receiveDismissVulnerabilityError`', (done) => {
mock.onPost('dismiss_vulnerability_path').reply(500, {});
mockedState.vulnerabilityFeedbackPath = 'dismiss_vulnerability_path';
mockedState.canReadVulnerabilityFeedback = true;
......@@ -469,7 +469,7 @@ describe('security reports actions', () => {
mock.onPatch(url).replyOnce(200, data);
});
it('should dispatch the request and success actions', done => {
it('should dispatch the request and success actions', (done) => {
testAction(
addDismissalComment,
{ comment },
......@@ -487,7 +487,7 @@ describe('security reports actions', () => {
);
});
it('should show added dismissal comment toast message', done => {
it('should show added dismissal comment toast message', (done) => {
const checkToastMessage = () => {
expect(toasted).toHaveBeenCalledTimes(1);
done();
......@@ -516,7 +516,7 @@ describe('security reports actions', () => {
mock.onPatch(url).replyOnce(404);
});
it('should dispatch the request and error actions', done => {
it('should dispatch the request and error actions', (done) => {
testAction(
addDismissalComment,
{ comment },
......@@ -535,7 +535,7 @@ describe('security reports actions', () => {
});
describe('receiveAddDismissalCommentSuccess', () => {
it('should commit the success mutation', done => {
it('should commit the success mutation', (done) => {
testAction(
receiveAddDismissalCommentSuccess,
{ data },
......@@ -548,7 +548,7 @@ describe('security reports actions', () => {
});
describe('receiveAddDismissalCommentError', () => {
it('should commit the error mutation', done => {
it('should commit the error mutation', (done) => {
testAction(
receiveAddDismissalCommentError,
{},
......@@ -566,7 +566,7 @@ describe('security reports actions', () => {
});
describe('requestAddDismissalComment', () => {
it('should commit the request mutation', done => {
it('should commit the request mutation', (done) => {
testAction(
requestAddDismissalComment,
{},
......@@ -594,7 +594,7 @@ describe('security reports actions', () => {
mock.onPatch(url).replyOnce(200, data);
});
it('should dispatch the request and success actions', done => {
it('should dispatch the request and success actions', (done) => {
testAction(
deleteDismissalComment,
{ comment },
......@@ -612,7 +612,7 @@ describe('security reports actions', () => {
);
});
it('should show deleted dismissal comment toast message', done => {
it('should show deleted dismissal comment toast message', (done) => {
const checkToastMessage = () => {
expect(toasted).toHaveBeenCalledTimes(1);
done();
......@@ -641,7 +641,7 @@ describe('security reports actions', () => {
mock.onPatch(url).replyOnce(404);
});
it('should dispatch the request and error actions', done => {
it('should dispatch the request and error actions', (done) => {
testAction(
deleteDismissalComment,
{ comment },
......@@ -660,7 +660,7 @@ describe('security reports actions', () => {
});
describe('receiveDeleteDismissalCommentSuccess', () => {
it('should commit the success mutation', done => {
it('should commit the success mutation', (done) => {
testAction(
receiveDeleteDismissalCommentSuccess,
{ data },
......@@ -673,7 +673,7 @@ describe('security reports actions', () => {
});
describe('receiveDeleteDismissalCommentError', () => {
it('should commit the error mutation', done => {
it('should commit the error mutation', (done) => {
testAction(
receiveDeleteDismissalCommentError,
{},
......@@ -691,7 +691,7 @@ describe('security reports actions', () => {
});
describe('requestDeleteDismissalComment', () => {
it('should commit the request mutation', done => {
it('should commit the request mutation', (done) => {
testAction(
requestDeleteDismissalComment,
{},
......@@ -705,7 +705,7 @@ describe('security reports actions', () => {
});
describe('showDismissalDeleteButtons', () => {
it('commits show dismissal delete buttons', done => {
it('commits show dismissal delete buttons', (done) => {
testAction(
showDismissalDeleteButtons,
null,
......@@ -722,7 +722,7 @@ describe('security reports actions', () => {
});
describe('hideDismissalDeleteButtons', () => {
it('commits hide dismissal delete buttons', done => {
it('commits hide dismissal delete buttons', (done) => {
testAction(
hideDismissalDeleteButtons,
null,
......@@ -751,7 +751,7 @@ describe('security reports actions', () => {
payload = createNonDismissedVulnerability({ ...mockedState.modal.vulnerability });
});
it('should dispatch `receiveDismissVulnerability`', done => {
it('should dispatch `receiveDismissVulnerability`', (done) => {
testAction(
revertDismissVulnerability,
payload,
......@@ -771,7 +771,7 @@ describe('security reports actions', () => {
});
});
it('with error should dispatch `receiveDismissVulnerabilityError`', done => {
it('with error should dispatch `receiveDismissVulnerabilityError`', (done) => {
mock.onDelete('dismiss_vulnerability_path/123').reply(500, {});
mockedState.modal.vulnerability.dismissalFeedback = { id: 123 };
mockedState.createVulnerabilityFeedbackDismissalPath = 'dismiss_vulnerability_path';
......@@ -796,7 +796,7 @@ describe('security reports actions', () => {
});
describe('requestCreateIssue', () => {
it('commits request create issue', done => {
it('commits request create issue', (done) => {
testAction(
requestCreateIssue,
null,
......@@ -813,7 +813,7 @@ describe('security reports actions', () => {
});
describe('receiveCreateIssue', () => {
it('commits receive create issue', done => {
it('commits receive create issue', (done) => {
testAction(
receiveCreateIssue,
null,
......@@ -830,7 +830,7 @@ describe('security reports actions', () => {
});
describe('receiveCreateIssueError', () => {
it('commits receive create issue error with payload', done => {
it('commits receive create issue error with payload', (done) => {
testAction(
receiveCreateIssueError,
'error',
......@@ -848,7 +848,7 @@ describe('security reports actions', () => {
});
describe('createNewIssue', () => {
it('with success should dispatch `requestCreateIssue` and `receiveCreateIssue`', done => {
it('with success should dispatch `requestCreateIssue` and `receiveCreateIssue`', (done) => {
mock.onPost('create_issue_path').reply(200, { issue_path: 'new_issue' });
mockedState.createVulnerabilityFeedbackIssuePath = 'create_issue_path';
......@@ -869,7 +869,7 @@ describe('security reports actions', () => {
);
});
it('with error should dispatch `receiveCreateIssueError`', done => {
it('with error should dispatch `receiveCreateIssueError`', (done) => {
mock.onPost('create_issue_path').reply(500, {});
mockedState.vulnerabilityFeedbackPath = 'create_issue_path';
mockedState.canReadVulnerabilityFeedback = true;
......@@ -921,7 +921,7 @@ describe('security reports actions', () => {
});
describe('requestCreateMergeRequest', () => {
it('commits request create merge request', done => {
it('commits request create merge request', (done) => {
testAction(
requestCreateMergeRequest,
null,
......@@ -938,7 +938,7 @@ describe('security reports actions', () => {
});
describe('receiveCreateMergeRequestSuccess', () => {
it('commits receive create merge request', done => {
it('commits receive create merge request', (done) => {
const data = { foo: 'bar' };
testAction(
......@@ -958,7 +958,7 @@ describe('security reports actions', () => {
});
describe('receiveCreateMergeRequestError', () => {
it('commits receive create merge request error', done => {
it('commits receive create merge request error', (done) => {
testAction(
receiveCreateMergeRequestError,
'',
......@@ -975,7 +975,7 @@ describe('security reports actions', () => {
});
describe('createMergeRequest', () => {
it('with success should dispatch `receiveCreateMergeRequestSuccess`', done => {
it('with success should dispatch `receiveCreateMergeRequestSuccess`', (done) => {
const data = { merge_request_path: 'fakepath.html' };
mockedState.createVulnerabilityFeedbackMergeRequestPath = 'create_merge_request_path';
mock.onPost('create_merge_request_path').reply(200, data);
......@@ -998,7 +998,7 @@ describe('security reports actions', () => {
);
});
it('with error should dispatch `receiveCreateMergeRequestError`', done => {
it('with error should dispatch `receiveCreateMergeRequestError`', (done) => {
mock.onPost('create_merge_request_path').reply(500, {});
mockedState.vulnerabilityFeedbackPath = 'create_merge_request_path';
mockedState.canReadVulnerabilityFeedback = true;
......@@ -1023,7 +1023,7 @@ describe('security reports actions', () => {
});
describe('updateDependencyScanningIssue', () => {
it('commits update dependency scanning issue', done => {
it('commits update dependency scanning issue', (done) => {
const payload = { foo: 'bar' };
testAction(
......@@ -1043,7 +1043,7 @@ describe('security reports actions', () => {
});
describe('updateContainerScanningIssue', () => {
it('commits update container scanning issue', done => {
it('commits update container scanning issue', (done) => {
const payload = { foo: 'bar' };
testAction(
......@@ -1063,7 +1063,7 @@ describe('security reports actions', () => {
});
describe('updateDastIssue', () => {
it('commits update dast issue', done => {
it('commits update dast issue', (done) => {
const payload = { foo: 'bar' };
testAction(
......@@ -1083,7 +1083,7 @@ describe('security reports actions', () => {
});
describe('updateCoverageFuzzingIssue', () => {
it('commits update coverageFuzzing issue', done => {
it('commits update coverageFuzzing issue', (done) => {
const payload = { foo: 'bar' };
testAction(
......@@ -1103,7 +1103,7 @@ describe('security reports actions', () => {
});
describe('setContainerScanningDiffEndpoint', () => {
it('should pass down the endpoint to the mutation', done => {
it('should pass down the endpoint to the mutation', (done) => {
const payload = '/container_scanning_endpoint.json';
testAction(
......@@ -1123,7 +1123,7 @@ describe('security reports actions', () => {
});
describe('receiveContainerScanningDiffSuccess', () => {
it('should pass down the response to the mutation', done => {
it('should pass down the response to the mutation', (done) => {
const payload = { data: 'Effort yields its own rewards.' };
testAction(
......@@ -1143,7 +1143,7 @@ describe('security reports actions', () => {
});
describe('receiveContainerScanningDiffError', () => {
it('should commit container diff error mutation', done => {
it('should commit container diff error mutation', (done) => {
testAction(
receiveContainerScanningDiffError,
undefined,
......@@ -1170,7 +1170,7 @@ describe('security reports actions', () => {
});
describe('on success', () => {
it('should dispatch `receiveContainerScanningDiffSuccess`', done => {
it('should dispatch `receiveContainerScanningDiffSuccess`', (done) => {
mock.onGet(endpoint).reply(200, diff);
mock
.onGet('vulnerabilities_feedback', {
......@@ -1208,7 +1208,7 @@ describe('security reports actions', () => {
mock.onGet(endpoint).reply(200, diff);
});
it('should dispatch `receiveContainerScanningDiffSuccess`', done => {
it('should dispatch `receiveContainerScanningDiffSuccess`', (done) => {
testAction(
fetchContainerScanningDiff,
null,
......@@ -1232,7 +1232,7 @@ describe('security reports actions', () => {
});
describe('when vulnerabilities path errors', () => {
it('should dispatch `receiveContainerScanningError`', done => {
it('should dispatch `receiveContainerScanningError`', (done) => {
mock.onGet(endpoint).reply(500);
mock
.onGet('vulnerabilities_feedback', {
......@@ -1261,7 +1261,7 @@ describe('security reports actions', () => {
});
describe('when feedback path errors', () => {
it('should dispatch `receiveContainerScanningError`', done => {
it('should dispatch `receiveContainerScanningError`', (done) => {
mock.onGet(endpoint).reply(200, diff);
mock
.onGet('vulnerabilities_feedback', {
......@@ -1291,7 +1291,7 @@ describe('security reports actions', () => {
});
describe('setDependencyScanningDiffEndpoint', () => {
it('should pass down the endpoint to the mutation', done => {
it('should pass down the endpoint to the mutation', (done) => {
const payload = '/dependency_scanning_endpoint.json';
testAction(
......@@ -1311,7 +1311,7 @@ describe('security reports actions', () => {
});
describe('receiveDependencyScanningDiffSuccess', () => {
it('should pass down the response to the mutation', done => {
it('should pass down the response to the mutation', (done) => {
const payload = { data: 'Effort yields its own rewards.' };
testAction(
......@@ -1331,7 +1331,7 @@ describe('security reports actions', () => {
});
describe('receiveDependencyScanningDiffError', () => {
it('should commit dependency scanning diff error mutation', done => {
it('should commit dependency scanning diff error mutation', (done) => {
testAction(
receiveDependencyScanningDiffError,
undefined,
......@@ -1357,7 +1357,7 @@ describe('security reports actions', () => {
});
describe('on success', () => {
it('should dispatch `receiveDependencyScanningDiffSuccess`', done => {
it('should dispatch `receiveDependencyScanningDiffSuccess`', (done) => {
mock.onGet('dependency_scanning_diff.json').reply(200, diff);
mock
.onGet('vulnerabilities_feedback', {
......@@ -1395,7 +1395,7 @@ describe('security reports actions', () => {
mock.onGet('dependency_scanning_diff.json').reply(200, diff);
});
it('should dispatch `receiveDependencyScanningDiffSuccess`', done => {
it('should dispatch `receiveDependencyScanningDiffSuccess`', (done) => {
testAction(
fetchDependencyScanningDiff,
null,
......@@ -1419,7 +1419,7 @@ describe('security reports actions', () => {
});
describe('when vulnerabilities path errors', () => {
it('should dispatch `receiveDependencyScanningError`', done => {
it('should dispatch `receiveDependencyScanningError`', (done) => {
mock.onGet('dependency_scanning_diff.json').reply(500);
mock
.onGet('vulnerabilities_feedback', {
......@@ -1448,7 +1448,7 @@ describe('security reports actions', () => {
});
describe('when feedback path errors', () => {
it('should dispatch `receiveDependencyScanningError`', done => {
it('should dispatch `receiveDependencyScanningError`', (done) => {
mock.onGet('dependency_scanning_diff.json').reply(200, diff);
mock
.onGet('vulnerabilities_feedback', {
......@@ -1478,7 +1478,7 @@ describe('security reports actions', () => {
});
describe('setDastDiffEndpoint', () => {
it('should pass down the endpoint to the mutation', done => {
it('should pass down the endpoint to the mutation', (done) => {
const payload = '/dast_endpoint.json';
testAction(
......@@ -1498,7 +1498,7 @@ describe('security reports actions', () => {
});
describe('receiveDastDiffSuccess', () => {
it('should pass down the response to the mutation', done => {
it('should pass down the response to the mutation', (done) => {
const payload = { data: 'Effort yields its own rewards.' };
testAction(
......@@ -1518,7 +1518,7 @@ describe('security reports actions', () => {
});
describe('receiveDastDiffError', () => {
it('should commit dast diff error mutation', done => {
it('should commit dast diff error mutation', (done) => {
testAction(
receiveDastDiffError,
undefined,
......@@ -1544,7 +1544,7 @@ describe('security reports actions', () => {
});
describe('on success', () => {
it('should dispatch `receiveDastDiffSuccess`', done => {
it('should dispatch `receiveDastDiffSuccess`', (done) => {
mock.onGet('dast_diff.json').reply(200, diff);
mock
.onGet('vulnerabilities_feedback', {
......@@ -1582,7 +1582,7 @@ describe('security reports actions', () => {
mock.onGet('dast_diff.json').reply(200, diff);
});
it('should dispatch `receiveDastDiffSuccess`', done => {
it('should dispatch `receiveDastDiffSuccess`', (done) => {
testAction(
fetchDastDiff,
null,
......@@ -1606,7 +1606,7 @@ describe('security reports actions', () => {
});
describe('when vulnerabilities path errors', () => {
it('should dispatch `receiveDastError`', done => {
it('should dispatch `receiveDastError`', (done) => {
mock.onGet('dast_diff.json').reply(500);
mock
.onGet('vulnerabilities_feedback', {
......@@ -1635,7 +1635,7 @@ describe('security reports actions', () => {
});
describe('when feedback path errors', () => {
it('should dispatch `receiveDastError`', done => {
it('should dispatch `receiveDastError`', (done) => {
mock.onGet('dast_diff.json').reply(200, diff);
mock
.onGet('vulnerabilities_feedback', {
......@@ -1665,7 +1665,7 @@ describe('security reports actions', () => {
});
describe('setCoverageFuzzingDiffEndpoint', () => {
it('should pass down the endpoint to the mutation', done => {
it('should pass down the endpoint to the mutation', (done) => {
const payload = '/coverage_fuzzing_endpoint.json';
testAction(
......@@ -1685,7 +1685,7 @@ describe('security reports actions', () => {
});
describe('receiveCoverageFuzzingDiffSuccess', () => {
it('should pass down the response to the mutation', done => {
it('should pass down the response to the mutation', (done) => {
const payload = { data: 'Effort yields its own rewards.' };
testAction(
......@@ -1705,7 +1705,7 @@ describe('security reports actions', () => {
});
describe('receiveCoverageFuzzingDiffError', () => {
it('should commit coverage fuzzing diff error mutation', done => {
it('should commit coverage fuzzing diff error mutation', (done) => {
testAction(
receiveCoverageFuzzingDiffError,
undefined,
......@@ -1730,7 +1730,7 @@ describe('security reports actions', () => {
});
describe('on success', () => {
it('should dispatch `receiveCoverageFuzzingDiffSuccess`', done => {
it('should dispatch `receiveCoverageFuzzingDiffSuccess`', (done) => {
mock.onGet('coverage_fuzzing_diff.json').reply(200, diff);
mock
.onGet('vulnerabilities_feedback', {
......@@ -1763,7 +1763,7 @@ describe('security reports actions', () => {
});
describe('when vulnerabilities path errors', () => {
it('should dispatch `receiveCoverageFuzzingError`', done => {
it('should dispatch `receiveCoverageFuzzingError`', (done) => {
mock.onGet('coverage_fuzzing_diff.json').reply(500);
mock
.onGet('vulnerabilities_feedback', {
......@@ -1792,7 +1792,7 @@ describe('security reports actions', () => {
});
describe('when feedback path errors', () => {
it('should dispatch `receiveCoverageFuzzingError`', done => {
it('should dispatch `receiveCoverageFuzzingError`', (done) => {
mock.onGet('coverage_fuzzing_diff.json').reply(200, diff);
mock
.onGet('vulnerabilities_feedback', {
......
......@@ -32,7 +32,7 @@ import { groupedTextBuilder } from 'ee/vue_shared/security_reports/store/utils';
const MOCK_PATH = 'fake/path.json';
const generateVuln = severity => ({ severity });
const generateVuln = (severity) => ({ severity });
describe('Security reports getters', () => {
let state = {};
......
......@@ -7,7 +7,7 @@ const mockedStore = {
dispatch: jest.fn(),
};
mockedStore.subscribe = callback => {
mockedStore.subscribe = (callback) => {
mockedStore.commit = callback;
};
......@@ -19,7 +19,7 @@ describe('security reports mediator', () => {
describe(types.RECEIVE_DISMISS_VULNERABILITY_SUCCESS, () => {
const type = types.RECEIVE_DISMISS_VULNERABILITY_SUCCESS;
it.each(Object.entries(updateIssueActionsMap).map(entry => entry.reverse()))(
it.each(Object.entries(updateIssueActionsMap).map((entry) => entry.reverse()))(
`should trigger %s on when a %s is updated`,
(action, category) => {
const payload = { category };
......
......@@ -25,7 +25,7 @@ describe('EE api fuzzing report actions', () => {
});
describe('updateVulnerability', () => {
it(`should commit ${types.UPDATE_VULNERABILITY} with the correct response`, done => {
it(`should commit ${types.UPDATE_VULNERABILITY} with the correct response`, (done) => {
testAction(
actions.updateVulnerability,
issue,
......@@ -43,7 +43,7 @@ describe('EE api fuzzing report actions', () => {
});
describe('setDiffEndpoint', () => {
it(`should commit ${types.SET_DIFF_ENDPOINT} with the correct path`, done => {
it(`should commit ${types.SET_DIFF_ENDPOINT} with the correct path`, (done) => {
testAction(
actions.setDiffEndpoint,
diffEndpoint,
......@@ -61,13 +61,13 @@ describe('EE api fuzzing report actions', () => {
});
describe('requestDiff', () => {
it(`should commit ${types.REQUEST_DIFF}`, done => {
it(`should commit ${types.REQUEST_DIFF}`, (done) => {
testAction(actions.requestDiff, {}, state, [{ type: types.REQUEST_DIFF }], [], done);
});
});
describe('receiveDiffSuccess', () => {
it(`should commit ${types.RECEIVE_DIFF_SUCCESS} with the correct response`, done => {
it(`should commit ${types.RECEIVE_DIFF_SUCCESS} with the correct response`, (done) => {
testAction(
actions.receiveDiffSuccess,
reports,
......@@ -85,7 +85,7 @@ describe('EE api fuzzing report actions', () => {
});
describe('receiveDiffError', () => {
it(`should commit ${types.RECEIVE_DIFF_ERROR} with the correct response`, done => {
it(`should commit ${types.RECEIVE_DIFF_ERROR} with the correct response`, (done) => {
testAction(
actions.receiveDiffError,
error,
......@@ -124,7 +124,7 @@ describe('EE api fuzzing report actions', () => {
.replyOnce(200, reports.enrichData);
});
it('should dispatch the `receiveDiffSuccess` action', done => {
it('should dispatch the `receiveDiffSuccess` action', (done) => {
const { diff, enrichData } = reports;
testAction(
actions.fetchDiff,
......@@ -152,7 +152,7 @@ describe('EE api fuzzing report actions', () => {
mock.onGet(diffEndpoint).replyOnce(200, reports.diff);
});
it('should dispatch the `receiveDiffSuccess` action with empty enrich data', done => {
it('should dispatch the `receiveDiffSuccess` action with empty enrich data', (done) => {
const { diff } = reports;
const enrichData = [];
testAction(
......@@ -184,7 +184,7 @@ describe('EE api fuzzing report actions', () => {
.replyOnce(404);
});
it('should dispatch the `receiveError` action', done => {
it('should dispatch the `receiveError` action', (done) => {
testAction(
actions.fetchDiff,
{},
......@@ -205,7 +205,7 @@ describe('EE api fuzzing report actions', () => {
.replyOnce(200, reports.enrichData);
});
it('should dispatch the `receiveDiffError` action', done => {
it('should dispatch the `receiveDiffError` action', (done) => {
testAction(
actions.fetchDiff,
{},
......
......@@ -14,7 +14,7 @@ describe('EE sast report actions', () => {
});
describe('updateVulnerability', () => {
it(`should commit ${types.UPDATE_VULNERABILITY} with the correct response`, done => {
it(`should commit ${types.UPDATE_VULNERABILITY} with the correct response`, (done) => {
testAction(
actions.updateVulnerability,
issue,
......
......@@ -14,7 +14,7 @@ describe('EE secret detection report actions', () => {
});
describe('updateVulnerability', () => {
it(`should commit ${types.UPDATE_VULNERABILITY} with the correct response`, done => {
it(`should commit ${types.UPDATE_VULNERABILITY} with the correct response`, (done) => {
testAction(
actions.updateVulnerability,
issue,
......
......@@ -16,7 +16,7 @@ describe('Vulnerability Details', () => {
description: 'vulnerability description',
};
const createWrapper = vulnerabilityOverrides => {
const createWrapper = (vulnerabilityOverrides) => {
const propsData = {
vulnerability: { ...vulnerability, ...vulnerabilityOverrides },
};
......@@ -24,9 +24,9 @@ describe('Vulnerability Details', () => {
wrapper = mount(VulnerabilityDetails, { propsData });
};
const getById = id => wrapper.find(`[data-testid="${id}"]`);
const getAllById = id => wrapper.findAll(`[data-testid="${id}"]`);
const getText = id => getById(id).text();
const getById = (id) => wrapper.find(`[data-testid="${id}"]`);
const getAllById = (id) => wrapper.findAll(`[data-testid="${id}"]`);
const getText = (id) => getById(id).text();
afterEach(() => {
wrapper.destroy();
......@@ -212,17 +212,17 @@ describe('Vulnerability Details', () => {
isCode: true,
};
const getTextContent = el => el.textContent.trim();
const getLabel = el => getTextContent(getByTestId(el, 'label'));
const getContent = el => getTextContent(getByTestId(el, 'value'));
const getSectionData = testId => {
const getTextContent = (el) => el.textContent.trim();
const getLabel = (el) => getTextContent(getByTestId(el, 'label'));
const getContent = (el) => getTextContent(getByTestId(el, 'value'));
const getSectionData = (testId) => {
const section = getById(testId).element;
if (!section) {
return null;
}
return getAllByRole(section, 'listitem').map(li => ({
return getAllByRole(section, 'listitem').map((li) => ({
label: getLabel(li),
content: getContent(li),
...(li.querySelector('code') ? { isCode: true } : {}),
......
......@@ -375,7 +375,7 @@ describe('Vulnerability Header', () => {
describe('vulnerability user watcher', () => {
it.each(vulnerabilityStateEntries)(
`loads the correct user for the vulnerability state "%s"`,
state => {
(state) => {
const user = createRandomUser();
createWrapper({ vulnerability: { state, [`${state}ById`]: user.id } });
......
......@@ -5,7 +5,7 @@ describe('Vulnerabilities helpers', () => {
it.each([
{ iid: 135, web_url: 'some/url' },
{ iid: undefined, web_url: undefined },
])('returns formatted issue with expected properties for issue %s', issue => {
])('returns formatted issue with expected properties for issue %s', (issue) => {
const formattedIssue = getFormattedIssue(issue);
expect(formattedIssue).toMatchObject({
......
......@@ -5,7 +5,7 @@ import HistoryCommentEditor from 'ee/vulnerabilities/components/history_comment_
describe('History Comment Editor', () => {
let wrapper;
const createWrapper = props => {
const createWrapper = (props) => {
wrapper = shallowMount(HistoryCommentEditor, {
propsData: { isSaving: false, ...props },
});
......
......@@ -12,7 +12,7 @@ jest.mock('~/flash');
describe('History Comment', () => {
let wrapper;
const createWrapper = comment => {
const createWrapper = (comment) => {
wrapper = mount(HistoryComment, {
propsData: {
comment,
......
......@@ -42,7 +42,7 @@ describe('History Entry', () => {
const eventItem = () => wrapper.find(EventItem);
const newComment = () => wrapper.find({ ref: 'newComment' });
const existingComments = () => wrapper.findAll({ ref: 'existingComment' });
const commentAt = index => existingComments().at(index);
const commentAt = (index) => existingComments().at(index);
afterEach(() => wrapper.destroy());
......
......@@ -5,7 +5,7 @@ import { getBinding, createMockDirective } from 'helpers/vue_mock_directive';
describe('IssueLink component', () => {
let wrapper;
const createIssue = options => ({
const createIssue = (options) => ({
title: 'my-issue',
iid: 12,
webUrl: 'http://localhost/issues/~/12',
......@@ -21,8 +21,8 @@ describe('IssueLink component', () => {
});
};
const findIssueLink = id => wrapper.find(`[data-testid="issue-link-${id}"]`);
const findIssueWithState = state =>
const findIssueLink = (id) => wrapper.find(`[data-testid="issue-link-${id}"]`);
const findIssueWithState = (state) =>
wrapper.find(state === 'opened' ? 'issue-open-m' : 'issue-close');
afterEach(() => {
......
......@@ -54,7 +54,7 @@ describe('Vulnerability related issues component', () => {
};
const relatedIssuesBlock = () => wrapper.find(RelatedIssuesBlock);
const blockProp = prop => relatedIssuesBlock().props(prop);
const blockProp = (prop) => relatedIssuesBlock().props(prop);
const blockEmit = (eventName, data) => relatedIssuesBlock().vm.$emit(eventName, data);
const findCreateIssueButton = () => wrapper.find({ ref: 'createIssue' });
......
......@@ -30,7 +30,7 @@ describe('Vulnerability status description component', () => {
const statusEl = () => wrapper.find('[data-testid="status"]');
// Create a date using the passed-in string, or just use the current time if nothing was passed in.
const createDate = value => (value ? new Date(value) : new Date()).toISOString();
const createDate = (value) => (value ? new Date(value) : new Date()).toISOString();
const createWrapper = (props = {}) => {
const vulnerability = props.vulnerability || { pipeline: {} };
......@@ -47,7 +47,7 @@ describe('Vulnerability status description component', () => {
};
describe('state text', () => {
it.each(ALL_STATES)('shows the correct string for the vulnerability state "%s"', state => {
it.each(ALL_STATES)('shows the correct string for the vulnerability state "%s"', (state) => {
createWrapper({ vulnerability: { state, pipeline: {} } });
expect(wrapper.text()).toMatch(new RegExp(`^${capitalize(state)}`));
......@@ -78,9 +78,9 @@ describe('Vulnerability status description component', () => {
});
// The .map() is used to output the correct test name by doubling up the parameter, i.e. 'detected' -> ['detected', 'detected'].
it.each(NON_DETECTED_STATES.map(x => [x, x]))(
it.each(NON_DETECTED_STATES.map((x) => [x, x]))(
'uses the "%s_at" property when the vulnerability state is "%s"',
state => {
(state) => {
const expectedDate = createDate();
createWrapper({
vulnerability: {
......@@ -106,7 +106,7 @@ describe('Vulnerability status description component', () => {
it.each(NON_DETECTED_STATES)(
'does not show the pipeline link when the vulnerability state is "%s"',
state => {
(state) => {
createWrapper({
vulnerability: { state, pipeline: { url: 'pipeline/url' } },
});
......
......@@ -18,9 +18,9 @@ describe('Vulnerability state dropdown component', () => {
};
// isSelected is designed to work with both single VueWrapper or WrapperArray
const isSelected = items =>
Boolean((items.wrappers ?? [items]).find(w => w.find('.selected-icon').exists()));
const isDisabled = item => item.attributes('disabled') === 'true';
const isSelected = (items) =>
Boolean((items.wrappers ?? [items]).find((w) => w.find('.selected-icon').exists()));
const isDisabled = (item) => item.attributes('disabled') === 'true';
const dropdownItems = () => wrapper.findAll('.dropdown-item');
const firstUnselectedItem = () => wrapper.find('.dropdown-item:not(.selected)');
const selectedItem = () => wrapper.find('.dropdown-item.selected');
......@@ -28,8 +28,8 @@ describe('Vulnerability state dropdown component', () => {
const cancelButton = () => wrapper.find({ ref: 'cancel-button' });
const innerDropdown = () => wrapper.find({ ref: 'dropdown' });
const dropdownItemFor = stateEntry =>
dropdownItems().wrappers.find(x => {
const dropdownItemFor = (stateEntry) =>
dropdownItems().wrappers.find((x) => {
const text = x.text();
return text.includes(stateEntry.displayName) && text.includes(stateEntry.description);
});
......
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