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