Commit aaa35d8f authored by Mike Greiling's avatar Mike Greiling

Merge branch 'leipert-prettier-arrow-parens-11' into 'master'

Format files with prettier arrowParens [11/15]

See merge request gitlab-org/gitlab!50538
parents 13130993 e3aca8c8
This diff is collapsed.
......@@ -43,7 +43,7 @@ describe('MonthsHeaderSubItemComponent', () => {
vm = createComponent({});
expect(Array.isArray(vm.headerSubItems)).toBe(true);
vm.headerSubItems.forEach(subItem => {
vm.headerSubItems.forEach((subItem) => {
expect(subItem instanceof Date).toBe(true);
});
});
......
......@@ -76,7 +76,7 @@ describe('QuartersHeaderItemComponent', () => {
expect(vm.timelineHeaderClass).toBe('');
});
it('returns string containing `label-dark label-bold` when current quarter is same as timeframeItem quarter', done => {
it('returns string containing `label-dark label-bold` when current quarter is same as timeframeItem quarter', (done) => {
vm = createComponent({
timeframeItem: mockTimeframeQuarters[1],
});
......
......@@ -59,7 +59,7 @@ describe('QuartersHeaderSubItemComponent', () => {
vm = createComponent({});
expect(Array.isArray(vm.headerSubItems)).toBe(true);
vm.headerSubItems.forEach(subItem => {
vm.headerSubItems.forEach((subItem) => {
expect(subItem instanceof Date).toBe(true);
});
});
......
......@@ -44,7 +44,7 @@ describe('MonthsHeaderSubItemComponent', () => {
expect(Array.isArray(vm.headerSubItems)).toBe(true);
expect(vm.headerSubItems).toHaveLength(7);
vm.headerSubItems.forEach(subItem => {
vm.headerSubItems.forEach((subItem) => {
expect(subItem instanceof Date).toBe(true);
});
});
......
......@@ -332,7 +332,7 @@ describe('Roadmap Vuex Actions', () => {
describe('refreshEpicDates', () => {
it('should update epics after refreshing epic dates to match with updated timeframe', () => {
const epics = rawEpics.map(epic =>
const epics = rawEpics.map((epic) =>
roadmapItemUtils.formatRoadmapItemDetails(
epic,
state.timeframeStartDate,
......@@ -747,7 +747,7 @@ describe('Roadmap Vuex Actions', () => {
describe('refreshMilestoneDates', () => {
it('should update milestones after refreshing milestone dates to match with updated timeframe', () => {
const milestones = rawMilestones.map(milestone =>
const milestones = rawMilestones.map((milestone) =>
roadmapItemUtils.formatRoadmapItemDetails(
milestone,
state.timeframeStartDate,
......
......@@ -11,7 +11,7 @@ import {
mockEpic,
} from 'ee_jest/roadmap/mock_data';
const setEpicMockData = state => {
const setEpicMockData = (state) => {
state.epics = [mockEpic];
state.childrenFlags = { 'gid://gitlab/Epic/1': {} };
state.epicIds = ['gid://gitlab/Epic/1'];
......@@ -157,7 +157,7 @@ describe('Roadmap Store Mutations', () => {
mutations[types.INIT_EPIC_CHILDREN_FLAGS](state, { epics });
epics.forEach(item => {
epics.forEach((item) => {
expect(state.childrenFlags[item.id]).toMatchObject({
itemExpanded: false,
itemChildrenFetchInProgress: false,
......
......@@ -15,7 +15,7 @@ describe('DirtyFormChecker', () => {
});
it('finds editable inputs', () => {
const editableInputs = dirtyFormChecker.editableInputs.map(input => input.name);
const editableInputs = dirtyFormChecker.editableInputs.map((input) => input.name);
expect(editableInputs).toContain('saml_provider[sso_url]');
expect(editableInputs).not.toContain('authenticity_token');
......
......@@ -31,7 +31,7 @@ describe('SamlSettingsForm', () => {
});
it('keeps Test button disabled when SAML disabled for the group', () => {
samlSettingsForm.settings.find(s => s.name === 'group-saml').value = false;
samlSettingsForm.settings.find((s) => s.name === 'group-saml').value = false;
samlSettingsForm.testButton.setAttribute('disabled', true);
samlSettingsForm.updateView();
......@@ -41,15 +41,15 @@ describe('SamlSettingsForm', () => {
});
it('correctly disables dependent toggle', () => {
samlSettingsForm.settings.forEach(s => {
samlSettingsForm.settings.forEach((s) => {
const { input } = s;
input.value = true;
});
const findEnforcedGroupManagedAccountSetting = () =>
samlSettingsForm.settings.find(s => s.name === 'enforced-group-managed-accounts');
samlSettingsForm.settings.find((s) => s.name === 'enforced-group-managed-accounts');
const findProhibitForksSetting = () =>
samlSettingsForm.settings.find(s => s.name === 'prohibited-outer-forks');
samlSettingsForm.settings.find((s) => s.name === 'prohibited-outer-forks');
samlSettingsForm.updateSAMLSettings();
samlSettingsForm.updateView();
......@@ -66,7 +66,7 @@ describe('SamlSettingsForm', () => {
});
it('correctly disables multiple dependent toggles', () => {
samlSettingsForm.settings.forEach(s => {
samlSettingsForm.settings.forEach((s) => {
const { input } = s;
input.value = true;
});
......@@ -77,8 +77,8 @@ describe('SamlSettingsForm', () => {
samlSettingsForm.updateSAMLSettings();
samlSettingsForm.updateView();
[groupSamlSetting, ...otherSettings] = samlSettingsForm.settings;
expect(samlSettingsForm.settings.every(s => s.value)).toBe(true);
expect(samlSettingsForm.settings.some(s => s.toggle.hasAttribute('disabled'))).toBe(false);
expect(samlSettingsForm.settings.every((s) => s.value)).toBe(true);
expect(samlSettingsForm.settings.some((s) => s.toggle.hasAttribute('disabled'))).toBe(false);
groupSamlSetting.input.value = false;
samlSettingsForm.updateSAMLSettings();
......@@ -86,8 +86,8 @@ describe('SamlSettingsForm', () => {
return new Promise(window.requestAnimationFrame).then(() => {
[groupSamlSetting, ...otherSettings] = samlSettingsForm.settings;
expect(otherSettings.every(s => s.value)).toBe(true);
expect(otherSettings.every(s => s.toggle.hasAttribute('disabled'))).toBe(true);
expect(otherSettings.every((s) => s.value)).toBe(true);
expect(otherSettings.every((s) => s.toggle.hasAttribute('disabled'))).toBe(true);
});
});
});
......@@ -42,7 +42,7 @@ describe('SCIMTokenToggleArea', () => {
});
describe('generateSCIMToken', () => {
it('toggles the generate and scim token forms', done => {
it('toggles the generate and scim token forms', (done) => {
scimTokenToggleArea
.generateSCIMToken()
.then(() => {
......@@ -53,7 +53,7 @@ describe('SCIMTokenToggleArea', () => {
.catch(done.fail);
});
it('populates the scim form with the token data', done => {
it('populates the scim form with the token data', (done) => {
scimTokenToggleArea
.generateSCIMToken()
.then(() => {
......@@ -74,7 +74,7 @@ describe('SCIMTokenToggleArea', () => {
expect(mockGenerateNewSCIMToken).not.toHaveBeenCalled();
});
it('populates the scim form with the token data if the confirm is accepted', done => {
it('populates the scim form with the token data if the confirm is accepted', (done) => {
jest.spyOn(window, 'confirm').mockReturnValue(true);
scimTokenToggleArea
......
......@@ -55,7 +55,7 @@ describe('Security Configuration App', () => {
const getFeaturesTable = () => wrapper.find({ ref: 'securityControlTable' });
const getFeaturesRows = () => getFeaturesTable().findAll('tbody tr');
const getAlert = () => wrapper.find(GlAlert);
const getRowCells = row => {
const getRowCells = (row) => {
const [feature, status, manage] = row.findAll('td').wrappers;
return { feature, status, manage };
};
......
......@@ -9,7 +9,7 @@ describe('FeatureStatus component', () => {
let wrapper;
let feature;
const createComponent = options => {
const createComponent = (options) => {
wrapper = shallowMount(FeatureStatus, options);
};
......
export const generateFeatures = (n, overrides = {}) => {
return [...Array(n).keys()].map(i => ({
return [...Array(n).keys()].map((i) => ({
type: `scan-type-${i}`,
name: `name-feature-${i}`,
description: `description-feature-${i}`,
......
......@@ -10,7 +10,7 @@ describe('ManageFeature component', () => {
let wrapper;
let feature;
const createComponent = options => {
const createComponent = (options) => {
wrapper = shallowMount(
ManageFeature,
merge(
......@@ -30,7 +30,7 @@ describe('ManageFeature component', () => {
});
const findCreateMergeRequestButton = () => wrapper.find(CreateMergeRequestButton);
const findTestId = id => wrapper.find(`[data-testid="${id}"]`);
const findTestId = (id) => wrapper.find(`[data-testid="${id}"]`);
describe('given sastConfigurationUi feature flag is enabled', () => {
const featureFlagEnabled = {
......
......@@ -56,7 +56,7 @@ describe('EE - DastProfilesList', () => {
const getAllLoadingIndicators = () => withinComponent().queryAllByTestId('loadingIndicator');
const getErrorMessage = () => withinComponent().queryByText(TEST_ERROR_MESSAGE);
const getErrorDetails = () => withinComponent().queryByRole('list', { name: /error details/i });
const getDeleteButtonWithin = element =>
const getDeleteButtonWithin = (element) =>
createWrapper(within(element).queryByRole('button', { name: /delete/i }));
const getModal = () => wrapper.find(GlModal);
......@@ -111,7 +111,7 @@ describe('EE - DastProfilesList', () => {
});
describe('with existing profiles', () => {
const getTableRowForProfile = profile => getAllTableRows()[profiles.indexOf(profile)];
const getTableRowForProfile = (profile) => getAllTableRows()[profiles.indexOf(profile)];
describe('profiles list', () => {
beforeEach(() => {
......@@ -127,7 +127,7 @@ describe('EE - DastProfilesList', () => {
expect(getAllTableRows()).toHaveLength(profiles.length);
});
it.each(profiles)('renders list item %# correctly', profile => {
it.each(profiles)('renders list item %# correctly', (profile) => {
const [profileCell, targetUrlCell, , actionsCell] = getTableRowForProfile(profile).cells;
expect(profileCell.innerText).toContain(profile.profileName);
......@@ -150,7 +150,7 @@ describe('EE - DastProfilesList', () => {
},
});
});
it.each(profiles)('renders list item %# correctly', profile => {
it.each(profiles)('renders list item %# correctly', (profile) => {
const [profileCell, , , actionsCell] = getTableRowForProfile(profile).cells;
expect(profileCell.innerHTML).toContain(`<b>${profile.profileName}</b>`);
......@@ -184,7 +184,7 @@ describe('EE - DastProfilesList', () => {
});
});
describe.each(profiles)('delete profile', profile => {
describe.each(profiles)('delete profile', (profile) => {
beforeEach(() => {
createFullComponent({ propsData: { profiles } });
});
......
......@@ -53,9 +53,9 @@ describe('EE - DastProfiles', () => {
const createFullComponent = createComponentFactory(mount);
const withinComponent = () => within(wrapper.element);
const getProfilesComponent = profileType => wrapper.find(`[data-testid="${profileType}List"]`);
const getProfilesComponent = (profileType) => wrapper.find(`[data-testid="${profileType}List"]`);
const getDropdownComponent = () => wrapper.find(GlDropdown);
const getSiteProfilesDropdownItem = text =>
const getSiteProfilesDropdownItem = (text) =>
within(getDropdownComponent().element).queryByText(text);
const getTabsComponent = () => wrapper.find(GlTabs);
const getTab = ({ tabName, selected }) =>
......
......@@ -33,7 +33,7 @@ describe('EE - DastSiteProfileList', () => {
isLoading: false,
};
const createMockApolloProvider = handlers => {
const createMockApolloProvider = (handlers) => {
localVue.use(VueApollo);
requestHandlers = handlers;
return createApolloProvider([[dastSiteValidationsQuery, requestHandlers.dastSiteValidations]]);
......@@ -67,7 +67,7 @@ describe('EE - DastSiteProfileList', () => {
return tableBody;
};
const getAllTableRows = () => within(getTableBody()).getAllByRole('row');
const getTableRowForProfile = profile => getAllTableRows()[siteProfiles.indexOf(profile)];
const getTableRowForProfile = (profile) => getAllTableRows()[siteProfiles.indexOf(profile)];
const findProfileList = () => wrapper.find(ProfilesList);
......@@ -193,7 +193,7 @@ describe('EE - DastSiteProfileList', () => {
});
});
it.each(siteProfiles)('profile %# should not have validate button and status', profile => {
it.each(siteProfiles)('profile %# should not have validate button and status', (profile) => {
const [, , validationStatusCell, actionsCell] = getTableRowForProfile(profile).cells;
expect(within(actionsCell).queryByRole('button', { name: /validate/i })).toBe(null);
......
......@@ -36,7 +36,7 @@ describe('DAST Scanner Profile', () => {
let wrapper;
const withinComponent = () => within(wrapper.element);
const findByTestId = testId => wrapper.find(`[data-testid="${testId}"`);
const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"`);
const findForm = () => wrapper.find(GlForm);
const findProfileNameInput = () => findByTestId('profile-name-input');
......@@ -50,7 +50,7 @@ describe('DAST Scanner Profile', () => {
const findAlert = () => wrapper.find(GlAlert);
const submitForm = () => findForm().vm.$emit('submit', { preventDefault: () => {} });
const componentFactory = (mountFn = shallowMount) => options => {
const componentFactory = (mountFn = shallowMount) => (options) => {
wrapper = mountFn(
DastScannerProfileForm,
merge(
......@@ -120,7 +120,7 @@ describe('DAST Scanner Profile', () => {
createFullComponent();
});
it.each(invalidValues)('is marked as invalid provided an invalid value', async value => {
it.each(invalidValues)('is marked as invalid provided an invalid value', async (value) => {
await finder().find('input').setValue(value);
expect(wrapper.text()).toContain(errorMessage);
......@@ -242,7 +242,7 @@ describe('DAST Scanner Profile', () => {
const alert = findAlert();
expect(alert.exists()).toBe(true);
errors.forEach(error => {
errors.forEach((error) => {
expect(alert.text()).toContain(error);
});
});
......
......@@ -24,7 +24,7 @@ describe('DastSiteAuthSection', () => {
wrapper.destroy();
});
const findByNameAttribute = name => wrapper.find(`[name="${name}"]`);
const findByNameAttribute = (name) => wrapper.find(`[name="${name}"]`);
const findAuthForm = () => wrapper.findByTestId('auth-form');
const findAuthCheckbox = () => wrapper.find(GlFormCheckbox);
......@@ -41,7 +41,7 @@ describe('DastSiteAuthSection', () => {
describe('authentication toggle', () => {
it.each([true, false])(
'is set correctly when the "authEnabled" field is set to "%s"',
authEnabled => {
(authEnabled) => {
createComponent({ fields: { authEnabled } });
expect(findAuthCheckbox().vm.$attrs.checked).toBe(authEnabled);
},
......@@ -55,7 +55,7 @@ describe('DastSiteAuthSection', () => {
it.each([true, false])(
'makes the component emit an "input" event when changed',
async enabled => {
async (enabled) => {
await setAuthentication({ enabled });
expect(getLatestInputEventPayload().fields.authEnabled.value).toBe(enabled);
},
......@@ -77,7 +77,7 @@ describe('DastSiteAuthSection', () => {
const inputFieldNames = Object.keys(inputFieldsWithValues);
describe.each(inputFieldNames)('input field "%s"', inputFieldName => {
describe.each(inputFieldNames)('input field "%s"', (inputFieldName) => {
it('is rendered', () => {
expect(findByNameAttribute(inputFieldName).exists()).toBe(true);
});
......
......@@ -25,7 +25,7 @@ describe('ConfigurationForm component', () => {
let pendingPromiseResolvers;
const fulfillPendingPromises = () => {
pendingPromiseResolvers.forEach(resolve => resolve());
pendingPromiseResolvers.forEach((resolve) => resolve());
};
const createComponent = ({ mutationResult, ...options } = {}) => {
......@@ -47,7 +47,7 @@ describe('ConfigurationForm component', () => {
$apollo: {
mutate: jest.fn(
() =>
new Promise(resolve => {
new Promise((resolve) => {
pendingPromiseResolvers.push(() =>
resolve({
data: { configureSast: mutationResult },
......
......@@ -34,7 +34,7 @@ describe('DynamicFields component', () => {
});
});
describe.each([true, false])('given the disabled prop is %p', disabled => {
describe.each([true, false])('given the disabled prop is %p', (disabled) => {
let entities;
beforeEach(() => {
......
......@@ -8,7 +8,7 @@
* @returns {Object[]}
*/
export const makeEntities = (count, changes) =>
[...Array(count).keys()].map(i => ({
[...Array(count).keys()].map((i) => ({
defaultValue: `defaultValue${i}`,
description: `description${i}`,
field: `field${i}`,
......@@ -28,7 +28,7 @@ export const makeEntities = (count, changes) =>
* @returns {Object[]}
*/
export const makeAnalyzerEntities = (count, changes) =>
[...Array(count).keys()].map(i => ({
[...Array(count).keys()].map((i) => ({
name: `nameValue${i}`,
label: `label${i}`,
description: `description${i}`,
......
......@@ -22,11 +22,11 @@ describe('isValidConfigurationEntity', () => {
...makeEntities(1, { defaultValue: undefined }),
];
it.each(validEntities)('returns true for a valid entity', entity => {
it.each(validEntities)('returns true for a valid entity', (entity) => {
expect(isValidConfigurationEntity(entity)).toBe(true);
});
it.each(invalidEntities)('returns false for an invalid entity', invalidEntity => {
it.each(invalidEntities)('returns false for an invalid entity', (invalidEntity) => {
expect(isValidConfigurationEntity(invalidEntity)).toBe(false);
});
});
......@@ -45,11 +45,11 @@ describe('isValidAnalyzerEntity', () => {
...makeAnalyzerEntities(1, { enabled: '' }),
];
it.each(validEntities)('returns true for a valid entity', entity => {
it.each(validEntities)('returns true for a valid entity', (entity) => {
expect(isValidAnalyzerEntity(entity)).toBe(true);
});
it.each(invalidEntities)('returns false for an invalid entity', invalidEntity => {
it.each(invalidEntities)('returns false for an invalid entity', (invalidEntity) => {
expect(isValidAnalyzerEntity(invalidEntity)).toBe(false);
});
});
......
......@@ -31,7 +31,7 @@ describe('AutoFix Help Text component', () => {
wrapper = createWrapper();
});
const findByTestId = id => wrapper.find(`[data-testid="${id}"]`);
const findByTestId = (id) => wrapper.find(`[data-testid="${id}"]`);
it('popover should have wrapping div as target', () => {
expect(
......
......@@ -50,7 +50,7 @@ describe('Filter Body component', () => {
});
describe('search box', () => {
it.each([true, false])('shows/hides search box when the showSearchBox prop is %s', show => {
it.each([true, false])('shows/hides search box when the showSearchBox prop is %s', (show) => {
createComponent({ showSearchBox: show });
expect(searchBox().exists()).toBe(show);
......
......@@ -38,7 +38,7 @@ describe('Filter Item component', () => {
});
});
it.each([true, false])('shows the expected checkmark when isSelected is %s', isChecked => {
it.each([true, false])('shows the expected checkmark when isSelected is %s', (isChecked) => {
createWrapper({ isChecked });
expect(dropdownItem().props('isChecked')).toBe(isChecked);
});
......
......@@ -7,7 +7,7 @@ const localVue = createLocalVue();
localVue.use(VueRouter);
const router = new VueRouter();
const generateOptions = length =>
const generateOptions = (length) =>
Array.from({ length }).map((_, i) => ({ name: `Option ${i}`, id: `option-${i}`, index: i }));
const filter = {
......@@ -17,8 +17,8 @@ const filter = {
allOption: { id: 'allOptionId' },
defaultOptions: [],
};
const optionsAt = indexes => filter.options.filter(x => indexes.includes(x.index));
const optionIdsAt = indexes => optionsAt(indexes).map(x => x.id);
const optionsAt = (indexes) => filter.options.filter((x) => indexes.includes(x.index));
const optionIdsAt = (indexes) => optionsAt(indexes).map((x) => x.id);
describe('Standard Filter component', () => {
let wrapper;
......@@ -32,9 +32,9 @@ describe('Standard Filter component', () => {
};
const dropdownItems = () => wrapper.findAll('[data-testid="filterOption"]');
const dropdownItemAt = index => dropdownItems().at(index);
const dropdownItemAt = (index) => dropdownItems().at(index);
const allOptionItem = () => wrapper.find('[data-testid="allOption"]');
const isChecked = item => item.props('isChecked');
const isChecked = (item) => item.props('isChecked');
const filterQuery = () => wrapper.vm.$route.query[filter.id];
const filterBody = () => wrapper.find(FilterBody);
......@@ -43,13 +43,13 @@ describe('Standard Filter component', () => {
await wrapper.vm.$nextTick();
};
const clickItemAt = async index => {
const clickItemAt = async (index) => {
dropdownItemAt(index).vm.$emit('click');
await wrapper.vm.$nextTick();
};
const expectSelectedItems = indexes => {
const checkedIndexes = dropdownItems().wrappers.map(item => isChecked(item));
const expectSelectedItems = (indexes) => {
const checkedIndexes = dropdownItems().wrappers.map((item) => isChecked(item));
const expectedIndexes = Array.from({ length: checkedIndexes.length }).map((_, index) =>
indexes.includes(index),
);
......@@ -59,7 +59,7 @@ describe('Standard Filter component', () => {
const expectAllOptionSelected = () => {
expect(isChecked(allOptionItem())).toBe(true);
const checkedIndexes = dropdownItems().wrappers.map(item => isChecked(item));
const checkedIndexes = dropdownItems().wrappers.map((item) => isChecked(item));
const expectedIndexes = new Array(checkedIndexes.length).fill(false);
expect(checkedIndexes).toEqual(expectedIndexes);
......@@ -106,13 +106,13 @@ describe('Standard Filter component', () => {
});
it('filters options when something is typed in the search box', async () => {
const expectedItems = filter.options.map(x => x.name).filter(x => x.includes('1'));
const expectedItems = filter.options.map((x) => x.name).filter((x) => x.includes('1'));
createWrapper({}, true);
filterBody().vm.$emit('input', '1');
await wrapper.vm.$nextTick();
expect(dropdownItems()).toHaveLength(3);
expect(dropdownItems().wrappers.map(x => x.props('text'))).toEqual(expectedItems);
expect(dropdownItems().wrappers.map((x) => x.props('text'))).toEqual(expectedItems);
});
});
......@@ -177,7 +177,7 @@ describe('Standard Filter component', () => {
});
describe('filter querystring', () => {
const updateRouteQuery = async ids => {
const updateRouteQuery = async (ids) => {
// window.history.back() won't change the location nor fire the popstate event, so we need
// to fake it by doing it manually.
router.replace({ query: { [filter.id]: ids } });
......@@ -190,7 +190,7 @@ describe('Standard Filter component', () => {
createWrapper();
const clickedIds = [];
[1, 3, 5].forEach(index => {
[1, 3, 5].forEach((index) => {
clickItemAt(index);
clickedIds.push(optionIdsAt([index])[0]);
......
......@@ -4,9 +4,9 @@ import { shallowMount } from '@vue/test-utils';
import ProjectList from 'ee/security_dashboard/components/first_class_project_manager/project_list.vue';
import ProjectAvatar from '~/vue_shared/components/project_avatar/default.vue';
const getArrayWithLength = n => [...Array(n).keys()];
const getArrayWithLength = (n) => [...Array(n).keys()];
const generateMockProjects = (projectsCount, mockProject = {}) =>
getArrayWithLength(projectsCount).map(id => ({ id, ...mockProject }));
getArrayWithLength(projectsCount).map((id) => ({ id, ...mockProject }));
describe('Project List component', () => {
let wrapper;
......@@ -49,7 +49,7 @@ describe('Project List component', () => {
it.each([0, 1, 2])(
'renders a list of projects and displays a count of how many there are',
projectsCount => {
(projectsCount) => {
factory({ projects: generateMockProjects(projectsCount) });
expect(getAllProjectItems()).toHaveLength(projectsCount);
......
......@@ -47,7 +47,7 @@ describe('First class Project Security Dashboard component', () => {
const findCsvExportButton = () => wrapper.find(CsvExportButton);
const findAutoFixUserCallout = () => wrapper.find(AutoFixUserCallout);
const createComponent = options => {
const createComponent = (options) => {
wrapper = shallowMount(FirstClassProjectSecurityDashboard, {
propsData: {
...props,
......
......@@ -27,7 +27,7 @@ describe('Vulnerability Severity component', () => {
const findAccordionItemsText = () =>
wrapper
.findAll('[data-testid="vulnerability-severity-groups"]')
.wrappers.map(item => trimText(item.text()));
.wrappers.map((item) => trimText(item.text()));
const createApolloProvider = (...queries) => {
return createMockApollo([...queries]);
......@@ -53,8 +53,8 @@ describe('Vulnerability Severity component', () => {
const findHelpLink = () => wrapper.find(GlLink);
const findHeader = () => wrapper.find('h4');
const findDescription = () => wrapper.find('p');
const findAccordionItemByGrade = grade => wrapper.find({ ref: `accordionItem${grade}` });
const findProjectName = accordion => accordion.findAll(GlLink);
const findAccordionItemByGrade = (grade) => wrapper.find({ ref: `accordionItem${grade}` });
const findProjectName = (accordion) => accordion.findAll(GlLink);
afterEach(() => {
wrapper.destroy();
......
......@@ -11,7 +11,7 @@ const illustrations = {
describe('LoadingError component', () => {
let wrapper;
const createWrapper = errorCode => {
const createWrapper = (errorCode) => {
wrapper = shallowMount(LoadingError, {
propsData: {
errorCode,
......@@ -25,7 +25,7 @@ describe('LoadingError component', () => {
wrapper = null;
});
describe.each([401, 403])('with error code %s', errorCode => {
describe.each([401, 403])('with error code %s', (errorCode) => {
beforeEach(() => {
createWrapper(errorCode);
});
......
......@@ -24,7 +24,7 @@ describe('Pipeline Security Dashboard component', () => {
let store;
let wrapper;
const factory = options => {
const factory = (options) => {
store = new Vuex.Store({
modules: {
vulnerabilities: {
......
......@@ -11,7 +11,7 @@ describe('Pipeline status badge', () => {
const findGlBadge = () => wrapper.find(GlBadge);
const findGlIcon = () => wrapper.find(GlIcon);
const createProps = securityBuildsFailedCount => ({ pipeline: { securityBuildsFailedCount } });
const createProps = (securityBuildsFailedCount) => ({ pipeline: { securityBuildsFailedCount } });
const createWrapper = (props = {}) => {
wrapper = shallowMount(PipelineStatusBadge, {
......
......@@ -15,7 +15,7 @@ describe('Security Charts Layout component', () => {
const findSlot = () => wrapper.find(`[data-testid="security-charts-layout"]`);
const createWrapper = slots => {
const createWrapper = (slots) => {
wrapper = shallowMount(SecurityChartsLayout, { slots });
};
......
......@@ -11,7 +11,7 @@ describe('Security Dashboard Layout component', () => {
template: '<p>dummy component</p>',
};
const createWrapper = slots => {
const createWrapper = (slots) => {
wrapper = shallowMount(SecurityDashboardLayout, { slots });
};
......
......@@ -35,7 +35,7 @@ describe('Security Dashboard Table Row', () => {
});
const findLoader = () => wrapper.find('.js-skeleton-loader');
const findContent = i => wrapper.findAll('.table-mobile-content').at(i);
const findContent = (i) => wrapper.findAll('.table-mobile-content').at(i);
const findAllIssueCreated = () => wrapper.findAll('[data-testid="issues-icon"]');
const hasSelectedClass = () => wrapper.classes('gl-bg-blue-50');
const findCheckbox = () => wrapper.find(GlFormCheckbox);
......
......@@ -26,7 +26,7 @@ describe('Security Dashboard component', () => {
let fetchPipelineJobsSpy;
let store;
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(SecurityDashboard, {
store,
stubs: {
......@@ -141,14 +141,14 @@ describe('Security Dashboard component', () => {
createComponent();
});
it.each([401, 403])('displays an error on error %s', errorCode => {
it.each([401, 403])('displays an error on error %s', (errorCode) => {
store.dispatch('vulnerabilities/receiveVulnerabilitiesError', errorCode);
return wrapper.vm.$nextTick().then(() => {
expect(wrapper.find(LoadingError).exists()).toBe(true);
});
});
it.each([404, 500])('does not display an error on error %s', errorCode => {
it.each([404, 500])('does not display an error on error %s', (errorCode) => {
store.dispatch('vulnerabilities/receiveVulnerabilitiesError', errorCode);
return wrapper.vm.$nextTick().then(() => {
expect(wrapper.find(LoadingError).exists()).toBe(false);
......
......@@ -11,7 +11,7 @@ describe('Security reports summary component', () => {
let wrapper;
const createWrapper = options => {
const createWrapper = (options) => {
wrapper = shallowMount(SecurityReportsSummary, {
propsData: {
summary: {},
......
......@@ -31,7 +31,7 @@ describe('EE Vulnerability Security Scanner Alert', () => {
const withinWrapper = () => within(wrapper.element);
const findAlert = () => withinWrapper().queryByRole('alert');
const findById = testId => withinWrapper().getByTestId(testId);
const findById = (testId) => withinWrapper().getByTestId(testId);
describe('container', () => {
it('renders when disabled scanners are detected', () => {
......
......@@ -88,7 +88,7 @@ describe('Selection Summary component', () => {
let mutateMock;
beforeEach(() => {
mutateMock = jest.fn(data =>
mutateMock = jest.fn((data) =>
data.variables.id % 2 === 0 ? Promise.resolve() : Promise.reject(),
);
......
......@@ -50,7 +50,7 @@ describe('Selection Summary', () => {
const dismissMessage = () => wrapper.find('[data-testid="dismiss-message"]');
const dismissButton = () => wrapper.find(GlButton);
const selectByIndex = index =>
const selectByIndex = (index) =>
store.commit(`vulnerabilities/${SELECT_VULNERABILITY}`, mockDataVulnerabilities[index].id);
it('renders the form', () => {
......
......@@ -26,7 +26,7 @@ describe('Vulnerabilities count list component', () => {
it('passes the isLoading prop to the counts', () => {
wrapper = createWrapper({ propsData: { isLoading: true, vulnerabilitiesCount: {} } });
findVulnerability().wrappers.forEach(component => {
findVulnerability().wrappers.forEach((component) => {
expect(component.props('isLoading')).toBe(true);
});
});
......@@ -60,7 +60,7 @@ describe('Vulnerabilities count list component', () => {
});
it('sets the isLoading prop false and passes it down', () => {
findVulnerability().wrappers.forEach(component => {
findVulnerability().wrappers.forEach((component) => {
expect(component.props('isLoading')).toBe(false);
});
});
......
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');
......
......@@ -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,
});
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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