Commit 39bb37cc authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 51 of 73

Part of our prettier migration; changing the arrow-parens style.
parent cdc1a4a8
......@@ -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
## modest-kilby
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/store/modules/threat_monitoring/actions_spec.js
ee/spec/frontend/threat_monitoring/store/modules/threat_monitoring_statistics/getters_spec.js
ee/spec/frontend/threat_monitoring/store/modules/threat_monitoring_statistics/mutations_spec.js
ee/spec/frontend/trial_registrations/username_suggester_spec.js
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_auth_spec.js
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_footer_spec.js
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_list_spec.js
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_spec.js
ee/spec/frontend/vue_mr_widget/components/blocking_merge_requests/blocking_merge_requests_report_spec.js
ee/spec/frontend/vue_mr_widget/components/merge_train_helper_text_spec.js
ee/spec/frontend/vue_mr_widget/components/merge_train_position_indicator_spec.js
ee/spec/frontend/vue_mr_widget/components/mr_widget_pipeline_container_spec.js
ee/spec/frontend/vue_mr_widget/ee_mr_widget_options_spec.js
ee/spec/frontend/vue_mr_widget/stores/mr_widget_store_spec.js
ee/spec/frontend/vue_shared/components/accordion/accordion_item_spec.js
ee/spec/frontend/vue_shared/components/deployment_instance/deployment_instance_spec.js
ee/spec/frontend/vue_shared/components/notes/system_note_spec.js
ee/spec/frontend/vue_shared/components/security_reports/severity_badge_spec.js
ee/spec/frontend/vue_shared/components/sidebar/epics_select/base_spec.js
ee/spec/frontend/vue_shared/components/sidebar/epics_select/dropdown_contents_spec.js
ee/spec/frontend/vue_shared/components/sidebar/epics_select/store/actions_spec.js
ee/spec/frontend/vue_shared/components/sidebar/epics_select/store/getters_spec.js
ee/spec/frontend/vue_shared/dashboards/store/actions_spec.js
ee/spec/frontend/vue_shared/dashboards/store/mutations_spec.js
ee/spec/frontend/vue_shared/discover/card_security_discover_app_spec.js
ee/spec/frontend/vue_shared/license_compliance/components/add_license_form_dropdown_spec.js
ee/spec/frontend/vue_shared/license_compliance/components/admin_license_management_row_spec.js
ee/spec/frontend/vue_shared/license_compliance/components/delete_confirmation_modal_spec.js
ee/spec/frontend/vue_shared/license_compliance/components/license_packages_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
......
......@@ -5,7 +5,7 @@ import StatisticsSummary from 'ee/threat_monitoring/components/statistics_summar
describe('StatisticsSummary component', () => {
let wrapper;
const factory = options => {
const factory = (options) => {
wrapper = shallowMount(StatisticsSummary, {
...options,
});
......
......@@ -12,7 +12,7 @@ describe('ThreatMonitoringFilters component', () => {
let store;
let wrapper;
const factory = state => {
const factory = (state) => {
store = createStore();
Object.assign(store.state.threatMonitoring, state);
......
......@@ -140,7 +140,7 @@ describe('Threat Monitoring actions', () => {
describe('given more than one page of environments', () => {
beforeEach(() => {
const oneEnvironmentPerPage = ({ totalPages }) => config => {
const oneEnvironmentPerPage = ({ totalPages }) => (config) => {
const { page } = config.params;
const response = [httpStatus.OK, { environments: [{ id: page }] }];
if (page < totalPages) {
......
......@@ -9,7 +9,7 @@ describe('threatMonitoringStatistics module getters', () => {
});
describe('hasHistory', () => {
it.each(['nominal', 'anomalous'])('returns true if there is any %s history data', type => {
it.each(['nominal', 'anomalous'])('returns true if there is any %s history data', (type) => {
state.statistics.history[type] = ['foo'];
expect(getters.hasHistory(state)).toBe(true);
});
......
......@@ -5,7 +5,7 @@ import { mockWafStatisticsResponse } from '../../../mock_data';
describe('threatMonitoringStatistics mutations', () => {
let state;
const mutations = mutationsFactory(payload => payload);
const mutations = mutationsFactory((payload) => payload);
beforeEach(() => {
state = {};
});
......
......@@ -134,7 +134,7 @@ describe('UsernameSuggester', () => {
});
});
it('shows a flash message if request fails', done => {
it('shows a flash message if request fails', (done) => {
axiosMock.onGet(usernameEndPoint).replyOnce(500);
expect(suggester.isLoading).toBe(false);
......
......@@ -6,7 +6,7 @@ const TEST_PASSWORD = 'password';
// For some reason, the `Promise.resolve` needs to be deferred
// or the timing doesn't work.
const waitForTick = done => Promise.resolve().then(done).catch(done.fail);
const waitForTick = (done) => Promise.resolve().then(done).catch(done.fail);
describe('Approval auth component', () => {
let wrapper;
......@@ -29,7 +29,7 @@ describe('Approval auth component', () => {
const findErrorMessage = () => wrapper.find('.gl-field-error');
describe('when created', () => {
beforeEach(done => {
beforeEach((done) => {
createComponent();
waitForTick(done);
});
......@@ -54,12 +54,12 @@ describe('Approval auth component', () => {
});
describe('when approve clicked', () => {
beforeEach(done => {
beforeEach((done) => {
createComponent();
waitForTick(done);
});
it('emits the approve event', done => {
it('emits the approve event', (done) => {
findInput().setValue(TEST_PASSWORD);
wrapper.find(GlModal).vm.$emit('ok', { preventDefault: () => null });
waitForTick(done);
......@@ -69,7 +69,7 @@ describe('Approval auth component', () => {
});
describe('when isApproving is true', () => {
beforeEach(done => {
beforeEach((done) => {
createComponent({ isApproving: true });
waitForTick(done);
});
......@@ -82,7 +82,7 @@ describe('Approval auth component', () => {
});
describe('when hasError is true', () => {
beforeEach(done => {
beforeEach((done) => {
createComponent({ hasError: true });
waitForTick(done);
});
......
......@@ -5,7 +5,7 @@ import ApprovalsList from 'ee/vue_merge_request_widget/components/approvals/appr
import stubChildren from 'helpers/stub_children';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue';
const testSuggestedApprovers = () => Array.from({ length: 11 }, (_, i) => i).map(id => ({ id }));
const testSuggestedApprovers = () => Array.from({ length: 11 }, (_, i) => i).map((id) => ({ id }));
const testApprovalRules = () => [{ name: 'Lorem' }, { name: 'Ipsum' }];
describe('EE MRWidget approvals footer', () => {
......@@ -184,7 +184,7 @@ describe('EE MRWidget approvals footer', () => {
expect(button.text()).toBe('View eligible approvers');
});
it('expands when clicked', done => {
it('expands when clicked', (done) => {
expect(wrapper.props('value')).toBe(false);
button.vm.$emit('click');
......
......@@ -3,7 +3,7 @@ import ApprovalsList from 'ee/vue_merge_request_widget/components/approvals/appr
import ApprovedIcon from 'ee/vue_merge_request_widget/components/approvals/approved_icon.vue';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue';
const testApprovers = () => Array.from({ length: 11 }, (_, i) => i).map(id => ({ id }));
const testApprovers = () => Array.from({ length: 11 }, (_, i) => i).map((id) => ({ id }));
const testRuleApproved = () => ({
id: 1,
name: 'Lorem',
......@@ -74,7 +74,7 @@ describe('EE MRWidget approvals list', () => {
const findRows = () => wrapper.findAll('tbody tr');
const findRowElement = (row, name) => row.find(`.js-${name}`);
const findRowIcon = row => row.find(ApprovedIcon);
const findRowIcon = (row) => row.find(ApprovedIcon);
afterEach(() => {
wrapper.destroy();
......@@ -91,10 +91,10 @@ describe('EE MRWidget approvals list', () => {
it('renders a row for each rule', () => {
const expected = testRules();
const rows = findRows();
const names = rows.wrappers.map(row => findRowElement(row, 'name').text());
const names = rows.wrappers.map((row) => findRowElement(row, 'name').text());
expect(rows).toHaveLength(expected.length);
expect(names).toEqual(expected.map(x => x.name));
expect(names).toEqual(expected.map((x) => x.name));
});
it('does not render a code owner subtitle', () => {
......
......@@ -19,10 +19,10 @@ import eventHub from '~/vue_merge_request_widget/event_hub';
const TEST_HELP_PATH = 'help/path';
const TEST_PASSWORD = 'password';
const testApprovedBy = () => [1, 7, 10].map(id => ({ id }));
const testApprovedBy = () => [1, 7, 10].map((id) => ({ id }));
const testApprovals = () => ({
approved: false,
approved_by: testApprovedBy().map(user => ({ user })),
approved_by: testApprovedBy().map((user) => ({ user })),
approval_rules_left: [],
approvals_left: 4,
suggested_approvers: [],
......
......@@ -63,7 +63,7 @@ describe('BlockingMergeRequestsReport', () => {
createComponent();
const reportSectionProps = wrapper.find(ReportSection).props();
expect(reportSectionProps.unresolvedIssues.map(issue => issue.id)).toEqual([2, 1]);
expect(reportSectionProps.unresolvedIssues.map((issue) => issue.id)).toEqual([2, 1]);
});
it('sets status to "ERROR" when there are unmerged blocking MRs', () => {
......@@ -112,7 +112,7 @@ describe('BlockingMergeRequestsReport', () => {
it('does not include merged MRs', () => {
createComponent();
const containsMergedMRs = wrapper.vm.unmergedBlockingMergeRequests.some(
mr => mr.state === 'merged',
(mr) => mr.state === 'merged',
);
expect(containsMergedMRs).toBe(false);
......@@ -121,7 +121,7 @@ describe('BlockingMergeRequestsReport', () => {
it('puts closed MRs first', () => {
createComponent();
const closedIndex = wrapper.vm.unmergedBlockingMergeRequests.findIndex(
mr => mr.state === 'closed',
(mr) => mr.state === 'closed',
);
expect(closedIndex).toBe(0);
......
......@@ -16,7 +16,7 @@ describe('MergeTrainHelperText', () => {
const findDocumentationLink = () => wrapper.find('[data-testid="documentation-link"]');
const findPipelineLink = () => wrapper.find('[data-testid="pipeline-link"]');
const createWrapper = propsData => {
const createWrapper = (propsData) => {
wrapper = shallowMount(MergeTrainHelperText, {
propsData: {
...defaultProps,
......
......@@ -5,7 +5,7 @@ import { trimText } from 'helpers/text_helper';
describe('MergeTrainPositionIndicator', () => {
let wrapper;
const factory = propsData => {
const factory = (propsData) => {
wrapper = shallowMount(MergeTrainPositionIndicator, {
propsData,
});
......
......@@ -86,7 +86,7 @@ describe('MrWidgetPipelineContainer', () => {
return wrapper.vm.$nextTick();
});
it('renders the visual review app link', done => {
it('renders the visual review app link', (done) => {
// the visual review app link component is lazy loaded
// so we need to re-render the component again, as once
// apparently isn't enough.
......@@ -123,7 +123,7 @@ describe('MrWidgetPipelineContainer', () => {
return wrapper.vm.$nextTick();
});
it('does not render the visual review app link', done => {
it('does not render the visual review app link', (done) => {
// the visual review app link component is lazy loaded
// so we need to re-render the component again, as once
// apparently isn't enough.
......
......@@ -78,7 +78,7 @@ describe('MergeRequestStore', () => {
'secret_scanning_comparison_path',
'api_fuzzing_comparison_path',
'coverage_fuzzing_comparison_path',
])('should set %s path', property => {
])('should set %s path', (property) => {
// Ensure something is set in the mock data
expect(property in mockData).toBe(true);
const expectedValue = mockData[property];
......
......@@ -74,7 +74,7 @@ describe('AccordionItem component', () => {
});
describe('scoped slots', () => {
it.each(['default', 'title'])("contains a '%s' slot", slotName => {
it.each(['default', 'title'])("contains a '%s' slot", (slotName) => {
const className = `${slotName}-slot-content`;
factory({ [`${slotName}Slot`]: `<div class='${className}' />` });
......@@ -89,7 +89,7 @@ describe('AccordionItem component', () => {
it.each([true, false])(
'passes the "isExpanded" and "isDisabled" state to the title slot',
state => {
(state) => {
const titleSlot = jest.fn();
factory({ propsData: { disabled: state }, titleSlot });
......
......@@ -28,7 +28,7 @@ describe('Deploy Board Instance', () => {
expect(wrapper.attributes('title')).toEqual('This is a pod');
});
it('should render a div without tooltip data', done => {
it('should render a div without tooltip data', (done) => {
wrapper = createComponent({
status: 'deploying',
tooltipText: '',
......@@ -58,7 +58,7 @@ describe('Deploy Board Instance', () => {
wrapper.destroy();
});
it('should render a div with canary class when stable prop is provided as false', done => {
it('should render a div with canary class when stable prop is provided as false', (done) => {
wrapper = createComponent({
stable: false,
});
......@@ -75,7 +75,7 @@ describe('Deploy Board Instance', () => {
wrapper.destroy();
});
it('should not be a link without a logsPath prop', done => {
it('should not be a link without a logsPath prop', (done) => {
wrapper = createComponent({
stable: false,
logsPath: '',
......
......@@ -76,7 +76,7 @@ describe('system note component', () => {
expect(findDescriptionVersion().exists()).toBe(false);
});
it('click on button to toggle description diff displays description diff with delete icon button', done => {
it('click on button to toggle description diff displays description diff with delete icon button', (done) => {
mockFetchDiff();
expect(findDescriptionVersion().exists()).toBe(false);
......
......@@ -29,7 +29,7 @@ describe('Severity Badge', () => {
const findIcon = () => wrapper.find(GlIcon);
const findTooltip = () => getBinding(findIcon().element, 'tooltip').value;
describe.each(SEVERITY_LEVELS)('given a valid severity "%s"', severity => {
describe.each(SEVERITY_LEVELS)('given a valid severity "%s"', (severity) => {
beforeEach(() => {
createWrapper({ severity });
});
......@@ -54,7 +54,7 @@ describe('Severity Badge', () => {
});
});
describe.each(['foo', '', ' '])('given an invalid severity "%s"', invalidSeverity => {
describe.each(['foo', '', ' '])('given an invalid severity "%s"', (invalidSeverity) => {
beforeEach(() => {
createWrapper({ severity: invalidSeverity });
});
......
......@@ -224,7 +224,7 @@ describe('EpicsSelect', () => {
expect(wrapperStandalone.find(DropdownTitle).exists()).toBe(false);
});
it('should render DropdownValue component when `showDropdown` is false', done => {
it('should render DropdownValue component when `showDropdown` is false', (done) => {
wrapper.vm.showDropdown = false;
wrapper.vm.$nextTick(() => {
......@@ -237,7 +237,7 @@ describe('EpicsSelect', () => {
expect(wrapperStandalone.find(DropdownValue).exists()).toBe(false);
});
it('should render dropdown container element when props `canEdit` & `showDropdown` are true', done => {
it('should render dropdown container element when props `canEdit` & `showDropdown` are true', (done) => {
showDropdown();
wrapper.vm.$nextTick(() => {
......@@ -251,7 +251,7 @@ describe('EpicsSelect', () => {
expect(wrapperStandalone.find('.epic-dropdown-container').exists()).toBe(true);
});
it('should render DropdownButton component when props `canEdit` & `showDropdown` are true', done => {
it('should render DropdownButton component when props `canEdit` & `showDropdown` are true', (done) => {
showDropdown();
wrapper.vm.$nextTick(() => {
......@@ -260,7 +260,7 @@ describe('EpicsSelect', () => {
});
});
it('should render dropdown menu container element when props `canEdit` & `showDropdown` are true', done => {
it('should render dropdown menu container element when props `canEdit` & `showDropdown` are true', (done) => {
showDropdown();
wrapper.vm.$nextTick(() => {
......@@ -269,7 +269,7 @@ describe('EpicsSelect', () => {
});
});
it('should render DropdownHeader component when props `canEdit` & `showDropdown` are true', done => {
it('should render DropdownHeader component when props `canEdit` & `showDropdown` are true', (done) => {
showDropdown();
wrapper.vm.$nextTick(() => {
......@@ -286,7 +286,7 @@ describe('EpicsSelect', () => {
});
});
it('should render DropdownSearchInput component when props `canEdit` & `showDropdown` are true', done => {
it('should render DropdownSearchInput component when props `canEdit` & `showDropdown` are true', (done) => {
showDropdown();
wrapper.vm.$nextTick(() => {
......@@ -295,7 +295,7 @@ describe('EpicsSelect', () => {
});
});
it('should render DropdownContents component when props `canEdit` & `showDropdown` are true and `isEpicsLoading` is false', done => {
it('should render DropdownContents component when props `canEdit` & `showDropdown` are true and `isEpicsLoading` is false', (done) => {
showDropdown();
store.dispatch('receiveEpicsSuccess', []);
......@@ -305,7 +305,7 @@ describe('EpicsSelect', () => {
});
});
it('should render GlLoadingIcon component when props `canEdit` & `showDropdown` and `isEpicsLoading` are true', done => {
it('should render GlLoadingIcon component when props `canEdit` & `showDropdown` and `isEpicsLoading` are true', (done) => {
showDropdown();
store.dispatch('requestEpics');
......
......@@ -6,7 +6,7 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { mockEpic1, mockEpic2, mockEpics, noneEpic } from '../mock_data';
const epics = mockEpics.map(epic => convertObjectPropsToCamelCase(epic));
const epics = mockEpics.map((epic) => convertObjectPropsToCamelCase(epic));
describe('EpicsSelect', () => {
describe('DropdownContents', () => {
......@@ -27,7 +27,7 @@ describe('EpicsSelect', () => {
describe('computed', () => {
describe('isNoEpic', () => {
it('should return true when `selectedEpic` is of type `No Epic`', done => {
it('should return true when `selectedEpic` is of type `No Epic`', (done) => {
wrapper.setProps({
selectedEpic: noneEpic,
});
......
......@@ -15,7 +15,7 @@ describe('EpicsSelect', () => {
describe('store', () => {
describe('actions', () => {
let state;
const normalizedEpics = mockEpics.map(rawEpic =>
const normalizedEpics = mockEpics.map((rawEpic) =>
convertObjectPropsToCamelCase(Object.assign(rawEpic, { url: rawEpic.web_edit_url }), {
dropKeys: ['web_edit_url'],
}),
......@@ -26,7 +26,7 @@ describe('EpicsSelect', () => {
});
describe('setInitialData', () => {
it('should set initial data on state', done => {
it('should set initial data on state', (done) => {
const mockInitialConfig = {
groupId: mockEpic1.group_id,
issueId: mockIssue.id,
......@@ -46,7 +46,7 @@ describe('EpicsSelect', () => {
});
describe('setIssueId', () => {
it('should set `issueId` on state', done => {
it('should set `issueId` on state', (done) => {
const issueId = mockIssue.id;
testAction(
......@@ -61,7 +61,7 @@ describe('EpicsSelect', () => {
});
describe('setSearchQuery', () => {
it('should set `searchQuery` param on state', done => {
it('should set `searchQuery` param on state', (done) => {
const searchQuery = 'foo';
testAction(
......@@ -76,7 +76,7 @@ describe('EpicsSelect', () => {
});
describe('setSelectedEpic', () => {
it('should set `selectedEpic` param on state', done => {
it('should set `selectedEpic` param on state', (done) => {
testAction(
actions.setSelectedEpic,
mockEpic1,
......@@ -89,7 +89,7 @@ describe('EpicsSelect', () => {
});
describe('setSelectedEpicIssueId', () => {
it('should set `selectedEpicIssueId` param on state', done => {
it('should set `selectedEpicIssueId` param on state', (done) => {
testAction(
actions.setSelectedEpicIssueId,
mockIssue.epic_issue_id,
......@@ -102,13 +102,13 @@ describe('EpicsSelect', () => {
});
describe('requestEpics', () => {
it('should set `state.epicsFetchInProgress` to true', done => {
it('should set `state.epicsFetchInProgress` to true', (done) => {
testAction(actions.requestEpics, {}, state, [{ type: types.REQUEST_EPICS }], [], done);
});
});
describe('receiveEpicsSuccess', () => {
it('should set processed Epics array to `state.epics`', done => {
it('should set processed Epics array to `state.epics`', (done) => {
state.groupId = mockEpic1.group_id;
testAction(
......@@ -137,7 +137,7 @@ describe('EpicsSelect', () => {
);
});
it('should set `state.epicsFetchInProgress` to false', done => {
it('should set `state.epicsFetchInProgress` to false', (done) => {
testAction(
actions.receiveEpicsFailure,
{},
......@@ -154,7 +154,7 @@ describe('EpicsSelect', () => {
state.groupId = mockEpic1.group_id;
});
it('should dispatch `requestEpics` & call `Api.groupEpics` and then dispatch `receiveEpicsSuccess` on request success', done => {
it('should dispatch `requestEpics` & call `Api.groupEpics` and then dispatch `receiveEpicsSuccess` on request success', (done) => {
jest.spyOn(Api, 'groupEpics').mockReturnValue(
Promise.resolve({
data: mockEpics,
......@@ -179,7 +179,7 @@ describe('EpicsSelect', () => {
);
});
it('should dispatch `requestEpics` & call `Api.groupEpics` and then dispatch `receiveEpicsFailure` on request failure', done => {
it('should dispatch `requestEpics` & call `Api.groupEpics` and then dispatch `receiveEpicsFailure` on request failure', (done) => {
jest.spyOn(Api, 'groupEpics').mockReturnValue(Promise.reject());
testAction(
......@@ -224,7 +224,7 @@ describe('EpicsSelect', () => {
});
describe('requestIssueUpdate', () => {
it('should set `state.epicSelectInProgress` to true', done => {
it('should set `state.epicSelectInProgress` to true', (done) => {
testAction(
actions.requestIssueUpdate,
{},
......@@ -237,7 +237,7 @@ describe('EpicsSelect', () => {
});
describe('receiveIssueUpdateSuccess', () => {
it('should set updated selectedEpic with passed Epic instance to state when payload has matching Epic and Issue IDs', done => {
it('should set updated selectedEpic with passed Epic instance to state when payload has matching Epic and Issue IDs', (done) => {
state.issueId = mockIssue.id;
testAction(
......@@ -261,7 +261,7 @@ describe('EpicsSelect', () => {
);
});
it('should update the epic associated with the issue in BoardsStore if the update happened in Boards', done => {
it('should update the epic associated with the issue in BoardsStore if the update happened in Boards', (done) => {
boardsStore.detail.issue.updateEpic = jest.fn(() => {});
state.issueId = mockIssue.id;
const mockApiData = { ...mockAssignRemoveRes };
......@@ -290,7 +290,7 @@ describe('EpicsSelect', () => {
expect(boardsStore.detail.issue.updateEpic).toHaveBeenCalled();
});
it('should set updated selectedEpic with noneEpic to state when payload has matching Epic and Issue IDs and isRemoval param is true', done => {
it('should set updated selectedEpic with noneEpic to state when payload has matching Epic and Issue IDs and isRemoval param is true', (done) => {
state.issueId = mockIssue.id;
testAction(
......@@ -315,7 +315,7 @@ describe('EpicsSelect', () => {
);
});
it('should not do any mutation to the state whe payload does not have matching Epic and Issue IDs', done => {
it('should not do any mutation to the state whe payload does not have matching Epic and Issue IDs', (done) => {
testAction(
actions.receiveIssueUpdateSuccess,
{
......@@ -349,7 +349,7 @@ describe('EpicsSelect', () => {
);
});
it('should set `state.epicSelectInProgress` to false', done => {
it('should set `state.epicSelectInProgress` to false', (done) => {
testAction(
actions.receiveIssueUpdateFailure,
{},
......@@ -366,7 +366,7 @@ describe('EpicsSelect', () => {
state.issueId = mockIssue.id;
});
it('should dispatch `requestIssueUpdate` & call `Api.addEpicIssue` and then dispatch `receiveIssueUpdateSuccess` on request success', done => {
it('should dispatch `requestIssueUpdate` & call `Api.addEpicIssue` and then dispatch `receiveIssueUpdateSuccess` on request success', (done) => {
jest.spyOn(Api, 'addEpicIssue').mockReturnValue(
Promise.resolve({
data: mockAssignRemoveRes,
......@@ -391,7 +391,7 @@ describe('EpicsSelect', () => {
);
});
it('should dispatch `requestIssueUpdate` & call `Api.addEpicIssue` and then dispatch `receiveIssueUpdateFailure` on request failure', done => {
it('should dispatch `requestIssueUpdate` & call `Api.addEpicIssue` and then dispatch `receiveIssueUpdateFailure` on request failure', (done) => {
jest.spyOn(Api, 'addEpicIssue').mockReturnValue(Promise.reject());
testAction(
......@@ -440,7 +440,7 @@ describe('EpicsSelect', () => {
state.selectedEpicIssueId = mockIssue.epic_issue_id;
});
it('should dispatch `requestIssueUpdate` & call `Api.removeEpicIssue` and then dispatch `receiveIssueUpdateSuccess` on request success', done => {
it('should dispatch `requestIssueUpdate` & call `Api.removeEpicIssue` and then dispatch `receiveIssueUpdateSuccess` on request success', (done) => {
jest.spyOn(Api, 'removeEpicIssue').mockReturnValue(
Promise.resolve({
data: mockAssignRemoveRes,
......@@ -465,7 +465,7 @@ describe('EpicsSelect', () => {
);
});
it('should dispatch `requestIssueUpdate` & call `Api.removeEpicIssue` and then dispatch `receiveIssueUpdateFailure` on request failure', done => {
it('should dispatch `requestIssueUpdate` & call `Api.removeEpicIssue` and then dispatch `receiveIssueUpdateFailure` on request failure', (done) => {
jest.spyOn(Api, 'removeEpicIssue').mockReturnValue(Promise.reject());
testAction(
......
......@@ -9,7 +9,7 @@ describe('EpicsSelect', () => {
describe('store', () => {
describe('getters', () => {
let state;
const normalizedEpics = mockEpics.map(rawEpic =>
const normalizedEpics = mockEpics.map((rawEpic) =>
convertObjectPropsToCamelCase(Object.assign(rawEpic, { url: rawEpic.web_edit_url }), {
dropKeys: ['web_edit_url'],
}),
......
......@@ -120,7 +120,7 @@ describe('actions', () => {
const errorMessage =
'This dashboard is available for public projects, and private projects in groups with a Silver plan.';
const selectProjects = count => {
const selectProjects = (count) => {
for (let i = 0; i < count; i += 1) {
store.dispatch('toggleSelectedProject', {
id: i,
......@@ -128,7 +128,7 @@ describe('actions', () => {
});
}
};
const addInvalidProjects = invalid =>
const addInvalidProjects = (invalid) =>
store.dispatch('receiveAddProjectsToDashboardSuccess', {
added: [],
invalid,
......@@ -318,7 +318,7 @@ describe('actions', () => {
const searchQueries = [null, undefined, false, NaN];
return Promise.all(
searchQueries.map(searchQuery => {
searchQueries.map((searchQuery) => {
store.state.searchQuery = searchQuery;
return testAction(
......
......@@ -12,7 +12,7 @@ describe('mutations', () => {
useLocalStorageSpy();
const projects = mockProjectData(3);
const projectIds = projects.map(p => p.id);
const projectIds = projects.map((p) => p.id);
const mockEndpoint = 'https://mock-endpoint';
let localState;
......@@ -135,7 +135,7 @@ describe('mutations', () => {
});
it('orders the projects from localstorage', () => {
jest.spyOn(window.localStorage, 'getItem').mockImplementation(key => {
jest.spyOn(window.localStorage, 'getItem').mockImplementation((key) => {
if (key === projectListEndpoint) {
return '2,0,1';
}
......@@ -149,7 +149,7 @@ describe('mutations', () => {
});
it('places unsorted projects after sorted ones', () => {
jest.spyOn(window.localStorage, 'getItem').mockImplementation(key => {
jest.spyOn(window.localStorage, 'getItem').mockImplementation((key) => {
if (key === projectListEndpoint) {
return '1,2';
}
......
......@@ -5,7 +5,7 @@ import { mockTracking } from 'helpers/tracking_helper';
describe('Card security discover app', () => {
let wrapper;
const createComponent = propsData => {
const createComponent = (propsData) => {
wrapper = shallowMount(CardSecurityDiscoverApp, {
propsData,
});
......
......@@ -46,7 +46,7 @@ describe('AddLicenseFormDropdown', () => {
expect(vm.$el.value).toContain(value);
});
it('shows all defined licenses', async done => {
it('shows all defined licenses', async (done) => {
await createComponent();
const element = $(vm.$el);
......
......@@ -23,8 +23,8 @@ describe('AdminLicenseManagementRow', () => {
vm = mountComponentWithStore(Component, { props, store });
};
const findNthDropdown = num => [...vm.$el.querySelectorAll('.dropdown-item')][num];
const findNthDropdownIcon = num => findNthDropdown(num).querySelector('svg');
const findNthDropdown = (num) => [...vm.$el.querySelectorAll('.dropdown-item')][num];
const findNthDropdownIcon = (num) => findNthDropdown(num).querySelector('svg');
const findLoadingIcon = () => vm.$el.querySelector('.js-loading-icon');
const findDropdownToggle = () => vm.$el.querySelector('.dropdown > button');
const findRemoveButton = () => vm.$el.querySelector('.js-remove-button');
......@@ -54,7 +54,7 @@ describe('AdminLicenseManagementRow', () => {
});
describe('approved license', () => {
beforeEach(done => {
beforeEach((done) => {
vm.license = { ...approvedLicense, approvalStatus: LICENSE_APPROVAL_STATUS.ALLOWED };
Vue.nextTick(done);
});
......@@ -89,7 +89,7 @@ describe('AdminLicenseManagementRow', () => {
});
describe('blacklisted license', () => {
beforeEach(done => {
beforeEach((done) => {
vm.license = { ...approvedLicense, approvalStatus: LICENSE_APPROVAL_STATUS.DENIED };
Vue.nextTick(done);
});
......
......@@ -32,7 +32,7 @@ describe('DeleteConfirmationModal', () => {
});
};
const createComponent = initialState => {
const createComponent = (initialState) => {
store = createStore(initialState);
wrapper = shallowMount(Component, {
......
......@@ -29,7 +29,7 @@ describe('LicensePackages', () => {
expect(vm.remainingPackages).toBe('2 more');
});
it('returns empty string when count of packages does not exceed `displayPackageCount` prop', done => {
it('returns empty string when count of packages does not exceed `displayPackageCount` prop', (done) => {
vm.displayPackageCount = examplePackages.length + 1;
Vue.nextTick()
.then(() => {
......
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