Commit cdc1a4a8 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 50 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 87ad67fe
......@@ -1531,39 +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
## jovial-haslett
ee/spec/frontend/security_dashboard/helpers.js
ee/spec/frontend/security_dashboard/helpers_spec.js
ee/spec/frontend/security_dashboard/store/modules/filters/mutations_spec.js
ee/spec/frontend/security_dashboard/store/modules/pipeline_jobs/actions_spec.js
ee/spec/frontend/security_dashboard/store/modules/project_selector/actions_spec.js
ee/spec/frontend/security_dashboard/store/modules/project_selector/utils/add_page_info_spec.js
ee/spec/frontend/security_dashboard/store/modules/projects/actions_spec.js
ee/spec/frontend/security_dashboard/store/modules/unscanned_projects/getters_spec.js
ee/spec/frontend/security_dashboard/store/modules/unscanned_projects/utils_spec.js
ee/spec/frontend/security_dashboard/store/modules/vulnerabilities/actions_spec.js
ee/spec/frontend/security_dashboard/store/modules/vulnerabilities/utils_spec.js
ee/spec/frontend/security_dashboard/store/modules/vulnerable_projects/mock_data.js
ee/spec/frontend/security_dashboard/store/modules/vulnerable_projects/utils_spec.js
ee/spec/frontend/sidebar/components/iteration_select_spec.js
ee/spec/frontend/sidebar/components/status/sidebar_status_spec.js
ee/spec/frontend/status_page_settings/store/actions_spec.js
ee/spec/frontend/storage_counter/components/usage_graph_spec.js
ee/spec/frontend/storage_counter/components/usage_statistics_spec.js
ee/spec/frontend/storage_counter/mock_data.js
ee/spec/frontend/storage_counter/utils_spec.js
ee/spec/frontend/subscriptions/new/components/checkout/progress_bar_spec.js
ee/spec/frontend/subscriptions/new/components/checkout/step_spec.js
ee/spec/frontend/subscriptions/new/components/checkout/subscription_details_spec.js
ee/spec/frontend/subscriptions/new/store/actions_spec.js
ee/spec/frontend/test_case_create/components/test_case_create_root_spec.js
ee/spec/frontend/threat_monitoring/components/app_spec.js
ee/spec/frontend/threat_monitoring/components/environment_picker_spec.js
ee/spec/frontend/threat_monitoring/components/network_policy_list_spec.js
ee/spec/frontend/threat_monitoring/components/policy_editor/lib/rules_spec.js
ee/spec/frontend/threat_monitoring/components/policy_editor/policy_rule_builder_spec.js
ee/spec/frontend/threat_monitoring/components/policy_editor/policy_rule_entity_spec.js
## modest-kilby
ee/spec/frontend/threat_monitoring/components/statistics_summary_spec.js
ee/spec/frontend/threat_monitoring/components/threat_monitoring_filters_spec.js
......
import filterState from 'ee/security_dashboard/store/modules/filters/state';
import vulnerabilitiesState from 'ee/security_dashboard/store/modules/vulnerabilities/state';
export const resetStore = store => {
export const resetStore = (store) => {
const newState = {
vulnerabilities: vulnerabilitiesState(),
filters: filterState(),
......
......@@ -36,7 +36,7 @@ describe('getFormattedSummary', () => {
it.each([undefined, [], [1], 'hello world', 123])(
'returns an empty array when summary is %s',
summary => {
(summary) => {
expect(getFormattedSummary(summary)).toEqual([]);
},
);
......
......@@ -7,8 +7,8 @@ import mutations from 'ee/security_dashboard/store/modules/filters/mutations';
import createState from 'ee/security_dashboard/store/modules/filters/state';
import { DISMISSAL_STATES } from 'ee/security_dashboard/store/modules/filters/constants';
const criticalOption = severityFilter.options.find(x => x.id === 'CRITICAL');
const highOption = severityFilter.options.find(x => x.id === 'HIGH');
const criticalOption = severityFilter.options.find((x) => x.id === 'CRITICAL');
const highOption = severityFilter.options.find((x) => x.id === 'HIGH');
const existingFilters = {
filter1: ['some', 'value'],
......@@ -44,7 +44,7 @@ describe('filters module mutations', () => {
});
describe('SET_HIDE_DISMISSED', () => {
it.each(Object.values(DISMISSAL_STATES))(`sets scope filter to "%s"`, value => {
it.each(Object.values(DISMISSAL_STATES))(`sets scope filter to "%s"`, (value) => {
mutations[SET_HIDE_DISMISSED](state, value);
expect(state.filters.scope).toBe(value);
});
......
......@@ -17,7 +17,7 @@ describe('pipeling jobs actions', () => {
describe('setPipelineJobsPath', () => {
const pipelineJobsPath = 123;
it('should commit the SET_PIPELINE_JOBS_PATH mutation', done => {
it('should commit the SET_PIPELINE_JOBS_PATH mutation', (done) => {
testAction(
actions.setPipelineJobsPath,
pipelineJobsPath,
......@@ -37,7 +37,7 @@ describe('pipeling jobs actions', () => {
describe('setProjectId', () => {
const projectId = 123;
it('should commit the SET_PIPELINE_JOBS_PATH mutation', done => {
it('should commit the SET_PIPELINE_JOBS_PATH mutation', (done) => {
testAction(
actions.setProjectId,
projectId,
......@@ -57,7 +57,7 @@ describe('pipeling jobs actions', () => {
describe('setPipelineId', () => {
const pipelineId = 123;
it('should commit the SET_PIPELINE_ID mutation', done => {
it('should commit the SET_PIPELINE_ID mutation', (done) => {
testAction(
actions.setPipelineId,
pipelineId,
......@@ -92,7 +92,7 @@ describe('pipeling jobs actions', () => {
mock.onGet(state.pipelineJobsPath).replyOnce(200, jobs);
});
it('should commit the request and success mutations', done => {
it('should commit the request and success mutations', (done) => {
testAction(
actions.fetchPipelineJobs,
{},
......@@ -115,7 +115,7 @@ describe('pipeling jobs actions', () => {
mock.onGet('/api/undefined/projects/123/pipelines/321/jobs').replyOnce(200, jobs);
});
it('should commit the request and success mutations', done => {
it('should commit the request and success mutations', (done) => {
state.pipelineJobsPath = '';
state.projectId = 123;
state.pipelineId = 321;
......@@ -142,7 +142,7 @@ describe('pipeling jobs actions', () => {
mock.onGet(state.pipelineJobsPath).replyOnce(200, jobs);
});
it('should commit RECEIVE_PIPELINE_JOBS_ERROR mutation', done => {
it('should commit RECEIVE_PIPELINE_JOBS_ERROR mutation', (done) => {
state.pipelineJobsPath = '';
testAction(
......@@ -165,7 +165,7 @@ describe('pipeling jobs actions', () => {
mock.onGet(state.pipelineJobsPath).replyOnce(200, jobs);
});
it('should commit RECEIVE_PIPELINE_JOBS_ERROR mutation', done => {
it('should commit RECEIVE_PIPELINE_JOBS_ERROR mutation', (done) => {
state.pipelineJobsPath = '';
state.projectId = undefined;
state.pipelineId = undefined;
......@@ -190,7 +190,7 @@ describe('pipeling jobs actions', () => {
mock.onGet(state.pipelineJobsPath).replyOnce(404);
});
it('should commit REQUEST_PIPELINE_JOBS and RECEIVE_PIPELINE_JOBS_ERROR mutation', done => {
it('should commit REQUEST_PIPELINE_JOBS and RECEIVE_PIPELINE_JOBS_ERROR mutation', (done) => {
testAction(
actions.fetchPipelineJobs,
{},
......
......@@ -10,7 +10,7 @@ import axios from '~/lib/utils/axios_utils';
jest.mock('~/flash');
describe('EE projectSelector actions', () => {
const getMockProjects = n => [...Array(n).keys()].map(i => ({ id: i, name: `project-${i}` }));
const getMockProjects = (n) => [...Array(n).keys()].map((i) => ({ id: i, name: `project-${i}` }));
const mockAddEndpoint = 'mock-add_endpoint';
const mockListEndpoint = 'mock-list_endpoint';
......@@ -45,7 +45,7 @@ describe('EE projectSelector actions', () => {
});
describe('toggleSelectedProject', () => {
it('adds a project to selectedProjects if it does not already exist in the list', done => {
it('adds a project to selectedProjects if it does not already exist in the list', (done) => {
const payload = getMockProjects(1);
testAction(
......@@ -459,7 +459,7 @@ describe('EE projectSelector actions', () => {
describe('fetchSearchResults', () => {
it.each([null, undefined, false, NaN, 0, ''])(
'dispatches setMinimumQueryMessage if the search query is falsy',
searchQuery => {
(searchQuery) => {
state.searchQuery = searchQuery;
return testAction(
......@@ -481,7 +481,7 @@ describe('EE projectSelector actions', () => {
it.each(['a', 'aa'])(
'dispatches setMinimumQueryMessage if the search query was not long enough',
shortSearchQuery => {
(shortSearchQuery) => {
state.searchQuery = shortSearchQuery;
return testAction(
......
......@@ -28,7 +28,7 @@ describe('EE Project Selector store utils', () => {
it.each([{}, { foo: 'foo' }, null, undefined, false])(
'returns the original input if it does not contain a header property',
input => {
(input) => {
expect(addPageInfo(input)).toBe(input);
},
);
......
......@@ -34,16 +34,16 @@ describe('projects actions', () => {
};
beforeEach(() => {
mock.onGet(state.projectsEndpoint).replyOnce(config => {
mock.onGet(state.projectsEndpoint).replyOnce((config) => {
const hasExpectedParams = Object.keys(expectedParams).every(
param => config.params[param] === expectedParams[param],
(param) => config.params[param] === expectedParams[param],
);
return hasExpectedParams ? [200, data] : [400];
});
});
it('should dispatch the request and success actions', done => {
it('should dispatch the request and success actions', (done) => {
testAction(
actions.fetchProjects,
{},
......@@ -70,7 +70,7 @@ describe('projects actions', () => {
mock.onGet(state.projectsEndpoint, { page: '2' }).replyOnce(200, [2]);
});
it('should dispatch the request and success actions', done => {
it('should dispatch the request and success actions', (done) => {
testAction(
actions.fetchProjects,
{},
......@@ -93,7 +93,7 @@ describe('projects actions', () => {
mock.onGet(state.projectsEndpoint).replyOnce(404, {});
});
it('should dispatch the request and error actions', done => {
it('should dispatch the request and error actions', (done) => {
testAction(
actions.fetchProjects,
{},
......@@ -110,14 +110,14 @@ describe('projects actions', () => {
state.projectsEndpoint = '';
});
it('should not do anything', done => {
it('should not do anything', (done) => {
testAction(actions.fetchProjects, {}, state, [], [], done);
});
});
});
describe('receiveProjectsSuccess', () => {
it('should commit the success mutation', done => {
it('should commit the success mutation', (done) => {
const state = createState();
testAction(
......@@ -137,7 +137,7 @@ describe('projects actions', () => {
});
describe('receiveProjectsError', () => {
it('should commit the error mutation', done => {
it('should commit the error mutation', (done) => {
const state = createState();
testAction(
......@@ -152,7 +152,7 @@ describe('projects actions', () => {
});
describe('requestProjects', () => {
it('should commit the request mutation', done => {
it('should commit the request mutation', (done) => {
const state = createState();
testAction(actions.requestProjects, {}, state, [{ type: types.REQUEST_PROJECTS }], [], done);
......@@ -160,7 +160,7 @@ describe('projects actions', () => {
});
describe('setProjectsEndpoint', () => {
it('should commit the correct mutuation', done => {
it('should commit the correct mutuation', (done) => {
const state = createState();
testAction(
......
......@@ -59,7 +59,7 @@ describe('Unscanned projects getters', () => {
expect(result).toEqual(
groupByDateRanges({
ranges: UNSCANNED_PROJECTS_DATE_RANGES,
dateFn: x => x.securityTestsLastSuccessfulRun,
dateFn: (x) => x.securityTestsLastSuccessfulRun,
projects,
}),
);
......
......@@ -43,7 +43,7 @@ describe('Project scanning store utils', () => {
const groups = groupByDateRanges({
ranges,
dateFn: x => x.lastUpdated,
dateFn: (x) => x.lastUpdated,
projects,
});
......@@ -67,7 +67,7 @@ describe('Project scanning store utils', () => {
const groups = groupByDateRanges({
ranges,
dateFn: x => x.lastUpdated,
dateFn: (x) => x.lastUpdated,
projects,
});
......@@ -92,7 +92,7 @@ describe('Project scanning store utils', () => {
const groups = groupByDateRanges({
ranges,
dateFn: x => x.lastUpdated,
dateFn: (x) => x.lastUpdated,
projects: projectsWithoutTimeStamp,
});
......
......@@ -57,7 +57,7 @@ describe('vulnerabilities count actions', () => {
describe('vulnerabilities actions', () => {
const data = mockDataVulnerabilities;
const params = { filters: { severity: ['critical'] } };
const filteredData = mockDataVulnerabilities.filter(vuln => vuln.severity === 'critical');
const filteredData = mockDataVulnerabilities.filter((vuln) => vuln.severity === 'critical');
const pageInfo = {
page: 1,
nextPage: 2,
......
......@@ -2,7 +2,7 @@ import { isSameVulnerability } from 'ee/security_dashboard/store/modules/vulnera
import mockData from './data/mock_data_vulnerabilities';
describe('Vulnerabilities utils', () => {
const clone = serializable => JSON.parse(JSON.stringify(serializable));
const clone = (serializable) => JSON.parse(JSON.stringify(serializable));
const vuln = clone(mockData[0]);
const vulnWithNewLocation = { ...clone(vuln), location: { foo: 1 } };
const vulnWithNewIdentifier = { ...clone(vuln), identifiers: [{ foo: 1 }] };
......
......@@ -11,7 +11,7 @@ export const createProjectWithZeroVulnerabilities = () => ({
// in the future this will be replaced by generated fixtures
// see https://gitlab.com/gitlab-org/gitlab/merge_requests/20892#note_253602093
export const createProjectWithVulnerabilities = count => (...severityLevels) => ({
export const createProjectWithVulnerabilities = (count) => (...severityLevels) => ({
...createProjectWithZeroVulnerabilities(),
...(severityLevels
? severityLevels.reduce(
......
......@@ -12,7 +12,7 @@ describe('Vulnerable Projects store utils', () => {
describe('addMostSevereVulnerabilityInformation', () => {
it.each(['critical', 'medium', 'high'])(
'takes a project and adds a property containing information about its most severe vulnerability',
severityLevel => {
(severityLevel) => {
const mockProject = createProjectWithOneVulnerability(severityLevel);
const mockSeverityLevelsInOrder = [severityLevel, 'foo', 'bar'];
......@@ -38,7 +38,7 @@ describe('Vulnerable Projects store utils', () => {
it.each(['high', 'medium', 'low'])(
'returns false if the given project does not contain at least one vulnerability of the given severity level',
severityLevel => {
(severityLevel) => {
const project = createProjectWithOneVulnerability(severityLevel);
expect(hasVulnerabilityWithSeverityLevel(project)('critical')).toBe(false);
......@@ -107,7 +107,7 @@ describe('Vulnerable Projects store utils', () => {
const mockGroup = { severityLevels: severityLevelsForGroup };
expect(projectsForSeverityGroup(Object.values(mockProjects), mockGroup)).toStrictEqual(
expectedProjectsInGroup.map(project => mockProjects[project]),
expectedProjectsInGroup.map((project) => mockProjects[project]),
);
},
);
......
......@@ -144,7 +144,7 @@ describe('IterationSelect', () => {
expect(
wrapper
.findAll(GlDropdownItem)
.filter(w => w.text() === title)
.filter((w) => w.text() === title)
.at(0)
.text(),
).toBe(title);
......@@ -154,7 +154,7 @@ describe('IterationSelect', () => {
expect(
wrapper
.findAll(GlDropdownItem)
.filter(w => w.props('isChecked') === true)
.filter((w) => w.props('isChecked') === true)
.at(0)
.text(),
).toBe(title);
......@@ -187,7 +187,7 @@ describe('IterationSelect', () => {
wrapper
.findAll(GlDropdownItem)
.filter(w => w.text() === 'title')
.filter((w) => w.text() === 'title')
.at(0)
.vm.$emit('click');
......@@ -210,7 +210,7 @@ describe('IterationSelect', () => {
wrapper
.findAll(GlDropdownItem)
.filter(w => w.text() === 'title')
.filter((w) => w.text() === 'title')
.at(0)
.vm.$emit('click');
});
......@@ -229,7 +229,7 @@ describe('IterationSelect', () => {
});
describe('when error', () => {
const bootstrapComponent = mutationResp => {
const bootstrapComponent = (mutationResp) => {
createComponent({
data: {
iterations: [
......@@ -252,7 +252,7 @@ describe('IterationSelect', () => {
wrapper
.findAll(GlDropdownItem)
.filter(w => w.text() === 'title')
.filter((w) => w.text() === 'title')
.at(0)
.vm.$emit('click');
});
......
......@@ -7,7 +7,7 @@ describe('SidebarStatus', () => {
let wrapper;
let handleDropdownClickMock;
const createMediator = states => {
const createMediator = (states) => {
mediator = {
store: {
isFetching: {
......
......@@ -98,7 +98,7 @@ describe('Status Page actions', () => {
});
describe('receiveStatusPageSettingsUpdateSuccess', () => {
it('should handle successful settings update', done => {
it('should handle successful settings update', (done) => {
testAction(actions.receiveStatusPageSettingsUpdateSuccess, null, null, [], [], () => {
expect(refreshCurrentPage).toHaveBeenCalledTimes(1);
done();
......@@ -108,7 +108,7 @@ describe('Status Page actions', () => {
describe('receiveStatusPageSettingsUpdateError', () => {
const error = { response: { data: { message: 'Update error' } } };
it('should handle error update', done => {
it('should handle error update', (done) => {
testAction(actions.receiveStatusPageSettingsUpdateError, error, null, [], [], () => {
expect(createFlash).toHaveBeenCalledWith(
`There was an error saving your changes. ${error.response.data.message}`,
......
......@@ -16,7 +16,7 @@ function mountComponent({ rootStorageStatistics, limit }) {
function findStorageTypeUsagesSerialized() {
return wrapper
.findAll('[data-testid="storage-type-usage"]')
.wrappers.map(wp => wp.element.style.flex);
.wrappers.map((wp) => wp.element.style.flex);
}
describe('Storage Counter usage graph component', () => {
......
......@@ -26,7 +26,7 @@ describe('Usage Statistics component', () => {
};
const getStatisticsCards = () => wrapper.findAll(UsageStatisticsCard);
const getStatisticsCard = testId => wrapper.find(`[data-testid="${testId}"]`);
const getStatisticsCard = (testId) => wrapper.find(`[data-testid="${testId}"]`);
describe('with purchaseStorageUrl passed', () => {
beforeEach(() => {
......
......@@ -86,5 +86,5 @@ export const withRootStorageStatistics = {
};
export const mockGetStorageCounterGraphQLResponse = {
nodes: projects.map(node => node),
nodes: projects.map((node) => node),
};
......@@ -74,7 +74,7 @@ describe('parseProjects', () => {
totalRepositorySizeExcess: 5000,
});
projects.forEach(project => {
projects.forEach((project) => {
expect(project).toMatchObject({
totalCalculatedUsedStorage: expect.any(Number),
totalCalculatedStorageLimit: expect.any(Number),
......
......@@ -4,7 +4,7 @@ import Component from 'ee/registrations/components/progress_bar.vue';
describe('Progress Bar', () => {
let wrapper;
const createComponent = propsData => {
const createComponent = (propsData) => {
wrapper = shallowMount(Component, {
propsData,
});
......
......@@ -20,7 +20,7 @@ describe('Step', () => {
nextStepButtonText: 'next',
};
const createComponent = propsData => {
const createComponent = (propsData) => {
wrapper = shallowMount(Component, {
propsData: { ...initialProps, ...propsData },
localVue,
......
......@@ -24,7 +24,7 @@ describe('Subscription Details', () => {
];
let initialNamespaceId = null;
const initialData = namespaceId => {
const initialData = (namespaceId) => {
return {
planData: JSON.stringify(planData),
groupData: JSON.stringify(groupData),
......
......@@ -95,7 +95,7 @@ describe('TestCaseCreateRoot', () => {
projectPath: 'gitlab-org/gitlab-test',
title: issuableTitle,
description: issuableDescription,
labelIds: selectedLabels.map(label => label.id),
labelIds: selectedLabels.map((label) => label.id),
},
},
}),
......
......@@ -75,7 +75,7 @@ describe('ThreatMonitoringApp component', () => {
describe.each([-1, NaN, Math.PI])(
'given an invalid default environment id of %p',
invalidEnvironmentId => {
(invalidEnvironmentId) => {
beforeEach(() => {
factory({
propsData: {
......
......@@ -14,7 +14,7 @@ describe('EnvironmentPicker component', () => {
let store;
let wrapper;
const factory = state => {
const factory = (state) => {
store = createStore();
Object.assign(store.state.threatMonitoring, state);
......
......@@ -8,7 +8,7 @@ import { useFakeDate } from 'helpers/fake_date';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { mockPoliciesResponse } from '../mock_data';
const mockData = mockPoliciesResponse.map(policy => convertObjectPropsToCamelCase(policy));
const mockData = mockPoliciesResponse.map((policy) => convertObjectPropsToCamelCase(policy));
describe('NetworkPolicyList component', () => {
useFakeDate();
......
......@@ -20,7 +20,7 @@ describe('buildRule', () => {
describe.each([RuleTypeEndpoint, RuleTypeEntity, RuleTypeCIDR, RuleTypeFQDN])(
'buildRule $ruleType',
ruleType => {
(ruleType) => {
it('builds correct instance', () => {
const rule = buildRule(ruleType);
expect(rule).toMatchObject({
......
......@@ -129,7 +129,7 @@ describe('PolicyRuleBuilder component', () => {
it('updates entity types', async () => {
const el = findRuleEntity();
el.findAll('button')
.filter(e => e.text() === 'host')
.filter((e) => e.text() === 'host')
.trigger('click');
await wrapper.vm.$nextTick();
expect(rule.entities).toEqual(['host']);
......
......@@ -31,7 +31,7 @@ describe('PolicyRuleEntity component', () => {
it('selects all items', () => {
const dropdown = findDropdown();
const selectedItems = dropdown.findAll(GlDropdownItem).filter(el => el.props('isChecked'));
const selectedItems = dropdown.findAll(GlDropdownItem).filter((el) => el.props('isChecked'));
expect(selectedItems.length).toEqual(Object.keys(EntityTypes).length);
expect(dropdown.props('text')).toEqual('All selected');
});
......@@ -40,8 +40,8 @@ describe('PolicyRuleEntity component', () => {
describe('when all entities are selected', () => {
beforeEach(() => {
const value = Object.keys(EntityTypes)
.map(key => EntityTypes[key])
.filter(entity => entity !== EntityTypes.ALL && entity !== EntityTypes.HOST);
.map((key) => EntityTypes[key])
.filter((entity) => entity !== EntityTypes.ALL && entity !== EntityTypes.HOST);
factory({ value });
});
......@@ -49,7 +49,7 @@ describe('PolicyRuleEntity component', () => {
const dropdown = findDropdown();
dropdown
.findAll(GlDropdownItem)
.filter(el => el.text() === EntityTypes.HOST)
.filter((el) => el.text() === EntityTypes.HOST)
.at(0)
.vm.$emit('click');
......
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