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', () => { ...@@ -43,7 +43,7 @@ describe('MonthsHeaderSubItemComponent', () => {
vm = createComponent({}); vm = createComponent({});
expect(Array.isArray(vm.headerSubItems)).toBe(true); expect(Array.isArray(vm.headerSubItems)).toBe(true);
vm.headerSubItems.forEach(subItem => { vm.headerSubItems.forEach((subItem) => {
expect(subItem instanceof Date).toBe(true); expect(subItem instanceof Date).toBe(true);
}); });
}); });
......
...@@ -76,7 +76,7 @@ describe('QuartersHeaderItemComponent', () => { ...@@ -76,7 +76,7 @@ describe('QuartersHeaderItemComponent', () => {
expect(vm.timelineHeaderClass).toBe(''); 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({ vm = createComponent({
timeframeItem: mockTimeframeQuarters[1], timeframeItem: mockTimeframeQuarters[1],
}); });
......
...@@ -59,7 +59,7 @@ describe('QuartersHeaderSubItemComponent', () => { ...@@ -59,7 +59,7 @@ describe('QuartersHeaderSubItemComponent', () => {
vm = createComponent({}); vm = createComponent({});
expect(Array.isArray(vm.headerSubItems)).toBe(true); expect(Array.isArray(vm.headerSubItems)).toBe(true);
vm.headerSubItems.forEach(subItem => { vm.headerSubItems.forEach((subItem) => {
expect(subItem instanceof Date).toBe(true); expect(subItem instanceof Date).toBe(true);
}); });
}); });
......
...@@ -44,7 +44,7 @@ describe('MonthsHeaderSubItemComponent', () => { ...@@ -44,7 +44,7 @@ describe('MonthsHeaderSubItemComponent', () => {
expect(Array.isArray(vm.headerSubItems)).toBe(true); expect(Array.isArray(vm.headerSubItems)).toBe(true);
expect(vm.headerSubItems).toHaveLength(7); expect(vm.headerSubItems).toHaveLength(7);
vm.headerSubItems.forEach(subItem => { vm.headerSubItems.forEach((subItem) => {
expect(subItem instanceof Date).toBe(true); expect(subItem instanceof Date).toBe(true);
}); });
}); });
......
...@@ -332,7 +332,7 @@ describe('Roadmap Vuex Actions', () => { ...@@ -332,7 +332,7 @@ describe('Roadmap Vuex Actions', () => {
describe('refreshEpicDates', () => { describe('refreshEpicDates', () => {
it('should update epics after refreshing epic dates to match with updated timeframe', () => { 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( roadmapItemUtils.formatRoadmapItemDetails(
epic, epic,
state.timeframeStartDate, state.timeframeStartDate,
...@@ -747,7 +747,7 @@ describe('Roadmap Vuex Actions', () => { ...@@ -747,7 +747,7 @@ describe('Roadmap Vuex Actions', () => {
describe('refreshMilestoneDates', () => { describe('refreshMilestoneDates', () => {
it('should update milestones after refreshing milestone dates to match with updated timeframe', () => { 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( roadmapItemUtils.formatRoadmapItemDetails(
milestone, milestone,
state.timeframeStartDate, state.timeframeStartDate,
......
...@@ -11,7 +11,7 @@ import { ...@@ -11,7 +11,7 @@ import {
mockEpic, mockEpic,
} from 'ee_jest/roadmap/mock_data'; } from 'ee_jest/roadmap/mock_data';
const setEpicMockData = state => { const setEpicMockData = (state) => {
state.epics = [mockEpic]; state.epics = [mockEpic];
state.childrenFlags = { 'gid://gitlab/Epic/1': {} }; state.childrenFlags = { 'gid://gitlab/Epic/1': {} };
state.epicIds = ['gid://gitlab/Epic/1']; state.epicIds = ['gid://gitlab/Epic/1'];
...@@ -157,7 +157,7 @@ describe('Roadmap Store Mutations', () => { ...@@ -157,7 +157,7 @@ describe('Roadmap Store Mutations', () => {
mutations[types.INIT_EPIC_CHILDREN_FLAGS](state, { epics }); mutations[types.INIT_EPIC_CHILDREN_FLAGS](state, { epics });
epics.forEach(item => { epics.forEach((item) => {
expect(state.childrenFlags[item.id]).toMatchObject({ expect(state.childrenFlags[item.id]).toMatchObject({
itemExpanded: false, itemExpanded: false,
itemChildrenFetchInProgress: false, itemChildrenFetchInProgress: false,
......
...@@ -15,7 +15,7 @@ describe('DirtyFormChecker', () => { ...@@ -15,7 +15,7 @@ describe('DirtyFormChecker', () => {
}); });
it('finds editable inputs', () => { 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).toContain('saml_provider[sso_url]');
expect(editableInputs).not.toContain('authenticity_token'); expect(editableInputs).not.toContain('authenticity_token');
......
...@@ -31,7 +31,7 @@ describe('SamlSettingsForm', () => { ...@@ -31,7 +31,7 @@ describe('SamlSettingsForm', () => {
}); });
it('keeps Test button disabled when SAML disabled for the group', () => { 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.testButton.setAttribute('disabled', true);
samlSettingsForm.updateView(); samlSettingsForm.updateView();
...@@ -41,15 +41,15 @@ describe('SamlSettingsForm', () => { ...@@ -41,15 +41,15 @@ describe('SamlSettingsForm', () => {
}); });
it('correctly disables dependent toggle', () => { it('correctly disables dependent toggle', () => {
samlSettingsForm.settings.forEach(s => { samlSettingsForm.settings.forEach((s) => {
const { input } = s; const { input } = s;
input.value = true; input.value = true;
}); });
const findEnforcedGroupManagedAccountSetting = () => const findEnforcedGroupManagedAccountSetting = () =>
samlSettingsForm.settings.find(s => s.name === 'enforced-group-managed-accounts'); samlSettingsForm.settings.find((s) => s.name === 'enforced-group-managed-accounts');
const findProhibitForksSetting = () => const findProhibitForksSetting = () =>
samlSettingsForm.settings.find(s => s.name === 'prohibited-outer-forks'); samlSettingsForm.settings.find((s) => s.name === 'prohibited-outer-forks');
samlSettingsForm.updateSAMLSettings(); samlSettingsForm.updateSAMLSettings();
samlSettingsForm.updateView(); samlSettingsForm.updateView();
...@@ -66,7 +66,7 @@ describe('SamlSettingsForm', () => { ...@@ -66,7 +66,7 @@ describe('SamlSettingsForm', () => {
}); });
it('correctly disables multiple dependent toggles', () => { it('correctly disables multiple dependent toggles', () => {
samlSettingsForm.settings.forEach(s => { samlSettingsForm.settings.forEach((s) => {
const { input } = s; const { input } = s;
input.value = true; input.value = true;
}); });
...@@ -77,8 +77,8 @@ describe('SamlSettingsForm', () => { ...@@ -77,8 +77,8 @@ describe('SamlSettingsForm', () => {
samlSettingsForm.updateSAMLSettings(); samlSettingsForm.updateSAMLSettings();
samlSettingsForm.updateView(); samlSettingsForm.updateView();
[groupSamlSetting, ...otherSettings] = samlSettingsForm.settings; [groupSamlSetting, ...otherSettings] = samlSettingsForm.settings;
expect(samlSettingsForm.settings.every(s => s.value)).toBe(true); expect(samlSettingsForm.settings.every((s) => s.value)).toBe(true);
expect(samlSettingsForm.settings.some(s => s.toggle.hasAttribute('disabled'))).toBe(false); expect(samlSettingsForm.settings.some((s) => s.toggle.hasAttribute('disabled'))).toBe(false);
groupSamlSetting.input.value = false; groupSamlSetting.input.value = false;
samlSettingsForm.updateSAMLSettings(); samlSettingsForm.updateSAMLSettings();
...@@ -86,8 +86,8 @@ describe('SamlSettingsForm', () => { ...@@ -86,8 +86,8 @@ describe('SamlSettingsForm', () => {
return new Promise(window.requestAnimationFrame).then(() => { return new Promise(window.requestAnimationFrame).then(() => {
[groupSamlSetting, ...otherSettings] = samlSettingsForm.settings; [groupSamlSetting, ...otherSettings] = samlSettingsForm.settings;
expect(otherSettings.every(s => s.value)).toBe(true); expect(otherSettings.every((s) => s.value)).toBe(true);
expect(otherSettings.every(s => s.toggle.hasAttribute('disabled'))).toBe(true); expect(otherSettings.every((s) => s.toggle.hasAttribute('disabled'))).toBe(true);
}); });
}); });
}); });
...@@ -42,7 +42,7 @@ describe('SCIMTokenToggleArea', () => { ...@@ -42,7 +42,7 @@ describe('SCIMTokenToggleArea', () => {
}); });
describe('generateSCIMToken', () => { describe('generateSCIMToken', () => {
it('toggles the generate and scim token forms', done => { it('toggles the generate and scim token forms', (done) => {
scimTokenToggleArea scimTokenToggleArea
.generateSCIMToken() .generateSCIMToken()
.then(() => { .then(() => {
...@@ -53,7 +53,7 @@ describe('SCIMTokenToggleArea', () => { ...@@ -53,7 +53,7 @@ describe('SCIMTokenToggleArea', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('populates the scim form with the token data', done => { it('populates the scim form with the token data', (done) => {
scimTokenToggleArea scimTokenToggleArea
.generateSCIMToken() .generateSCIMToken()
.then(() => { .then(() => {
...@@ -74,7 +74,7 @@ describe('SCIMTokenToggleArea', () => { ...@@ -74,7 +74,7 @@ describe('SCIMTokenToggleArea', () => {
expect(mockGenerateNewSCIMToken).not.toHaveBeenCalled(); 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); jest.spyOn(window, 'confirm').mockReturnValue(true);
scimTokenToggleArea scimTokenToggleArea
......
...@@ -55,7 +55,7 @@ describe('Security Configuration App', () => { ...@@ -55,7 +55,7 @@ describe('Security Configuration App', () => {
const getFeaturesTable = () => wrapper.find({ ref: 'securityControlTable' }); const getFeaturesTable = () => wrapper.find({ ref: 'securityControlTable' });
const getFeaturesRows = () => getFeaturesTable().findAll('tbody tr'); const getFeaturesRows = () => getFeaturesTable().findAll('tbody tr');
const getAlert = () => wrapper.find(GlAlert); const getAlert = () => wrapper.find(GlAlert);
const getRowCells = row => { const getRowCells = (row) => {
const [feature, status, manage] = row.findAll('td').wrappers; const [feature, status, manage] = row.findAll('td').wrappers;
return { feature, status, manage }; return { feature, status, manage };
}; };
......
...@@ -9,7 +9,7 @@ describe('FeatureStatus component', () => { ...@@ -9,7 +9,7 @@ describe('FeatureStatus component', () => {
let wrapper; let wrapper;
let feature; let feature;
const createComponent = options => { const createComponent = (options) => {
wrapper = shallowMount(FeatureStatus, options); wrapper = shallowMount(FeatureStatus, options);
}; };
......
export const generateFeatures = (n, overrides = {}) => { export const generateFeatures = (n, overrides = {}) => {
return [...Array(n).keys()].map(i => ({ return [...Array(n).keys()].map((i) => ({
type: `scan-type-${i}`, type: `scan-type-${i}`,
name: `name-feature-${i}`, name: `name-feature-${i}`,
description: `description-feature-${i}`, description: `description-feature-${i}`,
......
...@@ -10,7 +10,7 @@ describe('ManageFeature component', () => { ...@@ -10,7 +10,7 @@ describe('ManageFeature component', () => {
let wrapper; let wrapper;
let feature; let feature;
const createComponent = options => { const createComponent = (options) => {
wrapper = shallowMount( wrapper = shallowMount(
ManageFeature, ManageFeature,
merge( merge(
...@@ -30,7 +30,7 @@ describe('ManageFeature component', () => { ...@@ -30,7 +30,7 @@ describe('ManageFeature component', () => {
}); });
const findCreateMergeRequestButton = () => wrapper.find(CreateMergeRequestButton); 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', () => { describe('given sastConfigurationUi feature flag is enabled', () => {
const featureFlagEnabled = { const featureFlagEnabled = {
......
...@@ -56,7 +56,7 @@ describe('EE - DastProfilesList', () => { ...@@ -56,7 +56,7 @@ describe('EE - DastProfilesList', () => {
const getAllLoadingIndicators = () => withinComponent().queryAllByTestId('loadingIndicator'); const getAllLoadingIndicators = () => withinComponent().queryAllByTestId('loadingIndicator');
const getErrorMessage = () => withinComponent().queryByText(TEST_ERROR_MESSAGE); const getErrorMessage = () => withinComponent().queryByText(TEST_ERROR_MESSAGE);
const getErrorDetails = () => withinComponent().queryByRole('list', { name: /error details/i }); const getErrorDetails = () => withinComponent().queryByRole('list', { name: /error details/i });
const getDeleteButtonWithin = element => const getDeleteButtonWithin = (element) =>
createWrapper(within(element).queryByRole('button', { name: /delete/i })); createWrapper(within(element).queryByRole('button', { name: /delete/i }));
const getModal = () => wrapper.find(GlModal); const getModal = () => wrapper.find(GlModal);
...@@ -111,7 +111,7 @@ describe('EE - DastProfilesList', () => { ...@@ -111,7 +111,7 @@ describe('EE - DastProfilesList', () => {
}); });
describe('with existing profiles', () => { describe('with existing profiles', () => {
const getTableRowForProfile = profile => getAllTableRows()[profiles.indexOf(profile)]; const getTableRowForProfile = (profile) => getAllTableRows()[profiles.indexOf(profile)];
describe('profiles list', () => { describe('profiles list', () => {
beforeEach(() => { beforeEach(() => {
...@@ -127,7 +127,7 @@ describe('EE - DastProfilesList', () => { ...@@ -127,7 +127,7 @@ describe('EE - DastProfilesList', () => {
expect(getAllTableRows()).toHaveLength(profiles.length); 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; const [profileCell, targetUrlCell, , actionsCell] = getTableRowForProfile(profile).cells;
expect(profileCell.innerText).toContain(profile.profileName); expect(profileCell.innerText).toContain(profile.profileName);
...@@ -150,7 +150,7 @@ describe('EE - DastProfilesList', () => { ...@@ -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; const [profileCell, , , actionsCell] = getTableRowForProfile(profile).cells;
expect(profileCell.innerHTML).toContain(`<b>${profile.profileName}</b>`); expect(profileCell.innerHTML).toContain(`<b>${profile.profileName}</b>`);
...@@ -184,7 +184,7 @@ describe('EE - DastProfilesList', () => { ...@@ -184,7 +184,7 @@ describe('EE - DastProfilesList', () => {
}); });
}); });
describe.each(profiles)('delete profile', profile => { describe.each(profiles)('delete profile', (profile) => {
beforeEach(() => { beforeEach(() => {
createFullComponent({ propsData: { profiles } }); createFullComponent({ propsData: { profiles } });
}); });
......
...@@ -53,9 +53,9 @@ describe('EE - DastProfiles', () => { ...@@ -53,9 +53,9 @@ describe('EE - DastProfiles', () => {
const createFullComponent = createComponentFactory(mount); const createFullComponent = createComponentFactory(mount);
const withinComponent = () => within(wrapper.element); 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 getDropdownComponent = () => wrapper.find(GlDropdown);
const getSiteProfilesDropdownItem = text => const getSiteProfilesDropdownItem = (text) =>
within(getDropdownComponent().element).queryByText(text); within(getDropdownComponent().element).queryByText(text);
const getTabsComponent = () => wrapper.find(GlTabs); const getTabsComponent = () => wrapper.find(GlTabs);
const getTab = ({ tabName, selected }) => const getTab = ({ tabName, selected }) =>
......
...@@ -33,7 +33,7 @@ describe('EE - DastSiteProfileList', () => { ...@@ -33,7 +33,7 @@ describe('EE - DastSiteProfileList', () => {
isLoading: false, isLoading: false,
}; };
const createMockApolloProvider = handlers => { const createMockApolloProvider = (handlers) => {
localVue.use(VueApollo); localVue.use(VueApollo);
requestHandlers = handlers; requestHandlers = handlers;
return createApolloProvider([[dastSiteValidationsQuery, requestHandlers.dastSiteValidations]]); return createApolloProvider([[dastSiteValidationsQuery, requestHandlers.dastSiteValidations]]);
...@@ -67,7 +67,7 @@ describe('EE - DastSiteProfileList', () => { ...@@ -67,7 +67,7 @@ describe('EE - DastSiteProfileList', () => {
return tableBody; return tableBody;
}; };
const getAllTableRows = () => within(getTableBody()).getAllByRole('row'); 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); const findProfileList = () => wrapper.find(ProfilesList);
...@@ -193,7 +193,7 @@ describe('EE - DastSiteProfileList', () => { ...@@ -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; const [, , validationStatusCell, actionsCell] = getTableRowForProfile(profile).cells;
expect(within(actionsCell).queryByRole('button', { name: /validate/i })).toBe(null); expect(within(actionsCell).queryByRole('button', { name: /validate/i })).toBe(null);
......
...@@ -36,7 +36,7 @@ describe('DAST Scanner Profile', () => { ...@@ -36,7 +36,7 @@ describe('DAST Scanner Profile', () => {
let wrapper; let wrapper;
const withinComponent = () => within(wrapper.element); 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 findForm = () => wrapper.find(GlForm);
const findProfileNameInput = () => findByTestId('profile-name-input'); const findProfileNameInput = () => findByTestId('profile-name-input');
...@@ -50,7 +50,7 @@ describe('DAST Scanner Profile', () => { ...@@ -50,7 +50,7 @@ describe('DAST Scanner Profile', () => {
const findAlert = () => wrapper.find(GlAlert); const findAlert = () => wrapper.find(GlAlert);
const submitForm = () => findForm().vm.$emit('submit', { preventDefault: () => {} }); const submitForm = () => findForm().vm.$emit('submit', { preventDefault: () => {} });
const componentFactory = (mountFn = shallowMount) => options => { const componentFactory = (mountFn = shallowMount) => (options) => {
wrapper = mountFn( wrapper = mountFn(
DastScannerProfileForm, DastScannerProfileForm,
merge( merge(
...@@ -120,7 +120,7 @@ describe('DAST Scanner Profile', () => { ...@@ -120,7 +120,7 @@ describe('DAST Scanner Profile', () => {
createFullComponent(); 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); await finder().find('input').setValue(value);
expect(wrapper.text()).toContain(errorMessage); expect(wrapper.text()).toContain(errorMessage);
...@@ -242,7 +242,7 @@ describe('DAST Scanner Profile', () => { ...@@ -242,7 +242,7 @@ describe('DAST Scanner Profile', () => {
const alert = findAlert(); const alert = findAlert();
expect(alert.exists()).toBe(true); expect(alert.exists()).toBe(true);
errors.forEach(error => { errors.forEach((error) => {
expect(alert.text()).toContain(error); expect(alert.text()).toContain(error);
}); });
}); });
......
...@@ -24,7 +24,7 @@ describe('DastSiteAuthSection', () => { ...@@ -24,7 +24,7 @@ describe('DastSiteAuthSection', () => {
wrapper.destroy(); wrapper.destroy();
}); });
const findByNameAttribute = name => wrapper.find(`[name="${name}"]`); const findByNameAttribute = (name) => wrapper.find(`[name="${name}"]`);
const findAuthForm = () => wrapper.findByTestId('auth-form'); const findAuthForm = () => wrapper.findByTestId('auth-form');
const findAuthCheckbox = () => wrapper.find(GlFormCheckbox); const findAuthCheckbox = () => wrapper.find(GlFormCheckbox);
...@@ -41,7 +41,7 @@ describe('DastSiteAuthSection', () => { ...@@ -41,7 +41,7 @@ describe('DastSiteAuthSection', () => {
describe('authentication toggle', () => { describe('authentication toggle', () => {
it.each([true, false])( it.each([true, false])(
'is set correctly when the "authEnabled" field is set to "%s"', 'is set correctly when the "authEnabled" field is set to "%s"',
authEnabled => { (authEnabled) => {
createComponent({ fields: { authEnabled } }); createComponent({ fields: { authEnabled } });
expect(findAuthCheckbox().vm.$attrs.checked).toBe(authEnabled); expect(findAuthCheckbox().vm.$attrs.checked).toBe(authEnabled);
}, },
...@@ -55,7 +55,7 @@ describe('DastSiteAuthSection', () => { ...@@ -55,7 +55,7 @@ describe('DastSiteAuthSection', () => {
it.each([true, false])( it.each([true, false])(
'makes the component emit an "input" event when changed', 'makes the component emit an "input" event when changed',
async enabled => { async (enabled) => {
await setAuthentication({ enabled }); await setAuthentication({ enabled });
expect(getLatestInputEventPayload().fields.authEnabled.value).toBe(enabled); expect(getLatestInputEventPayload().fields.authEnabled.value).toBe(enabled);
}, },
...@@ -77,7 +77,7 @@ describe('DastSiteAuthSection', () => { ...@@ -77,7 +77,7 @@ describe('DastSiteAuthSection', () => {
const inputFieldNames = Object.keys(inputFieldsWithValues); const inputFieldNames = Object.keys(inputFieldsWithValues);
describe.each(inputFieldNames)('input field "%s"', inputFieldName => { describe.each(inputFieldNames)('input field "%s"', (inputFieldName) => {
it('is rendered', () => { it('is rendered', () => {
expect(findByNameAttribute(inputFieldName).exists()).toBe(true); expect(findByNameAttribute(inputFieldName).exists()).toBe(true);
}); });
......
...@@ -25,7 +25,7 @@ describe('ConfigurationForm component', () => { ...@@ -25,7 +25,7 @@ describe('ConfigurationForm component', () => {
let pendingPromiseResolvers; let pendingPromiseResolvers;
const fulfillPendingPromises = () => { const fulfillPendingPromises = () => {
pendingPromiseResolvers.forEach(resolve => resolve()); pendingPromiseResolvers.forEach((resolve) => resolve());
}; };
const createComponent = ({ mutationResult, ...options } = {}) => { const createComponent = ({ mutationResult, ...options } = {}) => {
...@@ -47,7 +47,7 @@ describe('ConfigurationForm component', () => { ...@@ -47,7 +47,7 @@ describe('ConfigurationForm component', () => {
$apollo: { $apollo: {
mutate: jest.fn( mutate: jest.fn(
() => () =>
new Promise(resolve => { new Promise((resolve) => {
pendingPromiseResolvers.push(() => pendingPromiseResolvers.push(() =>
resolve({ resolve({
data: { configureSast: mutationResult }, data: { configureSast: mutationResult },
......
...@@ -34,7 +34,7 @@ describe('DynamicFields component', () => { ...@@ -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; let entities;
beforeEach(() => { beforeEach(() => {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @returns {Object[]} * @returns {Object[]}
*/ */
export const makeEntities = (count, changes) => export const makeEntities = (count, changes) =>
[...Array(count).keys()].map(i => ({ [...Array(count).keys()].map((i) => ({
defaultValue: `defaultValue${i}`, defaultValue: `defaultValue${i}`,
description: `description${i}`, description: `description${i}`,
field: `field${i}`, field: `field${i}`,
...@@ -28,7 +28,7 @@ export const makeEntities = (count, changes) => ...@@ -28,7 +28,7 @@ export const makeEntities = (count, changes) =>
* @returns {Object[]} * @returns {Object[]}
*/ */
export const makeAnalyzerEntities = (count, changes) => export const makeAnalyzerEntities = (count, changes) =>
[...Array(count).keys()].map(i => ({ [...Array(count).keys()].map((i) => ({
name: `nameValue${i}`, name: `nameValue${i}`,
label: `label${i}`, label: `label${i}`,
description: `description${i}`, description: `description${i}`,
......
...@@ -22,11 +22,11 @@ describe('isValidConfigurationEntity', () => { ...@@ -22,11 +22,11 @@ describe('isValidConfigurationEntity', () => {
...makeEntities(1, { defaultValue: undefined }), ...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); 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); expect(isValidConfigurationEntity(invalidEntity)).toBe(false);
}); });
}); });
...@@ -45,11 +45,11 @@ describe('isValidAnalyzerEntity', () => { ...@@ -45,11 +45,11 @@ describe('isValidAnalyzerEntity', () => {
...makeAnalyzerEntities(1, { enabled: '' }), ...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); 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); expect(isValidAnalyzerEntity(invalidEntity)).toBe(false);
}); });
}); });
......
...@@ -31,7 +31,7 @@ describe('AutoFix Help Text component', () => { ...@@ -31,7 +31,7 @@ describe('AutoFix Help Text component', () => {
wrapper = createWrapper(); 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', () => { it('popover should have wrapping div as target', () => {
expect( expect(
......
...@@ -50,7 +50,7 @@ describe('Filter Body component', () => { ...@@ -50,7 +50,7 @@ describe('Filter Body component', () => {
}); });
describe('search box', () => { 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 }); createComponent({ showSearchBox: show });
expect(searchBox().exists()).toBe(show); expect(searchBox().exists()).toBe(show);
......
...@@ -38,7 +38,7 @@ describe('Filter Item component', () => { ...@@ -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 }); createWrapper({ isChecked });
expect(dropdownItem().props('isChecked')).toBe(isChecked); expect(dropdownItem().props('isChecked')).toBe(isChecked);
}); });
......
...@@ -7,7 +7,7 @@ const localVue = createLocalVue(); ...@@ -7,7 +7,7 @@ const localVue = createLocalVue();
localVue.use(VueRouter); localVue.use(VueRouter);
const router = new VueRouter(); const router = new VueRouter();
const generateOptions = length => const generateOptions = (length) =>
Array.from({ length }).map((_, i) => ({ name: `Option ${i}`, id: `option-${i}`, index: i })); Array.from({ length }).map((_, i) => ({ name: `Option ${i}`, id: `option-${i}`, index: i }));
const filter = { const filter = {
...@@ -17,8 +17,8 @@ const filter = { ...@@ -17,8 +17,8 @@ const filter = {
allOption: { id: 'allOptionId' }, allOption: { id: 'allOptionId' },
defaultOptions: [], defaultOptions: [],
}; };
const optionsAt = indexes => filter.options.filter(x => indexes.includes(x.index)); const optionsAt = (indexes) => filter.options.filter((x) => indexes.includes(x.index));
const optionIdsAt = indexes => optionsAt(indexes).map(x => x.id); const optionIdsAt = (indexes) => optionsAt(indexes).map((x) => x.id);
describe('Standard Filter component', () => { describe('Standard Filter component', () => {
let wrapper; let wrapper;
...@@ -32,9 +32,9 @@ describe('Standard Filter component', () => { ...@@ -32,9 +32,9 @@ describe('Standard Filter component', () => {
}; };
const dropdownItems = () => wrapper.findAll('[data-testid="filterOption"]'); 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 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 filterQuery = () => wrapper.vm.$route.query[filter.id];
const filterBody = () => wrapper.find(FilterBody); const filterBody = () => wrapper.find(FilterBody);
...@@ -43,13 +43,13 @@ describe('Standard Filter component', () => { ...@@ -43,13 +43,13 @@ describe('Standard Filter component', () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
}; };
const clickItemAt = async index => { const clickItemAt = async (index) => {
dropdownItemAt(index).vm.$emit('click'); dropdownItemAt(index).vm.$emit('click');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
}; };
const expectSelectedItems = indexes => { const expectSelectedItems = (indexes) => {
const checkedIndexes = dropdownItems().wrappers.map(item => isChecked(item)); const checkedIndexes = dropdownItems().wrappers.map((item) => isChecked(item));
const expectedIndexes = Array.from({ length: checkedIndexes.length }).map((_, index) => const expectedIndexes = Array.from({ length: checkedIndexes.length }).map((_, index) =>
indexes.includes(index), indexes.includes(index),
); );
...@@ -59,7 +59,7 @@ describe('Standard Filter component', () => { ...@@ -59,7 +59,7 @@ describe('Standard Filter component', () => {
const expectAllOptionSelected = () => { const expectAllOptionSelected = () => {
expect(isChecked(allOptionItem())).toBe(true); 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); const expectedIndexes = new Array(checkedIndexes.length).fill(false);
expect(checkedIndexes).toEqual(expectedIndexes); expect(checkedIndexes).toEqual(expectedIndexes);
...@@ -106,13 +106,13 @@ describe('Standard Filter component', () => { ...@@ -106,13 +106,13 @@ describe('Standard Filter component', () => {
}); });
it('filters options when something is typed in the search box', async () => { 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); createWrapper({}, true);
filterBody().vm.$emit('input', '1'); filterBody().vm.$emit('input', '1');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(dropdownItems()).toHaveLength(3); 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', () => { ...@@ -177,7 +177,7 @@ describe('Standard Filter component', () => {
}); });
describe('filter querystring', () => { 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 // window.history.back() won't change the location nor fire the popstate event, so we need
// to fake it by doing it manually. // to fake it by doing it manually.
router.replace({ query: { [filter.id]: ids } }); router.replace({ query: { [filter.id]: ids } });
...@@ -190,7 +190,7 @@ describe('Standard Filter component', () => { ...@@ -190,7 +190,7 @@ describe('Standard Filter component', () => {
createWrapper(); createWrapper();
const clickedIds = []; const clickedIds = [];
[1, 3, 5].forEach(index => { [1, 3, 5].forEach((index) => {
clickItemAt(index); clickItemAt(index);
clickedIds.push(optionIdsAt([index])[0]); clickedIds.push(optionIdsAt([index])[0]);
......
...@@ -4,9 +4,9 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -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 ProjectList from 'ee/security_dashboard/components/first_class_project_manager/project_list.vue';
import ProjectAvatar from '~/vue_shared/components/project_avatar/default.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 = {}) => const generateMockProjects = (projectsCount, mockProject = {}) =>
getArrayWithLength(projectsCount).map(id => ({ id, ...mockProject })); getArrayWithLength(projectsCount).map((id) => ({ id, ...mockProject }));
describe('Project List component', () => { describe('Project List component', () => {
let wrapper; let wrapper;
...@@ -49,7 +49,7 @@ describe('Project List component', () => { ...@@ -49,7 +49,7 @@ describe('Project List component', () => {
it.each([0, 1, 2])( it.each([0, 1, 2])(
'renders a list of projects and displays a count of how many there are', 'renders a list of projects and displays a count of how many there are',
projectsCount => { (projectsCount) => {
factory({ projects: generateMockProjects(projectsCount) }); factory({ projects: generateMockProjects(projectsCount) });
expect(getAllProjectItems()).toHaveLength(projectsCount); expect(getAllProjectItems()).toHaveLength(projectsCount);
......
...@@ -47,7 +47,7 @@ describe('First class Project Security Dashboard component', () => { ...@@ -47,7 +47,7 @@ describe('First class Project Security Dashboard component', () => {
const findCsvExportButton = () => wrapper.find(CsvExportButton); const findCsvExportButton = () => wrapper.find(CsvExportButton);
const findAutoFixUserCallout = () => wrapper.find(AutoFixUserCallout); const findAutoFixUserCallout = () => wrapper.find(AutoFixUserCallout);
const createComponent = options => { const createComponent = (options) => {
wrapper = shallowMount(FirstClassProjectSecurityDashboard, { wrapper = shallowMount(FirstClassProjectSecurityDashboard, {
propsData: { propsData: {
...props, ...props,
......
...@@ -27,7 +27,7 @@ describe('Vulnerability Severity component', () => { ...@@ -27,7 +27,7 @@ describe('Vulnerability Severity component', () => {
const findAccordionItemsText = () => const findAccordionItemsText = () =>
wrapper wrapper
.findAll('[data-testid="vulnerability-severity-groups"]') .findAll('[data-testid="vulnerability-severity-groups"]')
.wrappers.map(item => trimText(item.text())); .wrappers.map((item) => trimText(item.text()));
const createApolloProvider = (...queries) => { const createApolloProvider = (...queries) => {
return createMockApollo([...queries]); return createMockApollo([...queries]);
...@@ -53,8 +53,8 @@ describe('Vulnerability Severity component', () => { ...@@ -53,8 +53,8 @@ describe('Vulnerability Severity component', () => {
const findHelpLink = () => wrapper.find(GlLink); const findHelpLink = () => wrapper.find(GlLink);
const findHeader = () => wrapper.find('h4'); const findHeader = () => wrapper.find('h4');
const findDescription = () => wrapper.find('p'); const findDescription = () => wrapper.find('p');
const findAccordionItemByGrade = grade => wrapper.find({ ref: `accordionItem${grade}` }); const findAccordionItemByGrade = (grade) => wrapper.find({ ref: `accordionItem${grade}` });
const findProjectName = accordion => accordion.findAll(GlLink); const findProjectName = (accordion) => accordion.findAll(GlLink);
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
......
...@@ -11,7 +11,7 @@ const illustrations = { ...@@ -11,7 +11,7 @@ const illustrations = {
describe('LoadingError component', () => { describe('LoadingError component', () => {
let wrapper; let wrapper;
const createWrapper = errorCode => { const createWrapper = (errorCode) => {
wrapper = shallowMount(LoadingError, { wrapper = shallowMount(LoadingError, {
propsData: { propsData: {
errorCode, errorCode,
...@@ -25,7 +25,7 @@ describe('LoadingError component', () => { ...@@ -25,7 +25,7 @@ describe('LoadingError component', () => {
wrapper = null; wrapper = null;
}); });
describe.each([401, 403])('with error code %s', errorCode => { describe.each([401, 403])('with error code %s', (errorCode) => {
beforeEach(() => { beforeEach(() => {
createWrapper(errorCode); createWrapper(errorCode);
}); });
......
...@@ -24,7 +24,7 @@ describe('Pipeline Security Dashboard component', () => { ...@@ -24,7 +24,7 @@ describe('Pipeline Security Dashboard component', () => {
let store; let store;
let wrapper; let wrapper;
const factory = options => { const factory = (options) => {
store = new Vuex.Store({ store = new Vuex.Store({
modules: { modules: {
vulnerabilities: { vulnerabilities: {
......
...@@ -11,7 +11,7 @@ describe('Pipeline status badge', () => { ...@@ -11,7 +11,7 @@ describe('Pipeline status badge', () => {
const findGlBadge = () => wrapper.find(GlBadge); const findGlBadge = () => wrapper.find(GlBadge);
const findGlIcon = () => wrapper.find(GlIcon); const findGlIcon = () => wrapper.find(GlIcon);
const createProps = securityBuildsFailedCount => ({ pipeline: { securityBuildsFailedCount } }); const createProps = (securityBuildsFailedCount) => ({ pipeline: { securityBuildsFailedCount } });
const createWrapper = (props = {}) => { const createWrapper = (props = {}) => {
wrapper = shallowMount(PipelineStatusBadge, { wrapper = shallowMount(PipelineStatusBadge, {
......
...@@ -15,7 +15,7 @@ describe('Security Charts Layout component', () => { ...@@ -15,7 +15,7 @@ describe('Security Charts Layout component', () => {
const findSlot = () => wrapper.find(`[data-testid="security-charts-layout"]`); const findSlot = () => wrapper.find(`[data-testid="security-charts-layout"]`);
const createWrapper = slots => { const createWrapper = (slots) => {
wrapper = shallowMount(SecurityChartsLayout, { slots }); wrapper = shallowMount(SecurityChartsLayout, { slots });
}; };
......
...@@ -11,7 +11,7 @@ describe('Security Dashboard Layout component', () => { ...@@ -11,7 +11,7 @@ describe('Security Dashboard Layout component', () => {
template: '<p>dummy component</p>', template: '<p>dummy component</p>',
}; };
const createWrapper = slots => { const createWrapper = (slots) => {
wrapper = shallowMount(SecurityDashboardLayout, { slots }); wrapper = shallowMount(SecurityDashboardLayout, { slots });
}; };
......
...@@ -35,7 +35,7 @@ describe('Security Dashboard Table Row', () => { ...@@ -35,7 +35,7 @@ describe('Security Dashboard Table Row', () => {
}); });
const findLoader = () => wrapper.find('.js-skeleton-loader'); 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 findAllIssueCreated = () => wrapper.findAll('[data-testid="issues-icon"]');
const hasSelectedClass = () => wrapper.classes('gl-bg-blue-50'); const hasSelectedClass = () => wrapper.classes('gl-bg-blue-50');
const findCheckbox = () => wrapper.find(GlFormCheckbox); const findCheckbox = () => wrapper.find(GlFormCheckbox);
......
...@@ -26,7 +26,7 @@ describe('Security Dashboard component', () => { ...@@ -26,7 +26,7 @@ describe('Security Dashboard component', () => {
let fetchPipelineJobsSpy; let fetchPipelineJobsSpy;
let store; let store;
const createComponent = props => { const createComponent = (props) => {
wrapper = shallowMount(SecurityDashboard, { wrapper = shallowMount(SecurityDashboard, {
store, store,
stubs: { stubs: {
...@@ -141,14 +141,14 @@ describe('Security Dashboard component', () => { ...@@ -141,14 +141,14 @@ describe('Security Dashboard component', () => {
createComponent(); 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); store.dispatch('vulnerabilities/receiveVulnerabilitiesError', errorCode);
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(wrapper.find(LoadingError).exists()).toBe(true); 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); store.dispatch('vulnerabilities/receiveVulnerabilitiesError', errorCode);
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(wrapper.find(LoadingError).exists()).toBe(false); expect(wrapper.find(LoadingError).exists()).toBe(false);
......
...@@ -11,7 +11,7 @@ describe('Security reports summary component', () => { ...@@ -11,7 +11,7 @@ describe('Security reports summary component', () => {
let wrapper; let wrapper;
const createWrapper = options => { const createWrapper = (options) => {
wrapper = shallowMount(SecurityReportsSummary, { wrapper = shallowMount(SecurityReportsSummary, {
propsData: { propsData: {
summary: {}, summary: {},
......
...@@ -31,7 +31,7 @@ describe('EE Vulnerability Security Scanner Alert', () => { ...@@ -31,7 +31,7 @@ describe('EE Vulnerability Security Scanner Alert', () => {
const withinWrapper = () => within(wrapper.element); const withinWrapper = () => within(wrapper.element);
const findAlert = () => withinWrapper().queryByRole('alert'); const findAlert = () => withinWrapper().queryByRole('alert');
const findById = testId => withinWrapper().getByTestId(testId); const findById = (testId) => withinWrapper().getByTestId(testId);
describe('container', () => { describe('container', () => {
it('renders when disabled scanners are detected', () => { it('renders when disabled scanners are detected', () => {
......
...@@ -88,7 +88,7 @@ describe('Selection Summary component', () => { ...@@ -88,7 +88,7 @@ describe('Selection Summary component', () => {
let mutateMock; let mutateMock;
beforeEach(() => { beforeEach(() => {
mutateMock = jest.fn(data => mutateMock = jest.fn((data) =>
data.variables.id % 2 === 0 ? Promise.resolve() : Promise.reject(), data.variables.id % 2 === 0 ? Promise.resolve() : Promise.reject(),
); );
......
...@@ -50,7 +50,7 @@ describe('Selection Summary', () => { ...@@ -50,7 +50,7 @@ describe('Selection Summary', () => {
const dismissMessage = () => wrapper.find('[data-testid="dismiss-message"]'); const dismissMessage = () => wrapper.find('[data-testid="dismiss-message"]');
const dismissButton = () => wrapper.find(GlButton); const dismissButton = () => wrapper.find(GlButton);
const selectByIndex = index => const selectByIndex = (index) =>
store.commit(`vulnerabilities/${SELECT_VULNERABILITY}`, mockDataVulnerabilities[index].id); store.commit(`vulnerabilities/${SELECT_VULNERABILITY}`, mockDataVulnerabilities[index].id);
it('renders the form', () => { it('renders the form', () => {
......
...@@ -26,7 +26,7 @@ describe('Vulnerabilities count list component', () => { ...@@ -26,7 +26,7 @@ describe('Vulnerabilities count list component', () => {
it('passes the isLoading prop to the counts', () => { it('passes the isLoading prop to the counts', () => {
wrapper = createWrapper({ propsData: { isLoading: true, vulnerabilitiesCount: {} } }); wrapper = createWrapper({ propsData: { isLoading: true, vulnerabilitiesCount: {} } });
findVulnerability().wrappers.forEach(component => { findVulnerability().wrappers.forEach((component) => {
expect(component.props('isLoading')).toBe(true); expect(component.props('isLoading')).toBe(true);
}); });
}); });
...@@ -60,7 +60,7 @@ describe('Vulnerabilities count list component', () => { ...@@ -60,7 +60,7 @@ describe('Vulnerabilities count list component', () => {
}); });
it('sets the isLoading prop false and passes it down', () => { it('sets the isLoading prop false and passes it down', () => {
findVulnerability().wrappers.forEach(component => { findVulnerability().wrappers.forEach((component) => {
expect(component.props('isLoading')).toBe(false); expect(component.props('isLoading')).toBe(false);
}); });
}); });
......
import filterState from 'ee/security_dashboard/store/modules/filters/state'; import filterState from 'ee/security_dashboard/store/modules/filters/state';
import vulnerabilitiesState from 'ee/security_dashboard/store/modules/vulnerabilities/state'; import vulnerabilitiesState from 'ee/security_dashboard/store/modules/vulnerabilities/state';
export const resetStore = store => { export const resetStore = (store) => {
const newState = { const newState = {
vulnerabilities: vulnerabilitiesState(), vulnerabilities: vulnerabilitiesState(),
filters: filterState(), filters: filterState(),
......
...@@ -36,7 +36,7 @@ describe('getFormattedSummary', () => { ...@@ -36,7 +36,7 @@ describe('getFormattedSummary', () => {
it.each([undefined, [], [1], 'hello world', 123])( it.each([undefined, [], [1], 'hello world', 123])(
'returns an empty array when summary is %s', 'returns an empty array when summary is %s',
summary => { (summary) => {
expect(getFormattedSummary(summary)).toEqual([]); expect(getFormattedSummary(summary)).toEqual([]);
}, },
); );
......
...@@ -7,8 +7,8 @@ import mutations from 'ee/security_dashboard/store/modules/filters/mutations'; ...@@ -7,8 +7,8 @@ import mutations from 'ee/security_dashboard/store/modules/filters/mutations';
import createState from 'ee/security_dashboard/store/modules/filters/state'; import createState from 'ee/security_dashboard/store/modules/filters/state';
import { DISMISSAL_STATES } from 'ee/security_dashboard/store/modules/filters/constants'; import { DISMISSAL_STATES } from 'ee/security_dashboard/store/modules/filters/constants';
const criticalOption = severityFilter.options.find(x => x.id === 'CRITICAL'); const criticalOption = severityFilter.options.find((x) => x.id === 'CRITICAL');
const highOption = severityFilter.options.find(x => x.id === 'HIGH'); const highOption = severityFilter.options.find((x) => x.id === 'HIGH');
const existingFilters = { const existingFilters = {
filter1: ['some', 'value'], filter1: ['some', 'value'],
...@@ -44,7 +44,7 @@ describe('filters module mutations', () => { ...@@ -44,7 +44,7 @@ describe('filters module mutations', () => {
}); });
describe('SET_HIDE_DISMISSED', () => { describe('SET_HIDE_DISMISSED', () => {
it.each(Object.values(DISMISSAL_STATES))(`sets scope filter to "%s"`, value => { it.each(Object.values(DISMISSAL_STATES))(`sets scope filter to "%s"`, (value) => {
mutations[SET_HIDE_DISMISSED](state, value); mutations[SET_HIDE_DISMISSED](state, value);
expect(state.filters.scope).toBe(value); expect(state.filters.scope).toBe(value);
}); });
......
...@@ -17,7 +17,7 @@ describe('pipeling jobs actions', () => { ...@@ -17,7 +17,7 @@ describe('pipeling jobs actions', () => {
describe('setPipelineJobsPath', () => { describe('setPipelineJobsPath', () => {
const pipelineJobsPath = 123; const pipelineJobsPath = 123;
it('should commit the SET_PIPELINE_JOBS_PATH mutation', done => { it('should commit the SET_PIPELINE_JOBS_PATH mutation', (done) => {
testAction( testAction(
actions.setPipelineJobsPath, actions.setPipelineJobsPath,
pipelineJobsPath, pipelineJobsPath,
...@@ -37,7 +37,7 @@ describe('pipeling jobs actions', () => { ...@@ -37,7 +37,7 @@ describe('pipeling jobs actions', () => {
describe('setProjectId', () => { describe('setProjectId', () => {
const projectId = 123; const projectId = 123;
it('should commit the SET_PIPELINE_JOBS_PATH mutation', done => { it('should commit the SET_PIPELINE_JOBS_PATH mutation', (done) => {
testAction( testAction(
actions.setProjectId, actions.setProjectId,
projectId, projectId,
...@@ -57,7 +57,7 @@ describe('pipeling jobs actions', () => { ...@@ -57,7 +57,7 @@ describe('pipeling jobs actions', () => {
describe('setPipelineId', () => { describe('setPipelineId', () => {
const pipelineId = 123; const pipelineId = 123;
it('should commit the SET_PIPELINE_ID mutation', done => { it('should commit the SET_PIPELINE_ID mutation', (done) => {
testAction( testAction(
actions.setPipelineId, actions.setPipelineId,
pipelineId, pipelineId,
...@@ -92,7 +92,7 @@ describe('pipeling jobs actions', () => { ...@@ -92,7 +92,7 @@ describe('pipeling jobs actions', () => {
mock.onGet(state.pipelineJobsPath).replyOnce(200, jobs); mock.onGet(state.pipelineJobsPath).replyOnce(200, jobs);
}); });
it('should commit the request and success mutations', done => { it('should commit the request and success mutations', (done) => {
testAction( testAction(
actions.fetchPipelineJobs, actions.fetchPipelineJobs,
{}, {},
...@@ -115,7 +115,7 @@ describe('pipeling jobs actions', () => { ...@@ -115,7 +115,7 @@ describe('pipeling jobs actions', () => {
mock.onGet('/api/undefined/projects/123/pipelines/321/jobs').replyOnce(200, jobs); mock.onGet('/api/undefined/projects/123/pipelines/321/jobs').replyOnce(200, jobs);
}); });
it('should commit the request and success mutations', done => { it('should commit the request and success mutations', (done) => {
state.pipelineJobsPath = ''; state.pipelineJobsPath = '';
state.projectId = 123; state.projectId = 123;
state.pipelineId = 321; state.pipelineId = 321;
...@@ -142,7 +142,7 @@ describe('pipeling jobs actions', () => { ...@@ -142,7 +142,7 @@ describe('pipeling jobs actions', () => {
mock.onGet(state.pipelineJobsPath).replyOnce(200, jobs); mock.onGet(state.pipelineJobsPath).replyOnce(200, jobs);
}); });
it('should commit RECEIVE_PIPELINE_JOBS_ERROR mutation', done => { it('should commit RECEIVE_PIPELINE_JOBS_ERROR mutation', (done) => {
state.pipelineJobsPath = ''; state.pipelineJobsPath = '';
testAction( testAction(
...@@ -165,7 +165,7 @@ describe('pipeling jobs actions', () => { ...@@ -165,7 +165,7 @@ describe('pipeling jobs actions', () => {
mock.onGet(state.pipelineJobsPath).replyOnce(200, jobs); mock.onGet(state.pipelineJobsPath).replyOnce(200, jobs);
}); });
it('should commit RECEIVE_PIPELINE_JOBS_ERROR mutation', done => { it('should commit RECEIVE_PIPELINE_JOBS_ERROR mutation', (done) => {
state.pipelineJobsPath = ''; state.pipelineJobsPath = '';
state.projectId = undefined; state.projectId = undefined;
state.pipelineId = undefined; state.pipelineId = undefined;
...@@ -190,7 +190,7 @@ describe('pipeling jobs actions', () => { ...@@ -190,7 +190,7 @@ describe('pipeling jobs actions', () => {
mock.onGet(state.pipelineJobsPath).replyOnce(404); mock.onGet(state.pipelineJobsPath).replyOnce(404);
}); });
it('should commit REQUEST_PIPELINE_JOBS and RECEIVE_PIPELINE_JOBS_ERROR mutation', done => { it('should commit REQUEST_PIPELINE_JOBS and RECEIVE_PIPELINE_JOBS_ERROR mutation', (done) => {
testAction( testAction(
actions.fetchPipelineJobs, actions.fetchPipelineJobs,
{}, {},
......
...@@ -10,7 +10,7 @@ import axios from '~/lib/utils/axios_utils'; ...@@ -10,7 +10,7 @@ import axios from '~/lib/utils/axios_utils';
jest.mock('~/flash'); jest.mock('~/flash');
describe('EE projectSelector actions', () => { describe('EE projectSelector actions', () => {
const getMockProjects = n => [...Array(n).keys()].map(i => ({ id: i, name: `project-${i}` })); const getMockProjects = (n) => [...Array(n).keys()].map((i) => ({ id: i, name: `project-${i}` }));
const mockAddEndpoint = 'mock-add_endpoint'; const mockAddEndpoint = 'mock-add_endpoint';
const mockListEndpoint = 'mock-list_endpoint'; const mockListEndpoint = 'mock-list_endpoint';
...@@ -45,7 +45,7 @@ describe('EE projectSelector actions', () => { ...@@ -45,7 +45,7 @@ describe('EE projectSelector actions', () => {
}); });
describe('toggleSelectedProject', () => { describe('toggleSelectedProject', () => {
it('adds a project to selectedProjects if it does not already exist in the list', done => { it('adds a project to selectedProjects if it does not already exist in the list', (done) => {
const payload = getMockProjects(1); const payload = getMockProjects(1);
testAction( testAction(
...@@ -459,7 +459,7 @@ describe('EE projectSelector actions', () => { ...@@ -459,7 +459,7 @@ describe('EE projectSelector actions', () => {
describe('fetchSearchResults', () => { describe('fetchSearchResults', () => {
it.each([null, undefined, false, NaN, 0, ''])( it.each([null, undefined, false, NaN, 0, ''])(
'dispatches setMinimumQueryMessage if the search query is falsy', 'dispatches setMinimumQueryMessage if the search query is falsy',
searchQuery => { (searchQuery) => {
state.searchQuery = searchQuery; state.searchQuery = searchQuery;
return testAction( return testAction(
...@@ -481,7 +481,7 @@ describe('EE projectSelector actions', () => { ...@@ -481,7 +481,7 @@ describe('EE projectSelector actions', () => {
it.each(['a', 'aa'])( it.each(['a', 'aa'])(
'dispatches setMinimumQueryMessage if the search query was not long enough', 'dispatches setMinimumQueryMessage if the search query was not long enough',
shortSearchQuery => { (shortSearchQuery) => {
state.searchQuery = shortSearchQuery; state.searchQuery = shortSearchQuery;
return testAction( return testAction(
......
...@@ -28,7 +28,7 @@ describe('EE Project Selector store utils', () => { ...@@ -28,7 +28,7 @@ describe('EE Project Selector store utils', () => {
it.each([{}, { foo: 'foo' }, null, undefined, false])( it.each([{}, { foo: 'foo' }, null, undefined, false])(
'returns the original input if it does not contain a header property', 'returns the original input if it does not contain a header property',
input => { (input) => {
expect(addPageInfo(input)).toBe(input); expect(addPageInfo(input)).toBe(input);
}, },
); );
......
...@@ -34,16 +34,16 @@ describe('projects actions', () => { ...@@ -34,16 +34,16 @@ describe('projects actions', () => {
}; };
beforeEach(() => { beforeEach(() => {
mock.onGet(state.projectsEndpoint).replyOnce(config => { mock.onGet(state.projectsEndpoint).replyOnce((config) => {
const hasExpectedParams = Object.keys(expectedParams).every( const hasExpectedParams = Object.keys(expectedParams).every(
param => config.params[param] === expectedParams[param], (param) => config.params[param] === expectedParams[param],
); );
return hasExpectedParams ? [200, data] : [400]; return hasExpectedParams ? [200, data] : [400];
}); });
}); });
it('should dispatch the request and success actions', done => { it('should dispatch the request and success actions', (done) => {
testAction( testAction(
actions.fetchProjects, actions.fetchProjects,
{}, {},
...@@ -70,7 +70,7 @@ describe('projects actions', () => { ...@@ -70,7 +70,7 @@ describe('projects actions', () => {
mock.onGet(state.projectsEndpoint, { page: '2' }).replyOnce(200, [2]); mock.onGet(state.projectsEndpoint, { page: '2' }).replyOnce(200, [2]);
}); });
it('should dispatch the request and success actions', done => { it('should dispatch the request and success actions', (done) => {
testAction( testAction(
actions.fetchProjects, actions.fetchProjects,
{}, {},
...@@ -93,7 +93,7 @@ describe('projects actions', () => { ...@@ -93,7 +93,7 @@ describe('projects actions', () => {
mock.onGet(state.projectsEndpoint).replyOnce(404, {}); mock.onGet(state.projectsEndpoint).replyOnce(404, {});
}); });
it('should dispatch the request and error actions', done => { it('should dispatch the request and error actions', (done) => {
testAction( testAction(
actions.fetchProjects, actions.fetchProjects,
{}, {},
...@@ -110,14 +110,14 @@ describe('projects actions', () => { ...@@ -110,14 +110,14 @@ describe('projects actions', () => {
state.projectsEndpoint = ''; state.projectsEndpoint = '';
}); });
it('should not do anything', done => { it('should not do anything', (done) => {
testAction(actions.fetchProjects, {}, state, [], [], done); testAction(actions.fetchProjects, {}, state, [], [], done);
}); });
}); });
}); });
describe('receiveProjectsSuccess', () => { describe('receiveProjectsSuccess', () => {
it('should commit the success mutation', done => { it('should commit the success mutation', (done) => {
const state = createState(); const state = createState();
testAction( testAction(
...@@ -137,7 +137,7 @@ describe('projects actions', () => { ...@@ -137,7 +137,7 @@ describe('projects actions', () => {
}); });
describe('receiveProjectsError', () => { describe('receiveProjectsError', () => {
it('should commit the error mutation', done => { it('should commit the error mutation', (done) => {
const state = createState(); const state = createState();
testAction( testAction(
...@@ -152,7 +152,7 @@ describe('projects actions', () => { ...@@ -152,7 +152,7 @@ describe('projects actions', () => {
}); });
describe('requestProjects', () => { describe('requestProjects', () => {
it('should commit the request mutation', done => { it('should commit the request mutation', (done) => {
const state = createState(); const state = createState();
testAction(actions.requestProjects, {}, state, [{ type: types.REQUEST_PROJECTS }], [], done); testAction(actions.requestProjects, {}, state, [{ type: types.REQUEST_PROJECTS }], [], done);
...@@ -160,7 +160,7 @@ describe('projects actions', () => { ...@@ -160,7 +160,7 @@ describe('projects actions', () => {
}); });
describe('setProjectsEndpoint', () => { describe('setProjectsEndpoint', () => {
it('should commit the correct mutuation', done => { it('should commit the correct mutuation', (done) => {
const state = createState(); const state = createState();
testAction( testAction(
......
...@@ -59,7 +59,7 @@ describe('Unscanned projects getters', () => { ...@@ -59,7 +59,7 @@ describe('Unscanned projects getters', () => {
expect(result).toEqual( expect(result).toEqual(
groupByDateRanges({ groupByDateRanges({
ranges: UNSCANNED_PROJECTS_DATE_RANGES, ranges: UNSCANNED_PROJECTS_DATE_RANGES,
dateFn: x => x.securityTestsLastSuccessfulRun, dateFn: (x) => x.securityTestsLastSuccessfulRun,
projects, projects,
}), }),
); );
......
...@@ -43,7 +43,7 @@ describe('Project scanning store utils', () => { ...@@ -43,7 +43,7 @@ describe('Project scanning store utils', () => {
const groups = groupByDateRanges({ const groups = groupByDateRanges({
ranges, ranges,
dateFn: x => x.lastUpdated, dateFn: (x) => x.lastUpdated,
projects, projects,
}); });
...@@ -67,7 +67,7 @@ describe('Project scanning store utils', () => { ...@@ -67,7 +67,7 @@ describe('Project scanning store utils', () => {
const groups = groupByDateRanges({ const groups = groupByDateRanges({
ranges, ranges,
dateFn: x => x.lastUpdated, dateFn: (x) => x.lastUpdated,
projects, projects,
}); });
...@@ -92,7 +92,7 @@ describe('Project scanning store utils', () => { ...@@ -92,7 +92,7 @@ describe('Project scanning store utils', () => {
const groups = groupByDateRanges({ const groups = groupByDateRanges({
ranges, ranges,
dateFn: x => x.lastUpdated, dateFn: (x) => x.lastUpdated,
projects: projectsWithoutTimeStamp, projects: projectsWithoutTimeStamp,
}); });
......
...@@ -57,7 +57,7 @@ describe('vulnerabilities count actions', () => { ...@@ -57,7 +57,7 @@ describe('vulnerabilities count actions', () => {
describe('vulnerabilities actions', () => { describe('vulnerabilities actions', () => {
const data = mockDataVulnerabilities; const data = mockDataVulnerabilities;
const params = { filters: { severity: ['critical'] } }; const params = { filters: { severity: ['critical'] } };
const filteredData = mockDataVulnerabilities.filter(vuln => vuln.severity === 'critical'); const filteredData = mockDataVulnerabilities.filter((vuln) => vuln.severity === 'critical');
const pageInfo = { const pageInfo = {
page: 1, page: 1,
nextPage: 2, nextPage: 2,
......
...@@ -2,7 +2,7 @@ import { isSameVulnerability } from 'ee/security_dashboard/store/modules/vulnera ...@@ -2,7 +2,7 @@ import { isSameVulnerability } from 'ee/security_dashboard/store/modules/vulnera
import mockData from './data/mock_data_vulnerabilities'; import mockData from './data/mock_data_vulnerabilities';
describe('Vulnerabilities utils', () => { describe('Vulnerabilities utils', () => {
const clone = serializable => JSON.parse(JSON.stringify(serializable)); const clone = (serializable) => JSON.parse(JSON.stringify(serializable));
const vuln = clone(mockData[0]); const vuln = clone(mockData[0]);
const vulnWithNewLocation = { ...clone(vuln), location: { foo: 1 } }; const vulnWithNewLocation = { ...clone(vuln), location: { foo: 1 } };
const vulnWithNewIdentifier = { ...clone(vuln), identifiers: [{ foo: 1 }] }; const vulnWithNewIdentifier = { ...clone(vuln), identifiers: [{ foo: 1 }] };
......
...@@ -11,7 +11,7 @@ export const createProjectWithZeroVulnerabilities = () => ({ ...@@ -11,7 +11,7 @@ export const createProjectWithZeroVulnerabilities = () => ({
// in the future this will be replaced by generated fixtures // in the future this will be replaced by generated fixtures
// see https://gitlab.com/gitlab-org/gitlab/merge_requests/20892#note_253602093 // see https://gitlab.com/gitlab-org/gitlab/merge_requests/20892#note_253602093
export const createProjectWithVulnerabilities = count => (...severityLevels) => ({ export const createProjectWithVulnerabilities = (count) => (...severityLevels) => ({
...createProjectWithZeroVulnerabilities(), ...createProjectWithZeroVulnerabilities(),
...(severityLevels ...(severityLevels
? severityLevels.reduce( ? severityLevels.reduce(
......
...@@ -12,7 +12,7 @@ describe('Vulnerable Projects store utils', () => { ...@@ -12,7 +12,7 @@ describe('Vulnerable Projects store utils', () => {
describe('addMostSevereVulnerabilityInformation', () => { describe('addMostSevereVulnerabilityInformation', () => {
it.each(['critical', 'medium', 'high'])( it.each(['critical', 'medium', 'high'])(
'takes a project and adds a property containing information about its most severe vulnerability', 'takes a project and adds a property containing information about its most severe vulnerability',
severityLevel => { (severityLevel) => {
const mockProject = createProjectWithOneVulnerability(severityLevel); const mockProject = createProjectWithOneVulnerability(severityLevel);
const mockSeverityLevelsInOrder = [severityLevel, 'foo', 'bar']; const mockSeverityLevelsInOrder = [severityLevel, 'foo', 'bar'];
...@@ -38,7 +38,7 @@ describe('Vulnerable Projects store utils', () => { ...@@ -38,7 +38,7 @@ describe('Vulnerable Projects store utils', () => {
it.each(['high', 'medium', 'low'])( it.each(['high', 'medium', 'low'])(
'returns false if the given project does not contain at least one vulnerability of the given severity level', 'returns false if the given project does not contain at least one vulnerability of the given severity level',
severityLevel => { (severityLevel) => {
const project = createProjectWithOneVulnerability(severityLevel); const project = createProjectWithOneVulnerability(severityLevel);
expect(hasVulnerabilityWithSeverityLevel(project)('critical')).toBe(false); expect(hasVulnerabilityWithSeverityLevel(project)('critical')).toBe(false);
...@@ -107,7 +107,7 @@ describe('Vulnerable Projects store utils', () => { ...@@ -107,7 +107,7 @@ describe('Vulnerable Projects store utils', () => {
const mockGroup = { severityLevels: severityLevelsForGroup }; const mockGroup = { severityLevels: severityLevelsForGroup };
expect(projectsForSeverityGroup(Object.values(mockProjects), mockGroup)).toStrictEqual( expect(projectsForSeverityGroup(Object.values(mockProjects), mockGroup)).toStrictEqual(
expectedProjectsInGroup.map(project => mockProjects[project]), expectedProjectsInGroup.map((project) => mockProjects[project]),
); );
}, },
); );
......
...@@ -144,7 +144,7 @@ describe('IterationSelect', () => { ...@@ -144,7 +144,7 @@ describe('IterationSelect', () => {
expect( expect(
wrapper wrapper
.findAll(GlDropdownItem) .findAll(GlDropdownItem)
.filter(w => w.text() === title) .filter((w) => w.text() === title)
.at(0) .at(0)
.text(), .text(),
).toBe(title); ).toBe(title);
...@@ -154,7 +154,7 @@ describe('IterationSelect', () => { ...@@ -154,7 +154,7 @@ describe('IterationSelect', () => {
expect( expect(
wrapper wrapper
.findAll(GlDropdownItem) .findAll(GlDropdownItem)
.filter(w => w.props('isChecked') === true) .filter((w) => w.props('isChecked') === true)
.at(0) .at(0)
.text(), .text(),
).toBe(title); ).toBe(title);
...@@ -187,7 +187,7 @@ describe('IterationSelect', () => { ...@@ -187,7 +187,7 @@ describe('IterationSelect', () => {
wrapper wrapper
.findAll(GlDropdownItem) .findAll(GlDropdownItem)
.filter(w => w.text() === 'title') .filter((w) => w.text() === 'title')
.at(0) .at(0)
.vm.$emit('click'); .vm.$emit('click');
...@@ -210,7 +210,7 @@ describe('IterationSelect', () => { ...@@ -210,7 +210,7 @@ describe('IterationSelect', () => {
wrapper wrapper
.findAll(GlDropdownItem) .findAll(GlDropdownItem)
.filter(w => w.text() === 'title') .filter((w) => w.text() === 'title')
.at(0) .at(0)
.vm.$emit('click'); .vm.$emit('click');
}); });
...@@ -229,7 +229,7 @@ describe('IterationSelect', () => { ...@@ -229,7 +229,7 @@ describe('IterationSelect', () => {
}); });
describe('when error', () => { describe('when error', () => {
const bootstrapComponent = mutationResp => { const bootstrapComponent = (mutationResp) => {
createComponent({ createComponent({
data: { data: {
iterations: [ iterations: [
...@@ -252,7 +252,7 @@ describe('IterationSelect', () => { ...@@ -252,7 +252,7 @@ describe('IterationSelect', () => {
wrapper wrapper
.findAll(GlDropdownItem) .findAll(GlDropdownItem)
.filter(w => w.text() === 'title') .filter((w) => w.text() === 'title')
.at(0) .at(0)
.vm.$emit('click'); .vm.$emit('click');
}); });
......
...@@ -7,7 +7,7 @@ describe('SidebarStatus', () => { ...@@ -7,7 +7,7 @@ describe('SidebarStatus', () => {
let wrapper; let wrapper;
let handleDropdownClickMock; let handleDropdownClickMock;
const createMediator = states => { const createMediator = (states) => {
mediator = { mediator = {
store: { store: {
isFetching: { isFetching: {
......
...@@ -98,7 +98,7 @@ describe('Status Page actions', () => { ...@@ -98,7 +98,7 @@ describe('Status Page actions', () => {
}); });
describe('receiveStatusPageSettingsUpdateSuccess', () => { describe('receiveStatusPageSettingsUpdateSuccess', () => {
it('should handle successful settings update', done => { it('should handle successful settings update', (done) => {
testAction(actions.receiveStatusPageSettingsUpdateSuccess, null, null, [], [], () => { testAction(actions.receiveStatusPageSettingsUpdateSuccess, null, null, [], [], () => {
expect(refreshCurrentPage).toHaveBeenCalledTimes(1); expect(refreshCurrentPage).toHaveBeenCalledTimes(1);
done(); done();
...@@ -108,7 +108,7 @@ describe('Status Page actions', () => { ...@@ -108,7 +108,7 @@ describe('Status Page actions', () => {
describe('receiveStatusPageSettingsUpdateError', () => { describe('receiveStatusPageSettingsUpdateError', () => {
const error = { response: { data: { message: 'Update error' } } }; const error = { response: { data: { message: 'Update error' } } };
it('should handle error update', done => { it('should handle error update', (done) => {
testAction(actions.receiveStatusPageSettingsUpdateError, error, null, [], [], () => { testAction(actions.receiveStatusPageSettingsUpdateError, error, null, [], [], () => {
expect(createFlash).toHaveBeenCalledWith( expect(createFlash).toHaveBeenCalledWith(
`There was an error saving your changes. ${error.response.data.message}`, `There was an error saving your changes. ${error.response.data.message}`,
......
...@@ -16,7 +16,7 @@ function mountComponent({ rootStorageStatistics, limit }) { ...@@ -16,7 +16,7 @@ function mountComponent({ rootStorageStatistics, limit }) {
function findStorageTypeUsagesSerialized() { function findStorageTypeUsagesSerialized() {
return wrapper return wrapper
.findAll('[data-testid="storage-type-usage"]') .findAll('[data-testid="storage-type-usage"]')
.wrappers.map(wp => wp.element.style.flex); .wrappers.map((wp) => wp.element.style.flex);
} }
describe('Storage Counter usage graph component', () => { describe('Storage Counter usage graph component', () => {
......
...@@ -26,7 +26,7 @@ describe('Usage Statistics component', () => { ...@@ -26,7 +26,7 @@ describe('Usage Statistics component', () => {
}; };
const getStatisticsCards = () => wrapper.findAll(UsageStatisticsCard); const getStatisticsCards = () => wrapper.findAll(UsageStatisticsCard);
const getStatisticsCard = testId => wrapper.find(`[data-testid="${testId}"]`); const getStatisticsCard = (testId) => wrapper.find(`[data-testid="${testId}"]`);
describe('with purchaseStorageUrl passed', () => { describe('with purchaseStorageUrl passed', () => {
beforeEach(() => { beforeEach(() => {
......
...@@ -86,5 +86,5 @@ export const withRootStorageStatistics = { ...@@ -86,5 +86,5 @@ export const withRootStorageStatistics = {
}; };
export const mockGetStorageCounterGraphQLResponse = { export const mockGetStorageCounterGraphQLResponse = {
nodes: projects.map(node => node), nodes: projects.map((node) => node),
}; };
...@@ -74,7 +74,7 @@ describe('parseProjects', () => { ...@@ -74,7 +74,7 @@ describe('parseProjects', () => {
totalRepositorySizeExcess: 5000, totalRepositorySizeExcess: 5000,
}); });
projects.forEach(project => { projects.forEach((project) => {
expect(project).toMatchObject({ expect(project).toMatchObject({
totalCalculatedUsedStorage: expect.any(Number), totalCalculatedUsedStorage: expect.any(Number),
totalCalculatedStorageLimit: expect.any(Number), totalCalculatedStorageLimit: expect.any(Number),
......
...@@ -4,7 +4,7 @@ import Component from 'ee/registrations/components/progress_bar.vue'; ...@@ -4,7 +4,7 @@ import Component from 'ee/registrations/components/progress_bar.vue';
describe('Progress Bar', () => { describe('Progress Bar', () => {
let wrapper; let wrapper;
const createComponent = propsData => { const createComponent = (propsData) => {
wrapper = shallowMount(Component, { wrapper = shallowMount(Component, {
propsData, propsData,
}); });
......
...@@ -20,7 +20,7 @@ describe('Step', () => { ...@@ -20,7 +20,7 @@ describe('Step', () => {
nextStepButtonText: 'next', nextStepButtonText: 'next',
}; };
const createComponent = propsData => { const createComponent = (propsData) => {
wrapper = shallowMount(Component, { wrapper = shallowMount(Component, {
propsData: { ...initialProps, ...propsData }, propsData: { ...initialProps, ...propsData },
localVue, localVue,
......
...@@ -24,7 +24,7 @@ describe('Subscription Details', () => { ...@@ -24,7 +24,7 @@ describe('Subscription Details', () => {
]; ];
let initialNamespaceId = null; let initialNamespaceId = null;
const initialData = namespaceId => { const initialData = (namespaceId) => {
return { return {
planData: JSON.stringify(planData), planData: JSON.stringify(planData),
groupData: JSON.stringify(groupData), groupData: JSON.stringify(groupData),
......
...@@ -95,7 +95,7 @@ describe('TestCaseCreateRoot', () => { ...@@ -95,7 +95,7 @@ describe('TestCaseCreateRoot', () => {
projectPath: 'gitlab-org/gitlab-test', projectPath: 'gitlab-org/gitlab-test',
title: issuableTitle, title: issuableTitle,
description: issuableDescription, description: issuableDescription,
labelIds: selectedLabels.map(label => label.id), labelIds: selectedLabels.map((label) => label.id),
}, },
}, },
}), }),
......
...@@ -75,7 +75,7 @@ describe('ThreatMonitoringApp component', () => { ...@@ -75,7 +75,7 @@ describe('ThreatMonitoringApp component', () => {
describe.each([-1, NaN, Math.PI])( describe.each([-1, NaN, Math.PI])(
'given an invalid default environment id of %p', 'given an invalid default environment id of %p',
invalidEnvironmentId => { (invalidEnvironmentId) => {
beforeEach(() => { beforeEach(() => {
factory({ factory({
propsData: { propsData: {
......
...@@ -14,7 +14,7 @@ describe('EnvironmentPicker component', () => { ...@@ -14,7 +14,7 @@ describe('EnvironmentPicker component', () => {
let store; let store;
let wrapper; let wrapper;
const factory = state => { const factory = (state) => {
store = createStore(); store = createStore();
Object.assign(store.state.threatMonitoring, state); Object.assign(store.state.threatMonitoring, state);
......
...@@ -8,7 +8,7 @@ import { useFakeDate } from 'helpers/fake_date'; ...@@ -8,7 +8,7 @@ import { useFakeDate } from 'helpers/fake_date';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { mockPoliciesResponse } from '../mock_data'; import { mockPoliciesResponse } from '../mock_data';
const mockData = mockPoliciesResponse.map(policy => convertObjectPropsToCamelCase(policy)); const mockData = mockPoliciesResponse.map((policy) => convertObjectPropsToCamelCase(policy));
describe('NetworkPolicyList component', () => { describe('NetworkPolicyList component', () => {
useFakeDate(); useFakeDate();
......
...@@ -20,7 +20,7 @@ describe('buildRule', () => { ...@@ -20,7 +20,7 @@ describe('buildRule', () => {
describe.each([RuleTypeEndpoint, RuleTypeEntity, RuleTypeCIDR, RuleTypeFQDN])( describe.each([RuleTypeEndpoint, RuleTypeEntity, RuleTypeCIDR, RuleTypeFQDN])(
'buildRule $ruleType', 'buildRule $ruleType',
ruleType => { (ruleType) => {
it('builds correct instance', () => { it('builds correct instance', () => {
const rule = buildRule(ruleType); const rule = buildRule(ruleType);
expect(rule).toMatchObject({ expect(rule).toMatchObject({
......
...@@ -129,7 +129,7 @@ describe('PolicyRuleBuilder component', () => { ...@@ -129,7 +129,7 @@ describe('PolicyRuleBuilder component', () => {
it('updates entity types', async () => { it('updates entity types', async () => {
const el = findRuleEntity(); const el = findRuleEntity();
el.findAll('button') el.findAll('button')
.filter(e => e.text() === 'host') .filter((e) => e.text() === 'host')
.trigger('click'); .trigger('click');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(rule.entities).toEqual(['host']); expect(rule.entities).toEqual(['host']);
......
...@@ -31,7 +31,7 @@ describe('PolicyRuleEntity component', () => { ...@@ -31,7 +31,7 @@ describe('PolicyRuleEntity component', () => {
it('selects all items', () => { it('selects all items', () => {
const dropdown = findDropdown(); const dropdown = findDropdown();
const selectedItems = dropdown.findAll(GlDropdownItem).filter(el => el.props('isChecked')); const selectedItems = dropdown.findAll(GlDropdownItem).filter((el) => el.props('isChecked'));
expect(selectedItems.length).toEqual(Object.keys(EntityTypes).length); expect(selectedItems.length).toEqual(Object.keys(EntityTypes).length);
expect(dropdown.props('text')).toEqual('All selected'); expect(dropdown.props('text')).toEqual('All selected');
}); });
...@@ -40,8 +40,8 @@ describe('PolicyRuleEntity component', () => { ...@@ -40,8 +40,8 @@ describe('PolicyRuleEntity component', () => {
describe('when all entities are selected', () => { describe('when all entities are selected', () => {
beforeEach(() => { beforeEach(() => {
const value = Object.keys(EntityTypes) const value = Object.keys(EntityTypes)
.map(key => EntityTypes[key]) .map((key) => EntityTypes[key])
.filter(entity => entity !== EntityTypes.ALL && entity !== EntityTypes.HOST); .filter((entity) => entity !== EntityTypes.ALL && entity !== EntityTypes.HOST);
factory({ value }); factory({ value });
}); });
...@@ -49,7 +49,7 @@ describe('PolicyRuleEntity component', () => { ...@@ -49,7 +49,7 @@ describe('PolicyRuleEntity component', () => {
const dropdown = findDropdown(); const dropdown = findDropdown();
dropdown dropdown
.findAll(GlDropdownItem) .findAll(GlDropdownItem)
.filter(el => el.text() === EntityTypes.HOST) .filter((el) => el.text() === EntityTypes.HOST)
.at(0) .at(0)
.vm.$emit('click'); .vm.$emit('click');
......
...@@ -5,7 +5,7 @@ import StatisticsSummary from 'ee/threat_monitoring/components/statistics_summar ...@@ -5,7 +5,7 @@ import StatisticsSummary from 'ee/threat_monitoring/components/statistics_summar
describe('StatisticsSummary component', () => { describe('StatisticsSummary component', () => {
let wrapper; let wrapper;
const factory = options => { const factory = (options) => {
wrapper = shallowMount(StatisticsSummary, { wrapper = shallowMount(StatisticsSummary, {
...options, ...options,
}); });
......
...@@ -12,7 +12,7 @@ describe('ThreatMonitoringFilters component', () => { ...@@ -12,7 +12,7 @@ describe('ThreatMonitoringFilters component', () => {
let store; let store;
let wrapper; let wrapper;
const factory = state => { const factory = (state) => {
store = createStore(); store = createStore();
Object.assign(store.state.threatMonitoring, state); Object.assign(store.state.threatMonitoring, state);
......
...@@ -140,7 +140,7 @@ describe('Threat Monitoring actions', () => { ...@@ -140,7 +140,7 @@ describe('Threat Monitoring actions', () => {
describe('given more than one page of environments', () => { describe('given more than one page of environments', () => {
beforeEach(() => { beforeEach(() => {
const oneEnvironmentPerPage = ({ totalPages }) => config => { const oneEnvironmentPerPage = ({ totalPages }) => (config) => {
const { page } = config.params; const { page } = config.params;
const response = [httpStatus.OK, { environments: [{ id: page }] }]; const response = [httpStatus.OK, { environments: [{ id: page }] }];
if (page < totalPages) { if (page < totalPages) {
......
...@@ -9,7 +9,7 @@ describe('threatMonitoringStatistics module getters', () => { ...@@ -9,7 +9,7 @@ describe('threatMonitoringStatistics module getters', () => {
}); });
describe('hasHistory', () => { 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']; state.statistics.history[type] = ['foo'];
expect(getters.hasHistory(state)).toBe(true); expect(getters.hasHistory(state)).toBe(true);
}); });
......
...@@ -5,7 +5,7 @@ import { mockWafStatisticsResponse } from '../../../mock_data'; ...@@ -5,7 +5,7 @@ import { mockWafStatisticsResponse } from '../../../mock_data';
describe('threatMonitoringStatistics mutations', () => { describe('threatMonitoringStatistics mutations', () => {
let state; let state;
const mutations = mutationsFactory(payload => payload); const mutations = mutationsFactory((payload) => payload);
beforeEach(() => { beforeEach(() => {
state = {}; state = {};
}); });
......
...@@ -134,7 +134,7 @@ describe('UsernameSuggester', () => { ...@@ -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); axiosMock.onGet(usernameEndPoint).replyOnce(500);
expect(suggester.isLoading).toBe(false); expect(suggester.isLoading).toBe(false);
......
...@@ -6,7 +6,7 @@ const TEST_PASSWORD = 'password'; ...@@ -6,7 +6,7 @@ const TEST_PASSWORD = 'password';
// For some reason, the `Promise.resolve` needs to be deferred // For some reason, the `Promise.resolve` needs to be deferred
// or the timing doesn't work. // 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', () => { describe('Approval auth component', () => {
let wrapper; let wrapper;
...@@ -29,7 +29,7 @@ describe('Approval auth component', () => { ...@@ -29,7 +29,7 @@ describe('Approval auth component', () => {
const findErrorMessage = () => wrapper.find('.gl-field-error'); const findErrorMessage = () => wrapper.find('.gl-field-error');
describe('when created', () => { describe('when created', () => {
beforeEach(done => { beforeEach((done) => {
createComponent(); createComponent();
waitForTick(done); waitForTick(done);
}); });
...@@ -54,12 +54,12 @@ describe('Approval auth component', () => { ...@@ -54,12 +54,12 @@ describe('Approval auth component', () => {
}); });
describe('when approve clicked', () => { describe('when approve clicked', () => {
beforeEach(done => { beforeEach((done) => {
createComponent(); createComponent();
waitForTick(done); waitForTick(done);
}); });
it('emits the approve event', done => { it('emits the approve event', (done) => {
findInput().setValue(TEST_PASSWORD); findInput().setValue(TEST_PASSWORD);
wrapper.find(GlModal).vm.$emit('ok', { preventDefault: () => null }); wrapper.find(GlModal).vm.$emit('ok', { preventDefault: () => null });
waitForTick(done); waitForTick(done);
...@@ -69,7 +69,7 @@ describe('Approval auth component', () => { ...@@ -69,7 +69,7 @@ describe('Approval auth component', () => {
}); });
describe('when isApproving is true', () => { describe('when isApproving is true', () => {
beforeEach(done => { beforeEach((done) => {
createComponent({ isApproving: true }); createComponent({ isApproving: true });
waitForTick(done); waitForTick(done);
}); });
...@@ -82,7 +82,7 @@ describe('Approval auth component', () => { ...@@ -82,7 +82,7 @@ describe('Approval auth component', () => {
}); });
describe('when hasError is true', () => { describe('when hasError is true', () => {
beforeEach(done => { beforeEach((done) => {
createComponent({ hasError: true }); createComponent({ hasError: true });
waitForTick(done); waitForTick(done);
}); });
......
...@@ -5,7 +5,7 @@ import ApprovalsList from 'ee/vue_merge_request_widget/components/approvals/appr ...@@ -5,7 +5,7 @@ import ApprovalsList from 'ee/vue_merge_request_widget/components/approvals/appr
import stubChildren from 'helpers/stub_children'; import stubChildren from 'helpers/stub_children';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue'; 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' }]; const testApprovalRules = () => [{ name: 'Lorem' }, { name: 'Ipsum' }];
describe('EE MRWidget approvals footer', () => { describe('EE MRWidget approvals footer', () => {
...@@ -184,7 +184,7 @@ describe('EE MRWidget approvals footer', () => { ...@@ -184,7 +184,7 @@ describe('EE MRWidget approvals footer', () => {
expect(button.text()).toBe('View eligible approvers'); expect(button.text()).toBe('View eligible approvers');
}); });
it('expands when clicked', done => { it('expands when clicked', (done) => {
expect(wrapper.props('value')).toBe(false); expect(wrapper.props('value')).toBe(false);
button.vm.$emit('click'); button.vm.$emit('click');
......
...@@ -3,7 +3,7 @@ import ApprovalsList from 'ee/vue_merge_request_widget/components/approvals/appr ...@@ -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 ApprovedIcon from 'ee/vue_merge_request_widget/components/approvals/approved_icon.vue';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.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 = () => ({ const testRuleApproved = () => ({
id: 1, id: 1,
name: 'Lorem', name: 'Lorem',
...@@ -74,7 +74,7 @@ describe('EE MRWidget approvals list', () => { ...@@ -74,7 +74,7 @@ describe('EE MRWidget approvals list', () => {
const findRows = () => wrapper.findAll('tbody tr'); const findRows = () => wrapper.findAll('tbody tr');
const findRowElement = (row, name) => row.find(`.js-${name}`); const findRowElement = (row, name) => row.find(`.js-${name}`);
const findRowIcon = row => row.find(ApprovedIcon); const findRowIcon = (row) => row.find(ApprovedIcon);
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
...@@ -91,10 +91,10 @@ describe('EE MRWidget approvals list', () => { ...@@ -91,10 +91,10 @@ describe('EE MRWidget approvals list', () => {
it('renders a row for each rule', () => { it('renders a row for each rule', () => {
const expected = testRules(); const expected = testRules();
const rows = findRows(); 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(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', () => { it('does not render a code owner subtitle', () => {
......
...@@ -19,10 +19,10 @@ import eventHub from '~/vue_merge_request_widget/event_hub'; ...@@ -19,10 +19,10 @@ import eventHub from '~/vue_merge_request_widget/event_hub';
const TEST_HELP_PATH = 'help/path'; const TEST_HELP_PATH = 'help/path';
const TEST_PASSWORD = 'password'; const TEST_PASSWORD = 'password';
const testApprovedBy = () => [1, 7, 10].map(id => ({ id })); const testApprovedBy = () => [1, 7, 10].map((id) => ({ id }));
const testApprovals = () => ({ const testApprovals = () => ({
approved: false, approved: false,
approved_by: testApprovedBy().map(user => ({ user })), approved_by: testApprovedBy().map((user) => ({ user })),
approval_rules_left: [], approval_rules_left: [],
approvals_left: 4, approvals_left: 4,
suggested_approvers: [], suggested_approvers: [],
......
...@@ -63,7 +63,7 @@ describe('BlockingMergeRequestsReport', () => { ...@@ -63,7 +63,7 @@ describe('BlockingMergeRequestsReport', () => {
createComponent(); createComponent();
const reportSectionProps = wrapper.find(ReportSection).props(); 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', () => { it('sets status to "ERROR" when there are unmerged blocking MRs', () => {
...@@ -112,7 +112,7 @@ describe('BlockingMergeRequestsReport', () => { ...@@ -112,7 +112,7 @@ describe('BlockingMergeRequestsReport', () => {
it('does not include merged MRs', () => { it('does not include merged MRs', () => {
createComponent(); createComponent();
const containsMergedMRs = wrapper.vm.unmergedBlockingMergeRequests.some( const containsMergedMRs = wrapper.vm.unmergedBlockingMergeRequests.some(
mr => mr.state === 'merged', (mr) => mr.state === 'merged',
); );
expect(containsMergedMRs).toBe(false); expect(containsMergedMRs).toBe(false);
...@@ -121,7 +121,7 @@ describe('BlockingMergeRequestsReport', () => { ...@@ -121,7 +121,7 @@ describe('BlockingMergeRequestsReport', () => {
it('puts closed MRs first', () => { it('puts closed MRs first', () => {
createComponent(); createComponent();
const closedIndex = wrapper.vm.unmergedBlockingMergeRequests.findIndex( const closedIndex = wrapper.vm.unmergedBlockingMergeRequests.findIndex(
mr => mr.state === 'closed', (mr) => mr.state === 'closed',
); );
expect(closedIndex).toBe(0); expect(closedIndex).toBe(0);
......
...@@ -16,7 +16,7 @@ describe('MergeTrainHelperText', () => { ...@@ -16,7 +16,7 @@ describe('MergeTrainHelperText', () => {
const findDocumentationLink = () => wrapper.find('[data-testid="documentation-link"]'); const findDocumentationLink = () => wrapper.find('[data-testid="documentation-link"]');
const findPipelineLink = () => wrapper.find('[data-testid="pipeline-link"]'); const findPipelineLink = () => wrapper.find('[data-testid="pipeline-link"]');
const createWrapper = propsData => { const createWrapper = (propsData) => {
wrapper = shallowMount(MergeTrainHelperText, { wrapper = shallowMount(MergeTrainHelperText, {
propsData: { propsData: {
...defaultProps, ...defaultProps,
......
...@@ -5,7 +5,7 @@ import { trimText } from 'helpers/text_helper'; ...@@ -5,7 +5,7 @@ import { trimText } from 'helpers/text_helper';
describe('MergeTrainPositionIndicator', () => { describe('MergeTrainPositionIndicator', () => {
let wrapper; let wrapper;
const factory = propsData => { const factory = (propsData) => {
wrapper = shallowMount(MergeTrainPositionIndicator, { wrapper = shallowMount(MergeTrainPositionIndicator, {
propsData, propsData,
}); });
......
...@@ -86,7 +86,7 @@ describe('MrWidgetPipelineContainer', () => { ...@@ -86,7 +86,7 @@ describe('MrWidgetPipelineContainer', () => {
return wrapper.vm.$nextTick(); 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 // the visual review app link component is lazy loaded
// so we need to re-render the component again, as once // so we need to re-render the component again, as once
// apparently isn't enough. // apparently isn't enough.
...@@ -123,7 +123,7 @@ describe('MrWidgetPipelineContainer', () => { ...@@ -123,7 +123,7 @@ describe('MrWidgetPipelineContainer', () => {
return wrapper.vm.$nextTick(); 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 // the visual review app link component is lazy loaded
// so we need to re-render the component again, as once // so we need to re-render the component again, as once
// apparently isn't enough. // apparently isn't enough.
......
...@@ -78,7 +78,7 @@ describe('MergeRequestStore', () => { ...@@ -78,7 +78,7 @@ describe('MergeRequestStore', () => {
'secret_scanning_comparison_path', 'secret_scanning_comparison_path',
'api_fuzzing_comparison_path', 'api_fuzzing_comparison_path',
'coverage_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 // Ensure something is set in the mock data
expect(property in mockData).toBe(true); expect(property in mockData).toBe(true);
const expectedValue = mockData[property]; const expectedValue = mockData[property];
......
...@@ -74,7 +74,7 @@ describe('AccordionItem component', () => { ...@@ -74,7 +74,7 @@ describe('AccordionItem component', () => {
}); });
describe('scoped slots', () => { 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`; const className = `${slotName}-slot-content`;
factory({ [`${slotName}Slot`]: `<div class='${className}' />` }); factory({ [`${slotName}Slot`]: `<div class='${className}' />` });
...@@ -89,7 +89,7 @@ describe('AccordionItem component', () => { ...@@ -89,7 +89,7 @@ describe('AccordionItem component', () => {
it.each([true, false])( it.each([true, false])(
'passes the "isExpanded" and "isDisabled" state to the title slot', 'passes the "isExpanded" and "isDisabled" state to the title slot',
state => { (state) => {
const titleSlot = jest.fn(); const titleSlot = jest.fn();
factory({ propsData: { disabled: state }, titleSlot }); factory({ propsData: { disabled: state }, titleSlot });
......
...@@ -28,7 +28,7 @@ describe('Deploy Board Instance', () => { ...@@ -28,7 +28,7 @@ describe('Deploy Board Instance', () => {
expect(wrapper.attributes('title')).toEqual('This is a pod'); 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({ wrapper = createComponent({
status: 'deploying', status: 'deploying',
tooltipText: '', tooltipText: '',
...@@ -58,7 +58,7 @@ describe('Deploy Board Instance', () => { ...@@ -58,7 +58,7 @@ describe('Deploy Board Instance', () => {
wrapper.destroy(); 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({ wrapper = createComponent({
stable: false, stable: false,
}); });
...@@ -75,7 +75,7 @@ describe('Deploy Board Instance', () => { ...@@ -75,7 +75,7 @@ describe('Deploy Board Instance', () => {
wrapper.destroy(); 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({ wrapper = createComponent({
stable: false, stable: false,
logsPath: '', logsPath: '',
......
...@@ -76,7 +76,7 @@ describe('system note component', () => { ...@@ -76,7 +76,7 @@ describe('system note component', () => {
expect(findDescriptionVersion().exists()).toBe(false); 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(); mockFetchDiff();
expect(findDescriptionVersion().exists()).toBe(false); expect(findDescriptionVersion().exists()).toBe(false);
......
...@@ -29,7 +29,7 @@ describe('Severity Badge', () => { ...@@ -29,7 +29,7 @@ describe('Severity Badge', () => {
const findIcon = () => wrapper.find(GlIcon); const findIcon = () => wrapper.find(GlIcon);
const findTooltip = () => getBinding(findIcon().element, 'tooltip').value; 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(() => { beforeEach(() => {
createWrapper({ severity }); createWrapper({ severity });
}); });
...@@ -54,7 +54,7 @@ describe('Severity Badge', () => { ...@@ -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(() => { beforeEach(() => {
createWrapper({ severity: invalidSeverity }); createWrapper({ severity: invalidSeverity });
}); });
......
...@@ -224,7 +224,7 @@ describe('EpicsSelect', () => { ...@@ -224,7 +224,7 @@ describe('EpicsSelect', () => {
expect(wrapperStandalone.find(DropdownTitle).exists()).toBe(false); 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.showDropdown = false;
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
...@@ -237,7 +237,7 @@ describe('EpicsSelect', () => { ...@@ -237,7 +237,7 @@ describe('EpicsSelect', () => {
expect(wrapperStandalone.find(DropdownValue).exists()).toBe(false); 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(); showDropdown();
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
...@@ -251,7 +251,7 @@ describe('EpicsSelect', () => { ...@@ -251,7 +251,7 @@ describe('EpicsSelect', () => {
expect(wrapperStandalone.find('.epic-dropdown-container').exists()).toBe(true); 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(); showDropdown();
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
...@@ -260,7 +260,7 @@ describe('EpicsSelect', () => { ...@@ -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(); showDropdown();
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
...@@ -269,7 +269,7 @@ describe('EpicsSelect', () => { ...@@ -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(); showDropdown();
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
...@@ -286,7 +286,7 @@ describe('EpicsSelect', () => { ...@@ -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(); showDropdown();
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
...@@ -295,7 +295,7 @@ describe('EpicsSelect', () => { ...@@ -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(); showDropdown();
store.dispatch('receiveEpicsSuccess', []); store.dispatch('receiveEpicsSuccess', []);
...@@ -305,7 +305,7 @@ describe('EpicsSelect', () => { ...@@ -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(); showDropdown();
store.dispatch('requestEpics'); store.dispatch('requestEpics');
......
...@@ -6,7 +6,7 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; ...@@ -6,7 +6,7 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { mockEpic1, mockEpic2, mockEpics, noneEpic } from '../mock_data'; 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('EpicsSelect', () => {
describe('DropdownContents', () => { describe('DropdownContents', () => {
...@@ -27,7 +27,7 @@ describe('EpicsSelect', () => { ...@@ -27,7 +27,7 @@ describe('EpicsSelect', () => {
describe('computed', () => { describe('computed', () => {
describe('isNoEpic', () => { 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({ wrapper.setProps({
selectedEpic: noneEpic, selectedEpic: noneEpic,
}); });
......
...@@ -15,7 +15,7 @@ describe('EpicsSelect', () => { ...@@ -15,7 +15,7 @@ describe('EpicsSelect', () => {
describe('store', () => { describe('store', () => {
describe('actions', () => { describe('actions', () => {
let state; let state;
const normalizedEpics = mockEpics.map(rawEpic => const normalizedEpics = mockEpics.map((rawEpic) =>
convertObjectPropsToCamelCase(Object.assign(rawEpic, { url: rawEpic.web_edit_url }), { convertObjectPropsToCamelCase(Object.assign(rawEpic, { url: rawEpic.web_edit_url }), {
dropKeys: ['web_edit_url'], dropKeys: ['web_edit_url'],
}), }),
...@@ -26,7 +26,7 @@ describe('EpicsSelect', () => { ...@@ -26,7 +26,7 @@ describe('EpicsSelect', () => {
}); });
describe('setInitialData', () => { describe('setInitialData', () => {
it('should set initial data on state', done => { it('should set initial data on state', (done) => {
const mockInitialConfig = { const mockInitialConfig = {
groupId: mockEpic1.group_id, groupId: mockEpic1.group_id,
issueId: mockIssue.id, issueId: mockIssue.id,
...@@ -46,7 +46,7 @@ describe('EpicsSelect', () => { ...@@ -46,7 +46,7 @@ describe('EpicsSelect', () => {
}); });
describe('setIssueId', () => { describe('setIssueId', () => {
it('should set `issueId` on state', done => { it('should set `issueId` on state', (done) => {
const issueId = mockIssue.id; const issueId = mockIssue.id;
testAction( testAction(
...@@ -61,7 +61,7 @@ describe('EpicsSelect', () => { ...@@ -61,7 +61,7 @@ describe('EpicsSelect', () => {
}); });
describe('setSearchQuery', () => { describe('setSearchQuery', () => {
it('should set `searchQuery` param on state', done => { it('should set `searchQuery` param on state', (done) => {
const searchQuery = 'foo'; const searchQuery = 'foo';
testAction( testAction(
...@@ -76,7 +76,7 @@ describe('EpicsSelect', () => { ...@@ -76,7 +76,7 @@ describe('EpicsSelect', () => {
}); });
describe('setSelectedEpic', () => { describe('setSelectedEpic', () => {
it('should set `selectedEpic` param on state', done => { it('should set `selectedEpic` param on state', (done) => {
testAction( testAction(
actions.setSelectedEpic, actions.setSelectedEpic,
mockEpic1, mockEpic1,
...@@ -89,7 +89,7 @@ describe('EpicsSelect', () => { ...@@ -89,7 +89,7 @@ describe('EpicsSelect', () => {
}); });
describe('setSelectedEpicIssueId', () => { describe('setSelectedEpicIssueId', () => {
it('should set `selectedEpicIssueId` param on state', done => { it('should set `selectedEpicIssueId` param on state', (done) => {
testAction( testAction(
actions.setSelectedEpicIssueId, actions.setSelectedEpicIssueId,
mockIssue.epic_issue_id, mockIssue.epic_issue_id,
...@@ -102,13 +102,13 @@ describe('EpicsSelect', () => { ...@@ -102,13 +102,13 @@ describe('EpicsSelect', () => {
}); });
describe('requestEpics', () => { 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); testAction(actions.requestEpics, {}, state, [{ type: types.REQUEST_EPICS }], [], done);
}); });
}); });
describe('receiveEpicsSuccess', () => { 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; state.groupId = mockEpic1.group_id;
testAction( testAction(
...@@ -137,7 +137,7 @@ describe('EpicsSelect', () => { ...@@ -137,7 +137,7 @@ describe('EpicsSelect', () => {
); );
}); });
it('should set `state.epicsFetchInProgress` to false', done => { it('should set `state.epicsFetchInProgress` to false', (done) => {
testAction( testAction(
actions.receiveEpicsFailure, actions.receiveEpicsFailure,
{}, {},
...@@ -154,7 +154,7 @@ describe('EpicsSelect', () => { ...@@ -154,7 +154,7 @@ describe('EpicsSelect', () => {
state.groupId = mockEpic1.group_id; 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( jest.spyOn(Api, 'groupEpics').mockReturnValue(
Promise.resolve({ Promise.resolve({
data: mockEpics, data: mockEpics,
...@@ -179,7 +179,7 @@ describe('EpicsSelect', () => { ...@@ -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()); jest.spyOn(Api, 'groupEpics').mockReturnValue(Promise.reject());
testAction( testAction(
...@@ -224,7 +224,7 @@ describe('EpicsSelect', () => { ...@@ -224,7 +224,7 @@ describe('EpicsSelect', () => {
}); });
describe('requestIssueUpdate', () => { describe('requestIssueUpdate', () => {
it('should set `state.epicSelectInProgress` to true', done => { it('should set `state.epicSelectInProgress` to true', (done) => {
testAction( testAction(
actions.requestIssueUpdate, actions.requestIssueUpdate,
{}, {},
...@@ -237,7 +237,7 @@ describe('EpicsSelect', () => { ...@@ -237,7 +237,7 @@ describe('EpicsSelect', () => {
}); });
describe('receiveIssueUpdateSuccess', () => { 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; state.issueId = mockIssue.id;
testAction( testAction(
...@@ -261,7 +261,7 @@ describe('EpicsSelect', () => { ...@@ -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(() => {}); boardsStore.detail.issue.updateEpic = jest.fn(() => {});
state.issueId = mockIssue.id; state.issueId = mockIssue.id;
const mockApiData = { ...mockAssignRemoveRes }; const mockApiData = { ...mockAssignRemoveRes };
...@@ -290,7 +290,7 @@ describe('EpicsSelect', () => { ...@@ -290,7 +290,7 @@ describe('EpicsSelect', () => {
expect(boardsStore.detail.issue.updateEpic).toHaveBeenCalled(); 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; state.issueId = mockIssue.id;
testAction( testAction(
...@@ -315,7 +315,7 @@ describe('EpicsSelect', () => { ...@@ -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( testAction(
actions.receiveIssueUpdateSuccess, actions.receiveIssueUpdateSuccess,
{ {
...@@ -349,7 +349,7 @@ describe('EpicsSelect', () => { ...@@ -349,7 +349,7 @@ describe('EpicsSelect', () => {
); );
}); });
it('should set `state.epicSelectInProgress` to false', done => { it('should set `state.epicSelectInProgress` to false', (done) => {
testAction( testAction(
actions.receiveIssueUpdateFailure, actions.receiveIssueUpdateFailure,
{}, {},
...@@ -366,7 +366,7 @@ describe('EpicsSelect', () => { ...@@ -366,7 +366,7 @@ describe('EpicsSelect', () => {
state.issueId = mockIssue.id; 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( jest.spyOn(Api, 'addEpicIssue').mockReturnValue(
Promise.resolve({ Promise.resolve({
data: mockAssignRemoveRes, data: mockAssignRemoveRes,
...@@ -391,7 +391,7 @@ describe('EpicsSelect', () => { ...@@ -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()); jest.spyOn(Api, 'addEpicIssue').mockReturnValue(Promise.reject());
testAction( testAction(
...@@ -440,7 +440,7 @@ describe('EpicsSelect', () => { ...@@ -440,7 +440,7 @@ describe('EpicsSelect', () => {
state.selectedEpicIssueId = mockIssue.epic_issue_id; 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( jest.spyOn(Api, 'removeEpicIssue').mockReturnValue(
Promise.resolve({ Promise.resolve({
data: mockAssignRemoveRes, data: mockAssignRemoveRes,
...@@ -465,7 +465,7 @@ describe('EpicsSelect', () => { ...@@ -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()); jest.spyOn(Api, 'removeEpicIssue').mockReturnValue(Promise.reject());
testAction( testAction(
......
...@@ -9,7 +9,7 @@ describe('EpicsSelect', () => { ...@@ -9,7 +9,7 @@ describe('EpicsSelect', () => {
describe('store', () => { describe('store', () => {
describe('getters', () => { describe('getters', () => {
let state; let state;
const normalizedEpics = mockEpics.map(rawEpic => const normalizedEpics = mockEpics.map((rawEpic) =>
convertObjectPropsToCamelCase(Object.assign(rawEpic, { url: rawEpic.web_edit_url }), { convertObjectPropsToCamelCase(Object.assign(rawEpic, { url: rawEpic.web_edit_url }), {
dropKeys: ['web_edit_url'], dropKeys: ['web_edit_url'],
}), }),
......
...@@ -120,7 +120,7 @@ describe('actions', () => { ...@@ -120,7 +120,7 @@ describe('actions', () => {
const errorMessage = const errorMessage =
'This dashboard is available for public projects, and private projects in groups with a Silver plan.'; '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) { for (let i = 0; i < count; i += 1) {
store.dispatch('toggleSelectedProject', { store.dispatch('toggleSelectedProject', {
id: i, id: i,
...@@ -128,7 +128,7 @@ describe('actions', () => { ...@@ -128,7 +128,7 @@ describe('actions', () => {
}); });
} }
}; };
const addInvalidProjects = invalid => const addInvalidProjects = (invalid) =>
store.dispatch('receiveAddProjectsToDashboardSuccess', { store.dispatch('receiveAddProjectsToDashboardSuccess', {
added: [], added: [],
invalid, invalid,
...@@ -318,7 +318,7 @@ describe('actions', () => { ...@@ -318,7 +318,7 @@ describe('actions', () => {
const searchQueries = [null, undefined, false, NaN]; const searchQueries = [null, undefined, false, NaN];
return Promise.all( return Promise.all(
searchQueries.map(searchQuery => { searchQueries.map((searchQuery) => {
store.state.searchQuery = searchQuery; store.state.searchQuery = searchQuery;
return testAction( return testAction(
......
...@@ -12,7 +12,7 @@ describe('mutations', () => { ...@@ -12,7 +12,7 @@ describe('mutations', () => {
useLocalStorageSpy(); useLocalStorageSpy();
const projects = mockProjectData(3); const projects = mockProjectData(3);
const projectIds = projects.map(p => p.id); const projectIds = projects.map((p) => p.id);
const mockEndpoint = 'https://mock-endpoint'; const mockEndpoint = 'https://mock-endpoint';
let localState; let localState;
...@@ -135,7 +135,7 @@ describe('mutations', () => { ...@@ -135,7 +135,7 @@ describe('mutations', () => {
}); });
it('orders the projects from localstorage', () => { it('orders the projects from localstorage', () => {
jest.spyOn(window.localStorage, 'getItem').mockImplementation(key => { jest.spyOn(window.localStorage, 'getItem').mockImplementation((key) => {
if (key === projectListEndpoint) { if (key === projectListEndpoint) {
return '2,0,1'; return '2,0,1';
} }
...@@ -149,7 +149,7 @@ describe('mutations', () => { ...@@ -149,7 +149,7 @@ describe('mutations', () => {
}); });
it('places unsorted projects after sorted ones', () => { it('places unsorted projects after sorted ones', () => {
jest.spyOn(window.localStorage, 'getItem').mockImplementation(key => { jest.spyOn(window.localStorage, 'getItem').mockImplementation((key) => {
if (key === projectListEndpoint) { if (key === projectListEndpoint) {
return '1,2'; return '1,2';
} }
......
...@@ -5,7 +5,7 @@ import { mockTracking } from 'helpers/tracking_helper'; ...@@ -5,7 +5,7 @@ import { mockTracking } from 'helpers/tracking_helper';
describe('Card security discover app', () => { describe('Card security discover app', () => {
let wrapper; let wrapper;
const createComponent = propsData => { const createComponent = (propsData) => {
wrapper = shallowMount(CardSecurityDiscoverApp, { wrapper = shallowMount(CardSecurityDiscoverApp, {
propsData, 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