Commit 557c22a8 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 32 files - 46 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 7f4e951c
......@@ -1369,40 +1369,6 @@ ee/app/assets/javascripts/vulnerabilities/components/resolution_alert.vue
ee/app/assets/javascripts/vulnerabilities/helpers.js
ee/app/assets/javascripts/vulnerabilities/vulnerabilities_init.js
## keen-napier
ee/spec/frontend/boards/components/assignee_select_spec.js
ee/spec/frontend/boards/components/board_list_header_new_spec.js
ee/spec/frontend/boards/components/board_list_header_spec.js
ee/spec/frontend/boards/components/board_list_selector/board_list_selector_spec.js
ee/spec/frontend/boards/components/board_list_spec.js
ee/spec/frontend/boards/components/board_setting_list_types_spec.js
ee/spec/frontend/boards/components/board_settings_wip_limit_spec.js
ee/spec/frontend/boards/components/epic_lane_spec.js
ee/spec/frontend/boards/components/sidebar/board_sidebar_epic_select_spec.js
ee/spec/frontend/boards/components/sidebar/board_sidebar_time_tracker_spec.js
ee/spec/frontend/boards/components/weight_select_spec.js
ee/spec/frontend/boards/milestone_select_spec.js
ee/spec/frontend/boards/mock_data.js
ee/spec/frontend/boards/stores/actions_spec.js
ee/spec/frontend/boards/stores/boards_store_ee_spec.js
ee/spec/frontend/boards/stores/mutations_spec.js
ee/spec/frontend/burndown_chart/components/burn_charts_spec.js
ee/spec/frontend/codequality_report/store/actions_spec.js
ee/spec/frontend/compliance_dashboard/components/empty_state_spec.js
ee/spec/frontend/compliance_dashboard/components/merge_requests/branch_details_spec.js
ee/spec/frontend/compliance_dashboard/components/merge_requests/grid_spec.js
ee/spec/frontend/compliance_dashboard/components/merge_requests/merge_request_spec.js
ee/spec/frontend/compliance_dashboard/components/merge_requests/status_spec.js
ee/spec/frontend/compliance_dashboard/components/merge_requests/statuses/approval_spec.js
ee/spec/frontend/compliance_dashboard/components/merge_requests/statuses/pipeline_spec.js
ee/spec/frontend/compliance_dashboard/components/shared/grid_column_heading_spec.js
ee/spec/frontend/compliance_dashboard/components/shared/pagination_spec.js
ee/spec/frontend/compliance_dashboard/mock_data.js
ee/spec/frontend/dependencies/components/app_spec.js
ee/spec/frontend/dependencies/components/dependencies_actions_spec.js
ee/spec/frontend/dependencies/components/dependency_license_links_spec.js
ee/spec/frontend/dependencies/components/dependency_list_job_failed_alert_spec.js
## gallant-ride
ee/spec/frontend/diffs/components/diff_line_note_form_spec.js
ee/spec/frontend/environments/canary_ingress_spec.js
......
......@@ -31,7 +31,7 @@ const assignee2 = {
};
describe('Assignee select component', () => {
beforeEach(done => {
beforeEach((done) => {
setFixtures('<div class="test-container"></div>');
boardsStore.create();
......@@ -55,7 +55,7 @@ describe('Assignee select component', () => {
});
describe('canEdit', () => {
it('hides Edit button', done => {
it('hides Edit button', (done) => {
vm.canEdit = false;
Vue.nextTick(() => {
expect(vm.$el.querySelector('.edit-link')).toBeFalsy();
......@@ -63,7 +63,7 @@ describe('Assignee select component', () => {
});
});
it('shows Edit button if true', done => {
it('shows Edit button if true', (done) => {
vm.canEdit = true;
Vue.nextTick(() => {
expect(vm.$el.querySelector('.edit-link')).toBeTruthy();
......@@ -77,7 +77,7 @@ describe('Assignee select component', () => {
expect(selectedText()).toContain('Any assignee');
});
it('shows selected assignee', done => {
it('shows selected assignee', (done) => {
vm.selected = assignee;
Vue.nextTick(() => {
expect(selectedText()).toContain('first assignee');
......@@ -97,7 +97,7 @@ describe('Assignee select component', () => {
mock.restore();
});
it('sets assignee', done => {
it('sets assignee', (done) => {
vm.$el.querySelector('.edit-link').click();
jest.runOnlyPendingTimers();
......
......@@ -75,13 +75,13 @@ describe('Board List Header Component', () => {
const hasSettings = [ListType.assignee, ListType.milestone, ListType.label];
const hasNoSettings = [ListType.backlog, ListType.closed];
it.each(hasSettings)('does render for List Type `%s`', listType => {
it.each(hasSettings)('does render for List Type `%s`', (listType) => {
createComponent({ listType });
expect(findSettingsButton().exists()).toBe(true);
});
it.each(hasNoSettings)('does not render for List Type `%s`', listType => {
it.each(hasNoSettings)('does not render for List Type `%s`', (listType) => {
createComponent({ listType });
expect(findSettingsButton().exists()).toBe(false);
......@@ -90,7 +90,7 @@ describe('Board List Header Component', () => {
it('has a test for each list type', () => {
createComponent();
Object.values(ListType).forEach(value => {
Object.values(ListType).forEach((value) => {
expect([...hasSettings, ...hasNoSettings]).toContain(value);
});
});
......
......@@ -84,20 +84,20 @@ describe('Board List Header Component', () => {
const hasSettings = [ListType.assignee, ListType.milestone, ListType.label];
const hasNoSettings = [ListType.backlog, ListType.closed];
it.each(hasSettings)('does render for List Type `%s`', listType => {
it.each(hasSettings)('does render for List Type `%s`', (listType) => {
createComponent({ listType });
expect(findSettingsButton().exists()).toBe(true);
});
it.each(hasNoSettings)('does not render for List Type `%s`', listType => {
it.each(hasNoSettings)('does not render for List Type `%s`', (listType) => {
createComponent({ listType });
expect(findSettingsButton().exists()).toBe(false);
});
it('has a test for each list type', () => {
Object.values(ListType).forEach(value => {
Object.values(ListType).forEach((value) => {
expect([...hasSettings, ...hasNoSettings]).toContain(value);
});
});
......
......@@ -51,7 +51,7 @@ describe('BoardListSelector', () => {
describe('methods', () => {
describe('loadList', () => {
it('calls axios.get and sets response to store.state.assignees', done => {
it('calls axios.get and sets response to store.state.assignees', (done) => {
mock.onGet(dummyEndpoint).reply(200, mockAssigneesList);
boardsStore.state.assignees = [];
......@@ -64,7 +64,7 @@ describe('BoardListSelector', () => {
.catch(done.fail);
});
it('does not call axios.get when store.state.assignees is not empty', done => {
it('does not call axios.get when store.state.assignees is not empty', (done) => {
jest.spyOn(axios, 'get').mockReturnValue(Promise.resolve());
boardsStore.state.assignees = mockAssigneesList;
......@@ -76,7 +76,7 @@ describe('BoardListSelector', () => {
.catch(done.fail);
});
it('calls axios.get and shows Flash error when request fails', done => {
it('calls axios.get and shows Flash error when request fails', (done) => {
mock.onGet(dummyEndpoint).replyOnce(500, {});
boardsStore.state.assignees = [];
......
......@@ -4,7 +4,7 @@ describe('BoardList Component', () => {
let mock;
let component;
beforeEach(done => {
beforeEach((done) => {
const listIssueProps = {
project: {
path: '/test',
......
......@@ -11,7 +11,7 @@ describe('BoardSettingsListType', () => {
},
assignee: { webUrl: 'https://gitlab.com/root', name: 'root', username: 'root' },
};
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(BoardSettingsListTypes, {
propsData: { ...props, activeList },
});
......
......@@ -62,7 +62,7 @@ describe('BoardSettingsWipLimit', () => {
});
};
const triggerBlur = type => {
const triggerBlur = (type) => {
if (type === 'blur') {
findInput().vm.$emit('blur');
}
......
......@@ -12,7 +12,7 @@ localVue.use(Vuex);
describe('EpicLane', () => {
let wrapper;
const findByTestId = testId => wrapper.find(`[data-testid="${testId}"]`);
const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`);
const updateBoardEpicUserPreferencesSpy = jest.fn();
......
......@@ -8,7 +8,7 @@ const TEST_EPIC_ID = 8;
const TEST_EPIC = { id: 'gid://gitlab/Epic/1', title: 'Test epic' };
const TEST_ISSUE = { id: 'gid://gitlab/Issue/1', iid: 9, epic: null, referencePath: 'h/b#2' };
jest.mock('~/lib/utils/common_utils', () => ({ debounceByAnimationFrame: callback => callback }));
jest.mock('~/lib/utils/common_utils', () => ({ debounceByAnimationFrame: (callback) => callback }));
describe('ee/boards/components/sidebar/board_sidebar_epic_select.vue', () => {
let wrapper;
......
......@@ -15,7 +15,7 @@ describe('BoardSidebarTimeTracker', () => {
let wrapper;
let store;
const createComponent = options => {
const createComponent = (options) => {
wrapper = shallowMount(BoardSidebarTimeTracker, {
store,
...options,
......@@ -42,7 +42,7 @@ describe('BoardSidebarTimeTracker', () => {
it.each([[true], [false]])(
'renders IssuableTimeTracker with correct spent and estimated time (timeTrackingLimitToHours=%s)',
timeTrackingLimitToHours => {
(timeTrackingLimitToHours) => {
createComponent({ provide: { timeTrackingLimitToHours } });
expect(wrapper.find(IssuableTimeTracker).props()).toEqual({
......
......@@ -8,7 +8,7 @@ describe('WeightSelect', () => {
const editButton = () => wrapper.find(GlButton);
const valueContainer = () => wrapper.find('.value');
const weightDropdown = () => wrapper.find(GlDropdown);
const getWeightItemAtIndex = index => weightDropdown().findAll(GlDropdownItem).at(index);
const getWeightItemAtIndex = (index) => weightDropdown().findAll(GlDropdownItem).at(index);
const defaultProps = {
weights: ['Any', 'None', 0, 1, 2, 3],
board: {
......
......@@ -33,7 +33,7 @@ const milestone2 = {
};
describe('Milestone select component', () => {
beforeEach(done => {
beforeEach((done) => {
setFixtures('<div class="test-container"></div>');
// eslint-disable-next-line no-new
......@@ -53,7 +53,7 @@ describe('Milestone select component', () => {
});
describe('canEdit', () => {
it('hides Edit button', done => {
it('hides Edit button', (done) => {
vm.canEdit = false;
Vue.nextTick(() => {
expect(vm.$el.querySelector('.edit-link')).toBeFalsy();
......@@ -61,7 +61,7 @@ describe('Milestone select component', () => {
});
});
it('shows Edit button if true', done => {
it('shows Edit button if true', (done) => {
vm.canEdit = true;
Vue.nextTick(() => {
expect(vm.$el.querySelector('.edit-link')).toBeTruthy();
......@@ -75,7 +75,7 @@ describe('Milestone select component', () => {
expect(selectedText()).toContain('Any milestone');
});
it('shows No milestone', done => {
it('shows No milestone', (done) => {
vm.board.milestone_id = 0;
Vue.nextTick(() => {
expect(selectedText()).toContain('No milestone');
......@@ -83,7 +83,7 @@ describe('Milestone select component', () => {
});
});
it('shows selected milestone title', done => {
it('shows selected milestone title', (done) => {
vm.board.milestone_id = 20;
vm.board.milestone = {
id: 20,
......@@ -100,7 +100,7 @@ describe('Milestone select component', () => {
jest.spyOn(Api, 'projectMilestones').mockResolvedValue({ data: [milestone, milestone2] });
});
it('sets Any milestone', async done => {
it('sets Any milestone', async (done) => {
vm.board.milestone_id = 0;
vm.$el.querySelector('.edit-link').click();
......@@ -118,7 +118,7 @@ describe('Milestone select component', () => {
});
});
it('sets No milestone', done => {
it('sets No milestone', (done) => {
vm.$el.querySelector('.edit-link').click();
jest.runOnlyPendingTimers();
......@@ -134,7 +134,7 @@ describe('Milestone select component', () => {
});
});
it('sets milestone', done => {
it('sets milestone', (done) => {
vm.$el.querySelector('.edit-link').click();
jest.runOnlyPendingTimers();
......
......@@ -36,7 +36,7 @@ export const mockLists = [
},
];
export const mockListsWithModel = mockLists.map(listMock =>
export const mockListsWithModel = mockLists.map((listMock) =>
Vue.observable(new List({ ...listMock, doNotFetchIssues: true })),
);
......
......@@ -12,7 +12,7 @@ import * as commonUtils from '~/lib/utils/common_utils';
import { mergeUrlParams, removeParams } from '~/lib/utils/url_utility';
import { mockLists, mockIssue, mockIssue2, mockEpic, rawIssue } from '../mock_data';
const expectNotImplemented = action => {
const expectNotImplemented = (action) => {
it('is not implemented', () => {
expect(action).toThrow(new Error('Not implemented!'));
});
......@@ -101,7 +101,7 @@ describe('setFilters', () => {
});
describe('performSearch', () => {
it('should dispatch setFilters action', done => {
it('should dispatch setFilters action', (done) => {
testAction(actions.performSearch, {}, {}, [], [{ type: 'setFilters', payload: {} }], done);
});
......@@ -156,7 +156,7 @@ describe('fetchEpicsSwimlanes', () => {
},
};
it('should commit mutation RECEIVE_EPICS_SUCCESS on success without lists', done => {
it('should commit mutation RECEIVE_EPICS_SUCCESS on success without lists', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(queryResponse);
testAction(
......@@ -174,7 +174,7 @@ describe('fetchEpicsSwimlanes', () => {
);
});
it('should commit mutation RECEIVE_SWIMLANES_FAILURE on failure', done => {
it('should commit mutation RECEIVE_SWIMLANES_FAILURE on failure', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(Promise.reject());
testAction(
......@@ -187,7 +187,7 @@ describe('fetchEpicsSwimlanes', () => {
);
});
it('should dispatch fetchEpicsSwimlanes when page info hasNextPage', done => {
it('should dispatch fetchEpicsSwimlanes when page info hasNextPage', (done) => {
const queryResponseWithNextPage = {
data: {
group: {
......@@ -240,7 +240,7 @@ describe('updateBoardEpicUserPreferences', () => {
},
});
it('should send mutation', done => {
it('should send mutation', (done) => {
const collapsed = true;
jest.spyOn(gqlClient, 'mutate').mockResolvedValue(queryResponse(collapsed));
......@@ -266,7 +266,7 @@ describe('updateBoardEpicUserPreferences', () => {
});
describe('setShowLabels', () => {
it('should commit mutation SET_SHOW_LABELS', done => {
it('should commit mutation SET_SHOW_LABELS', (done) => {
const state = {
isShowingLabels: true,
};
......@@ -417,7 +417,7 @@ describe('fetchIssuesForEpic', () => {
const formattedIssues = formatListIssues(queryResponse.data.group.board.lists);
it('should commit mutations REQUEST_ISSUES_FOR_EPIC and RECEIVE_ISSUES_FOR_LIST_SUCCESS on success', done => {
it('should commit mutations REQUEST_ISSUES_FOR_EPIC and RECEIVE_ISSUES_FOR_LIST_SUCCESS on success', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(queryResponse);
testAction(
......@@ -433,7 +433,7 @@ describe('fetchIssuesForEpic', () => {
);
});
it('should commit mutations REQUEST_ISSUES_FOR_EPIC and RECEIVE_ISSUES_FOR_LIST_FAILURE on failure', done => {
it('should commit mutations REQUEST_ISSUES_FOR_EPIC and RECEIVE_ISSUES_FOR_LIST_FAILURE on failure', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(Promise.reject());
testAction(
......@@ -571,7 +571,7 @@ describe('setActiveIssueWeight', () => {
projectPath: 'h/b',
};
it('should commit weight after setting the issue', done => {
it('should commit weight after setting the issue', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
issueSetWeight: {
......@@ -636,7 +636,7 @@ describe('moveIssue', () => {
issues,
};
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_SUCCESS mutation when successful', done => {
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_SUCCESS mutation when successful', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
issueMoveList: {
......@@ -677,7 +677,7 @@ describe('moveIssue', () => {
);
});
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_FAILURE mutation when unsuccessful', done => {
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_FAILURE mutation when unsuccessful', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: {
issueMoveList: {
......
......@@ -99,7 +99,7 @@ describe('BoardsStoreEE', () => {
beforeEach(() => {
requestSpy = jest.fn();
axiosMock.onPut(dummyEndpoint).replyOnce(config => requestSpy(config));
axiosMock.onPut(dummyEndpoint).replyOnce((config) => requestSpy(config));
});
it('makes a request to update the weight', () => {
......
import mutations from 'ee/boards/stores/mutations';
import { mockIssue, mockIssue2, mockEpics, mockEpic, mockLists } from '../mock_data';
const expectNotImplemented = action => {
const expectNotImplemented = (action) => {
it('is not implemented', () => {
expect(action).toThrow(new Error('Not implemented!'));
});
......
......@@ -24,7 +24,7 @@ describe('burndown_chart', () => {
const findIssuesButton = () => wrapper.find({ ref: 'totalIssuesButton' });
const findWeightButton = () => wrapper.find({ ref: 'totalWeightButton' });
const findActiveButtons = () =>
wrapper.findAll(GlButton).filter(button => button.attributes().category === 'primary');
wrapper.findAll(GlButton).filter((button) => button.attributes().category === 'primary');
const findBurndownChart = () => wrapper.find(BurndownChart);
const findBurnupChart = () => wrapper.find(BurnupChart);
const findOldBurndownChartButton = () => wrapper.find({ ref: 'oldBurndown' });
......
......@@ -28,19 +28,19 @@ describe('Codequality report actions', () => {
});
describe('setPage', () => {
it('sets the page number', done => {
it('sets the page number', (done) => {
testAction(actions.setPage, 12, state, [{ type: types.SET_PAGE, payload: 12 }], [], done);
});
});
describe('requestReport', () => {
it('sets the loading flag', done => {
it('sets the loading flag', (done) => {
testAction(actions.requestReport, null, state, [{ type: types.REQUEST_REPORT }], [], done);
});
});
describe('receiveReportSuccess', () => {
it('parses the list of issues from the report', done => {
it('parses the list of issues from the report', (done) => {
testAction(
actions.receiveReportSuccess,
unparsedIssues,
......@@ -53,7 +53,7 @@ describe('Codequality report actions', () => {
});
describe('receiveReportError', () => {
it('accepts a report error', done => {
it('accepts a report error', (done) => {
testAction(
actions.receiveReportError,
'error',
......@@ -70,7 +70,7 @@ describe('Codequality report actions', () => {
mock.onGet(endpoint).replyOnce(200, unparsedIssues);
});
it('fetches the report', done => {
it('fetches the report', (done) => {
testAction(
actions.fetchReport,
null,
......@@ -81,7 +81,7 @@ describe('Codequality report actions', () => {
);
});
it('shows a flash message when there is an error', done => {
it('shows a flash message when there is an error', (done) => {
testAction(
actions.fetchReport,
'error',
......@@ -97,7 +97,7 @@ describe('Codequality report actions', () => {
);
});
it('shows an error when blob path is missing', done => {
it('shows an error when blob path is missing', (done) => {
testAction(
actions.fetchReport,
null,
......
......@@ -8,7 +8,7 @@ const IMAGE_PATH = 'empty.svg';
describe('EmptyState component', () => {
let wrapper;
const emptyStateProp = prop => wrapper.find(GlEmptyState).props(prop);
const emptyStateProp = (prop) => wrapper.find(GlEmptyState).props(prop);
const createComponent = (props = {}) => {
return shallowMount(EmptyState, {
......
......@@ -8,7 +8,7 @@ describe('BranchDetails component', () => {
// The truncate component adds left-to-right marks into the text that we have to remove
const getText = () => wrapper.text().replace(/\u200E/gi, '');
const linkExists = testId => wrapper.find(`[data-testid="${testId}"]`).exists();
const linkExists = (testId) => wrapper.find(`[data-testid="${testId}"]`).exists();
const createComponent = ({ sourceUri = '', targetUri = '' } = {}) => {
return mount(BranchDetails, {
......
......@@ -53,7 +53,7 @@ describe('MergeRequestsGrid component', () => {
const mergeRequest = createMergeRequests({ count: 1 });
wrapper = createComponent(mergeRequest);
findStatuses().wrappers.forEach(status => {
findStatuses().wrappers.forEach((status) => {
const { type, data } = status.props('status');
switch (type) {
......
......@@ -9,7 +9,7 @@ describe('MergeRequest component', () => {
const findAuthorAvatarLink = () => wrapper.find('.issuable-authored').find(GlAvatarLink);
const createComponent = mergeRequest => {
const createComponent = (mergeRequest) => {
return shallowMount(MergeRequest, {
propsData: {
mergeRequest,
......
......@@ -7,7 +7,7 @@ import Pipeline from 'ee/compliance_dashboard/components/merge_requests/statuses
describe('Status component', () => {
let wrapper;
const createComponent = status => {
const createComponent = (status) => {
return shallowMount(Status, {
propsData: { status },
});
......@@ -34,7 +34,7 @@ describe('Status component', () => {
${'approval'} | ${null}
${'approval'} | ${''}
${'pipeline'} | ${{}}
`('does not render if given the status $value', status => {
`('does not render if given the status $value', (status) => {
wrapper = createComponent(status);
checkStatusComponentExists(status, false);
......@@ -44,7 +44,7 @@ describe('Status component', () => {
type | data
${'approval'} | ${'success'}
${'pipeline'} | ${{ group: 'warning' }}
`('renders if given the status $value', status => {
`('renders if given the status $value', (status) => {
wrapper = createComponent(status);
checkStatusComponentExists(status, true);
......
......@@ -9,7 +9,7 @@ describe('ApprovalStatus component', () => {
const findIcon = () => wrapper.find('.ci-icon');
const findLink = () => wrapper.find(GlLink);
const createComponent = status => {
const createComponent = (status) => {
return shallowMount(Approval, {
propsData: { status },
stubs: {
......
......@@ -10,7 +10,7 @@ describe('Pipeline component', () => {
const findCiIcon = () => wrapper.find('.ci-icon');
const findCiLink = () => wrapper.find(GlLink);
const createComponent = status => {
const createComponent = (status) => {
return shallowMount(Pipeline, {
propsData: { status },
stubs: {
......
......@@ -5,7 +5,7 @@ import GridColumnHeading from 'ee/compliance_dashboard/components/shared/grid_co
describe('GridColumnHeading component', () => {
let wrapper;
const createComponent = heading => {
const createComponent = (heading) => {
return shallowMount(GridColumnHeading, {
propsData: { heading },
});
......
......@@ -7,7 +7,7 @@ describe('Pagination component', () => {
let wrapper;
const findGlPagination = () => wrapper.find(GlPagination);
const getLink = query => wrapper.find(query).element.getAttribute('href');
const getLink = (query) => wrapper.find(query).element.getAttribute('href');
const findPrevPageLink = () => getLink('a.prev-page-item');
const findNextPageLink = () => getLink('a.next-page-item');
......
const createUser = id => ({
const createUser = (id) => ({
id,
avatar_url: `https://${id}`,
name: `User ${id}`,
......@@ -16,7 +16,7 @@ export const mergedAt = () => {
return date.toISOString();
};
export const createPipelineStatus = status => ({
export const createPipelineStatus = (status) => ({
details_path: '/h5bp/html5-boilerplate/pipelines/58',
favicon: '',
group: status,
......@@ -45,7 +45,7 @@ export const createMergeRequest = ({ id = 1, props } = {}) => {
return { ...mergeRequest, ...props };
};
export const createApprovers = count => {
export const createApprovers = (count) => {
return Array(count)
.fill(null)
.map((_, id) => createUser(id));
......
......@@ -27,7 +27,7 @@ describe('DependenciesApp component', () => {
store = createStore();
jest.spyOn(store, 'dispatch').mockImplementation();
const stubs = Object.keys(DependenciesApp.components).filter(name => name !== 'GlSprintf');
const stubs = Object.keys(DependenciesApp.components).filter((name) => name !== 'GlSprintf');
wrapper = mount(DependenciesApp, {
store,
......@@ -107,7 +107,7 @@ describe('DependenciesApp component', () => {
expect(componentWrapper.props()).toEqual(expect.objectContaining(props));
};
const expectComponentPropsToMatchSnapshot = Component => {
const expectComponentPropsToMatchSnapshot = (Component) => {
const componentWrapper = wrapper.find(Component);
expect(componentWrapper.props()).toMatchSnapshot();
};
......
......@@ -41,7 +41,7 @@ describe('DependenciesActions component', () => {
it('dispatches the right setSortField action on clicking each item in the dropdown', () => {
const dropdownItems = wrapper.findAll(GlDropdownItem).wrappers;
dropdownItems.forEach(item => {
dropdownItems.forEach((item) => {
// trigger() does not work on stubbed/shallow mounted components
// https://github.com/vuejs/vue-test-utils/issues/919
item.vm.$emit('click');
......@@ -49,7 +49,7 @@ describe('DependenciesActions component', () => {
expect(store.dispatch.mock.calls).toEqual(
expect.arrayContaining(
Object.keys(SORT_FIELDS).map(field => [`${namespace}/setSortField`, field]),
Object.keys(SORT_FIELDS).map((field) => [`${namespace}/setSortField`, field]),
),
);
});
......
......@@ -5,7 +5,7 @@ import DependenciesLicenseLinks from 'ee/dependencies/components/dependency_lice
describe('DependencyLicenseLinks component', () => {
// data helpers
const createLicenses = n => [...Array(n).keys()].map(i => ({ name: `license ${i + 1}` }));
const createLicenses = (n) => [...Array(n).keys()].map((i) => ({ name: `license ${i + 1}` }));
const addUrls = (licenses, numLicensesWithUrls = Infinity) =>
licenses.map((ls, i) => ({
...ls,
......@@ -26,7 +26,7 @@ describe('DependencyLicenseLinks component', () => {
};
// query helpers
const jsTestClassSelector = name => `.js-license-links-${name}`;
const jsTestClassSelector = (name) => `.js-license-links-${name}`;
const findLicensesList = () => wrapper.find(jsTestClassSelector('license-list'));
const findLicenseListItems = () => wrapper.findAll(jsTestClassSelector('license-list-item'));
const findModal = () => wrapper.find(jsTestClassSelector('modal'));
......@@ -46,7 +46,7 @@ describe('DependencyLicenseLinks component', () => {
expect(intersperseInstance.attributes('lastseparator')).toBe(' and ');
});
it.each([3, 5, 8, 13])('limits the number of visible licenses to 2', numLicenses => {
it.each([3, 5, 8, 13])('limits the number of visible licenses to 2', (numLicenses) => {
factory({ numLicenses });
expect(findLicenseListItems()).toHaveLength(2);
......@@ -76,7 +76,7 @@ describe('DependencyLicenseLinks component', () => {
const links = wrapper.findAll(GlLink);
links.wrappers.forEach(link => {
links.wrappers.forEach((link) => {
expect(link.attributes('target')).toBe('_blank');
});
});
......
......@@ -43,7 +43,7 @@ describe('DependencyListJobFailedAlert component', () => {
it.each([undefined, null, ''])(
'does not include a button if "jobPath" is given but empty',
jobPath => {
(jobPath) => {
factory({ propsData: { jobPath } });
expect(wrapper.find(GlAlert).props()).toMatchObject(NO_BUTTON_PROPS);
......
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