Commit 99bff445 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 48 of 73

Part of our prettier migration; changing the arrow-parens style.
parent d1b6d05c
...@@ -1369,39 +1369,6 @@ ee/app/assets/javascripts/vulnerabilities/components/resolution_alert.vue ...@@ -1369,39 +1369,6 @@ ee/app/assets/javascripts/vulnerabilities/components/resolution_alert.vue
ee/app/assets/javascripts/vulnerabilities/helpers.js ee/app/assets/javascripts/vulnerabilities/helpers.js
ee/app/assets/javascripts/vulnerabilities/vulnerabilities_init.js ee/app/assets/javascripts/vulnerabilities/vulnerabilities_init.js
## boring-brattain
ee/spec/frontend/issues_analytics/components/issues_analytics_spec.js
ee/spec/frontend/issues_analytics/components/issues_analytics_table_spec.js
ee/spec/frontend/issues_analytics/mock_data.js
ee/spec/frontend/iterations/components/iteration_report_tabs_spec.js
ee/spec/frontend/iterations/components/iterations_spec.js
ee/spec/frontend/license_compliance/components/app_spec.js
ee/spec/frontend/license_compliance/components/license_component_links_spec.js
ee/spec/frontend/license_compliance/components/licenses_table_spec.js
ee/spec/frontend/maintenance_mode_settings/components/app_spec.js
ee/spec/frontend/members/components/ldap/ldap_override_confirmation_modal_spec.js
ee/spec/frontend/members/components/table/members_table_spec.js
ee/spec/frontend/members/utils_spec.js
ee/spec/frontend/notes/components/note_header_spec.js
ee/spec/frontend/on_demand_scans/components/on_demand_scans_app_spec.js
ee/spec/frontend/on_demand_scans/components/on_demand_scans_form_spec.js
ee/spec/frontend/on_demand_scans/components/profile_selector/profile_selector_spec.js
ee/spec/frontend/on_demand_scans/components/profile_selector/scanner_profile_selector_spec.js
ee/spec/frontend/on_demand_scans/components/profile_selector/site_profile_selector_spec.js
ee/spec/frontend/on_demand_scans/mocks/apollo_mocks.js
ee/spec/frontend/oncall_schedule/schedule/components/preset_weeks/weeks_header_sub_item_spec.js
ee/spec/frontend/pages/groups/saml_providers/saml_members/store/actions_spec.js
ee/spec/frontend/projects/merge_requests/blocking_mr_input_root_spec.js
ee/spec/frontend/related_items_tree/components/create_issue_form_spec.js
ee/spec/frontend/related_items_tree/store/actions_spec.js
ee/spec/frontend/related_items_tree/store/mutations_spec.js
ee/spec/frontend/requirements/components/requirement_status_badge_spec.js
ee/spec/frontend/roadmap/components/epic_item_details_spec.js
ee/spec/frontend/roadmap/components/epic_item_spec.js
ee/spec/frontend/roadmap/components/epic_item_timeline_spec.js
ee/spec/frontend/roadmap/components/epics_list_empty_spec.js
ee/spec/frontend/roadmap/components/milestones_list_section_spec.js
## compassionate-aryabhata ## compassionate-aryabhata
ee/spec/frontend/roadmap/components/preset_months/months_header_sub_item_spec.js ee/spec/frontend/roadmap/components/preset_months/months_header_sub_item_spec.js
ee/spec/frontend/roadmap/components/preset_quarters/quarters_header_item_spec.js ee/spec/frontend/roadmap/components/preset_quarters/quarters_header_item_spec.js
......
...@@ -30,7 +30,7 @@ describe('Issue Analytics component', () => { ...@@ -30,7 +30,7 @@ describe('Issue Analytics component', () => {
store = createStore(); store = createStore();
jest.spyOn(store, 'dispatch').mockImplementation(); jest.spyOn(store, 'dispatch').mockImplementation();
mountComponent = data => { mountComponent = (data) => {
setFixtures('<div id="mock-filter"></div>'); setFixtures('<div id="mock-filter"></div>');
const propsData = data || { const propsData = data || {
endpoint: TEST_HOST, endpoint: TEST_HOST,
......
...@@ -24,12 +24,12 @@ describe('IssuesAnalyticsTable', () => { ...@@ -24,12 +24,12 @@ describe('IssuesAnalyticsTable', () => {
const findTable = () => wrapper.find(GlTable); const findTable = () => wrapper.find(GlTable);
const findIssueDetailsCol = rowIndex => const findIssueDetailsCol = (rowIndex) =>
findTable().findAll('[data-testid="detailsCol"]').at(rowIndex); findTable().findAll('[data-testid="detailsCol"]').at(rowIndex);
const findAgeCol = rowIndex => findTable().findAll('[data-testid="ageCol"]').at(rowIndex); const findAgeCol = (rowIndex) => findTable().findAll('[data-testid="ageCol"]').at(rowIndex);
const findStatusCol = rowIndex => findTable().findAll('[data-testid="statusCol"]').at(rowIndex); const findStatusCol = (rowIndex) => findTable().findAll('[data-testid="statusCol"]').at(rowIndex);
beforeEach(() => { beforeEach(() => {
jest.spyOn(Date, 'now').mockImplementation(() => new Date('2020-01-08')); jest.spyOn(Date, 'now').mockImplementation(() => new Date('2020-01-08'));
......
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
const createIssue = values => { const createIssue = (values) => {
return { return {
state: 'closed', state: 'closed',
epic: { epic: {
......
...@@ -91,7 +91,7 @@ describe('Iterations report tabs', () => { ...@@ -91,7 +91,7 @@ describe('Iterations report tabs', () => {
})); }));
const findIssues = () => wrapper.findAll('table tbody tr'); const findIssues = () => wrapper.findAll('table tbody tr');
const findAssigneesForIssue = index => findIssues().at(index).findAll(GlAvatar); const findAssigneesForIssue = (index) => findIssues().at(index).findAll(GlAvatar);
beforeEach(() => { beforeEach(() => {
mountComponent(); mountComponent();
...@@ -123,7 +123,7 @@ describe('Iterations report tabs', () => { ...@@ -123,7 +123,7 @@ describe('Iterations report tabs', () => {
describe('pagination', () => { describe('pagination', () => {
const findPagination = () => wrapper.find(GlPagination); const findPagination = () => wrapper.find(GlPagination);
const setPage = page => { const setPage = (page) => {
findPagination().vm.$emit('input', page); findPagination().vm.$emit('input', page);
return findPagination().vm.$nextTick(); return findPagination().vm.$nextTick();
}; };
......
...@@ -65,7 +65,7 @@ describe('Iterations', () => { ...@@ -65,7 +65,7 @@ describe('Iterations', () => {
describe('pagination', () => { describe('pagination', () => {
const findPagination = () => wrapper.find(GlPagination); const findPagination = () => wrapper.find(GlPagination);
const setPage = page => { const setPage = (page) => {
findPagination().vm.$emit('input', page); findPagination().vm.$emit('input', page);
return findPagination().vm.$nextTick(); return findPagination().vm.$nextTick();
}; };
......
...@@ -83,7 +83,7 @@ const createComponent = ({ state, props, options }) => { ...@@ -83,7 +83,7 @@ const createComponent = ({ state, props, options }) => {
}); });
}; };
const findByTestId = testId => wrapper.find(`[data-testid="${testId}"]`); const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`);
describe('Project Licenses', () => { describe('Project Licenses', () => {
afterEach(() => { afterEach(() => {
......
...@@ -7,8 +7,8 @@ import LicenseComponentLinks, { ...@@ -7,8 +7,8 @@ import LicenseComponentLinks, {
describe('LicenseComponentLinks component', () => { describe('LicenseComponentLinks component', () => {
// data helpers // data helpers
const createComponents = n => const createComponents = (n) =>
[...Array(n).keys()].map(i => ({ [...Array(n).keys()].map((i) => ({
name: `component ${i + 1}`, name: `component ${i + 1}`,
version: (i + 1) % 2 === 0 ? null : `${i + 1}.0.0`, version: (i + 1) % 2 === 0 ? null : `${i + 1}.0.0`,
})); }));
...@@ -61,7 +61,7 @@ describe('LicenseComponentLinks component', () => { ...@@ -61,7 +61,7 @@ describe('LicenseComponentLinks component', () => {
expect(intersperseInstance.attributes('lastseparator')).toBe(' and '); expect(intersperseInstance.attributes('lastseparator')).toBe(' and ');
}); });
it.each([3, 5, 8, 13])('limits the number of visible licenses to 2', numComponents => { it.each([3, 5, 8, 13])('limits the number of visible licenses to 2', (numComponents) => {
factory({ numComponents }); factory({ numComponents });
expect(findComponentListItems()).toHaveLength(VISIBLE_COMPONENT_COUNT); expect(findComponentListItems()).toHaveLength(VISIBLE_COMPONENT_COUNT);
...@@ -96,7 +96,7 @@ describe('LicenseComponentLinks component', () => { ...@@ -96,7 +96,7 @@ describe('LicenseComponentLinks component', () => {
const links = wrapper.findAll(GlLink); const links = wrapper.findAll(GlLink);
links.wrappers.forEach(link => { links.wrappers.forEach((link) => {
expect(link.attributes('target')).toBe('_blank'); expect(link.attributes('target')).toBe('_blank');
}); });
}); });
......
...@@ -36,7 +36,7 @@ describe('LicensesTable component', () => { ...@@ -36,7 +36,7 @@ describe('LicensesTable component', () => {
}); });
}); });
[true, false].forEach(isLoading => { [true, false].forEach((isLoading) => {
describe(`given a list of licenses (${isLoading ? 'loading' : 'loaded'})`, () => { describe(`given a list of licenses (${isLoading ? 'loading' : 'loaded'})`, () => {
let licenses; let licenses;
beforeEach(() => { beforeEach(() => {
...@@ -54,8 +54,8 @@ describe('LicensesTable component', () => { ...@@ -54,8 +54,8 @@ describe('LicensesTable component', () => {
it('passes the correct props to the table rows', () => { it('passes the correct props to the table rows', () => {
expect(findRows()).toHaveLength(licenses.length); expect(findRows()).toHaveLength(licenses.length);
expect(findRows().wrappers.map(x => x.props())).toEqual( expect(findRows().wrappers.map((x) => x.props())).toEqual(
licenses.map(license => ({ licenses.map((license) => ({
license, license,
isLoading, isLoading,
})), })),
......
...@@ -16,7 +16,7 @@ describe('MaintenanceModeSettingsApp', () => { ...@@ -16,7 +16,7 @@ describe('MaintenanceModeSettingsApp', () => {
setBannerMessage: jest.fn(), setBannerMessage: jest.fn(),
}; };
const createComponent = initialState => { const createComponent = (initialState) => {
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
...MOCK_BASIC_SETTINGS_DATA, ...MOCK_BASIC_SETTINGS_DATA,
......
...@@ -23,7 +23,7 @@ describe('LdapOverrideConfirmationModal', () => { ...@@ -23,7 +23,7 @@ describe('LdapOverrideConfirmationModal', () => {
actions = { actions = {
updateLdapOverride: jest.fn( updateLdapOverride: jest.fn(
() => () =>
new Promise(resolve => { new Promise((resolve) => {
resolveUpdateLdapOverride = resolve; resolveUpdateLdapOverride = resolve;
}), }),
), ),
...@@ -40,7 +40,7 @@ describe('LdapOverrideConfirmationModal', () => { ...@@ -40,7 +40,7 @@ describe('LdapOverrideConfirmationModal', () => {
}); });
}; };
const createComponent = state => { const createComponent = (state) => {
wrapper = mount(LdapOverrideConfirmationModal, { wrapper = mount(LdapOverrideConfirmationModal, {
localVue, localVue,
store: createStore(state), store: createStore(state),
......
...@@ -26,7 +26,7 @@ describe('MemberList', () => { ...@@ -26,7 +26,7 @@ describe('MemberList', () => {
}); });
}; };
const createComponent = state => { const createComponent = (state) => {
wrapper = mount(MembersTable, { wrapper = mount(MembersTable, {
localVue, localVue,
store: createStore(state), store: createStore(state),
......
...@@ -6,7 +6,7 @@ describe('Members Utils', () => { ...@@ -6,7 +6,7 @@ describe('Members Utils', () => {
it('has correct properties for each badge', () => { it('has correct properties for each badge', () => {
const badges = generateBadges(memberMock, true); const badges = generateBadges(memberMock, true);
badges.forEach(badge => { badges.forEach((badge) => {
expect(badge).toEqual( expect(badge).toEqual(
expect.objectContaining({ expect.objectContaining({
show: expect.any(Boolean), show: expect.any(Boolean),
......
...@@ -18,7 +18,7 @@ describe('NoteHeader component', () => { ...@@ -18,7 +18,7 @@ describe('NoteHeader component', () => {
username: 'root', username: 'root',
}; };
const createComponent = props => { const createComponent = (props) => {
wrapper = shallowMount(NoteHeader, { wrapper = shallowMount(NoteHeader, {
localVue, localVue,
store: new Vuex.Store(), store: new Vuex.Store(),
......
...@@ -19,7 +19,7 @@ describe('OnDemandScansApp', () => { ...@@ -19,7 +19,7 @@ describe('OnDemandScansApp', () => {
expect(wrapper.find(OnDemandScansForm).exists()).toBe(true); expect(wrapper.find(OnDemandScansForm).exists()).toBe(true);
}; };
const createComponent = options => { const createComponent = (options) => {
wrapper = shallowMount( wrapper = shallowMount(
OnDemandScansApp, OnDemandScansApp,
merge( merge(
......
...@@ -42,7 +42,7 @@ describe('OnDemandScansForm', () => { ...@@ -42,7 +42,7 @@ describe('OnDemandScansForm', () => {
let requestHandlers; let requestHandlers;
const findForm = () => subject.find(GlForm); const findForm = () => subject.find(GlForm);
const findByTestId = testId => subject.find(`[data-testid="${testId}"]`); const findByTestId = (testId) => subject.find(`[data-testid="${testId}"]`);
const findAlert = () => findByTestId('on-demand-scan-error'); const findAlert = () => findByTestId('on-demand-scan-error');
const findProfilesConflictAlert = () => findByTestId('on-demand-scans-profiles-conflict-alert'); const findProfilesConflictAlert = () => findByTestId('on-demand-scans-profiles-conflict-alert');
const findSubmitButton = () => findByTestId('on-demand-scan-submit-button'); const findSubmitButton = () => findByTestId('on-demand-scan-submit-button');
...@@ -54,7 +54,7 @@ describe('OnDemandScansForm', () => { ...@@ -54,7 +54,7 @@ describe('OnDemandScansForm', () => {
}; };
const submitForm = () => findForm().vm.$emit('submit', { preventDefault: () => {} }); const submitForm = () => findForm().vm.$emit('submit', { preventDefault: () => {} });
const createMockApolloProvider = handlers => { const createMockApolloProvider = (handlers) => {
localVue.use(VueApollo); localVue.use(VueApollo);
requestHandlers = { requestHandlers = {
...@@ -255,7 +255,7 @@ describe('OnDemandScansForm', () => { ...@@ -255,7 +255,7 @@ describe('OnDemandScansForm', () => {
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);
}); });
}); });
...@@ -343,7 +343,7 @@ describe('OnDemandScansForm', () => { ...@@ -343,7 +343,7 @@ describe('OnDemandScansForm', () => {
describe('site profile summary', () => { describe('site profile summary', () => {
const [authEnabledProfile] = siteProfiles; const [authEnabledProfile] = siteProfiles;
const selectSiteProfile = profile => { const selectSiteProfile = (profile) => {
subject.find(SiteProfileSelector).vm.$emit('input', profile.id); subject.find(SiteProfileSelector).vm.$emit('input', profile.id);
return subject.vm.$nextTick(); return subject.vm.$nextTick();
}; };
......
...@@ -13,7 +13,7 @@ describe('OnDemandScansProfileSelector', () => { ...@@ -13,7 +13,7 @@ describe('OnDemandScansProfileSelector', () => {
profiles: [], profiles: [],
}; };
const findByTestId = testId => wrapper.find(`[data-testid="${testId}"]`); const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`);
const findProfilesLibraryPathLink = () => findByTestId('manage-profiles-link'); const findProfilesLibraryPathLink = () => findByTestId('manage-profiles-link');
const findProfilesDropdown = () => findByTestId('profiles-dropdown'); const findProfilesDropdown = () => findByTestId('profiles-dropdown');
const findCreateNewProfileLink = () => findByTestId('create-profile-link'); const findCreateNewProfileLink = () => findByTestId('create-profile-link');
...@@ -21,7 +21,7 @@ describe('OnDemandScansProfileSelector', () => { ...@@ -21,7 +21,7 @@ describe('OnDemandScansProfileSelector', () => {
const parseDropdownItems = () => const parseDropdownItems = () =>
findProfilesDropdown() findProfilesDropdown()
.findAll(GlDropdownItem) .findAll(GlDropdownItem)
.wrappers.map(x => ({ .wrappers.map((x) => ({
text: x.text(), text: x.text(),
isChecked: x.props('isChecked'), isChecked: x.props('isChecked'),
})); }));
...@@ -106,7 +106,7 @@ describe('OnDemandScansProfileSelector', () => { ...@@ -106,7 +106,7 @@ describe('OnDemandScansProfileSelector', () => {
it('shows dropdown items for each profile', () => { it('shows dropdown items for each profile', () => {
expect(parseDropdownItems()).toEqual( expect(parseDropdownItems()).toEqual(
scannerProfiles.map(x => ({ scannerProfiles.map((x) => ({
text: x.profileName, text: x.profileName,
isChecked: false, isChecked: false,
})), })),
......
...@@ -9,7 +9,7 @@ const TEST_NEW_PATH = '/test/new/scanner/profile/path'; ...@@ -9,7 +9,7 @@ const TEST_NEW_PATH = '/test/new/scanner/profile/path';
const TEST_ATTRS = { const TEST_ATTRS = {
'data-foo': 'bar', 'data-foo': 'bar',
}; };
const profiles = scannerProfiles.map(x => { const profiles = scannerProfiles.map((x) => {
const suffix = x.scanType === 'ACTIVE' ? 'Active' : 'Passive'; const suffix = x.scanType === 'ACTIVE' ? 'Active' : 'Passive';
return { ...x, dropdownLabel: `${x.profileName} (${suffix})` }; return { ...x, dropdownLabel: `${x.profileName} (${suffix})` };
}); });
...@@ -106,7 +106,7 @@ describe('OnDemandScansScannerProfileSelector', () => { ...@@ -106,7 +106,7 @@ describe('OnDemandScansScannerProfileSelector', () => {
expect(sel.props()).toEqual({ expect(sel.props()).toEqual({
libraryPath: TEST_LIBRARY_PATH, libraryPath: TEST_LIBRARY_PATH,
newProfilePath: TEST_NEW_PATH, newProfilePath: TEST_NEW_PATH,
profiles: scannerProfiles.map(x => ({ ...x, dropdownLabel: `${x.profileName}` })), profiles: scannerProfiles.map((x) => ({ ...x, dropdownLabel: `${x.profileName}` })),
value: null, value: null,
}); });
expect(sel.attributes()).toMatchObject(TEST_ATTRS); expect(sel.attributes()).toMatchObject(TEST_ATTRS);
......
...@@ -9,7 +9,7 @@ const TEST_NEW_PATH = '/test/new/site/profile/path'; ...@@ -9,7 +9,7 @@ const TEST_NEW_PATH = '/test/new/site/profile/path';
const TEST_ATTRS = { const TEST_ATTRS = {
'data-foo': 'bar', 'data-foo': 'bar',
}; };
const profiles = siteProfiles.map(x => { const profiles = siteProfiles.map((x) => {
const suffix = x.validationStatus === 'PASSED_VALIDATION' ? 'Validated' : 'Not Validated'; const suffix = x.validationStatus === 'PASSED_VALIDATION' ? 'Validated' : 'Not Validated';
return { return {
...x, ...x,
...@@ -115,7 +115,7 @@ describe('OnDemandScansSiteProfileSelector', () => { ...@@ -115,7 +115,7 @@ describe('OnDemandScansSiteProfileSelector', () => {
expect(sel.props()).toEqual({ expect(sel.props()).toEqual({
libraryPath: TEST_LIBRARY_PATH, libraryPath: TEST_LIBRARY_PATH,
newProfilePath: TEST_NEW_PATH, newProfilePath: TEST_NEW_PATH,
profiles: siteProfiles.map(x => ({ profiles: siteProfiles.map((x) => ({
...x, ...x,
dropdownLabel: `${x.profileName}: ${x.targetUrl}`, dropdownLabel: `${x.profileName}: ${x.targetUrl}`,
})), })),
......
...@@ -14,7 +14,7 @@ export const dastScannerProfiles = (profiles = scannerProfiles) => ({ ...@@ -14,7 +14,7 @@ export const dastScannerProfiles = (profiles = scannerProfiles) => ({
project: { project: {
scannerProfiles: { scannerProfiles: {
...defaults, ...defaults,
edges: profiles.map(profile => ({ edges: profiles.map((profile) => ({
cursor: '', cursor: '',
node: profile, node: profile,
})), })),
...@@ -28,7 +28,7 @@ export const dastSiteProfiles = (profiles = siteProfiles) => ({ ...@@ -28,7 +28,7 @@ export const dastSiteProfiles = (profiles = siteProfiles) => ({
project: { project: {
siteProfiles: { siteProfiles: {
...defaults, ...defaults,
edges: profiles.map(profile => ({ edges: profiles.map((profile) => ({
cursor: '', cursor: '',
node: profile, node: profile,
})), })),
......
...@@ -36,7 +36,7 @@ describe('WeeksHeaderSubItemComponent', () => { ...@@ -36,7 +36,7 @@ describe('WeeksHeaderSubItemComponent', () => {
it('returns `headerSubItems` array of dates containing days of week from timeframeItem', () => { it('returns `headerSubItems` array of dates containing days of week from timeframeItem', () => {
expect(wrapper.vm.headerSubItems).toBeInstanceOf(Array); expect(wrapper.vm.headerSubItems).toBeInstanceOf(Array);
expect(wrapper.vm.headerSubItems).toHaveLength(7); expect(wrapper.vm.headerSubItems).toHaveLength(7);
wrapper.vm.headerSubItems.forEach(subItem => { wrapper.vm.headerSubItems.forEach((subItem) => {
expect(subItem).toBeInstanceOf(Date); expect(subItem).toBeInstanceOf(Date);
}); });
}); });
......
...@@ -23,7 +23,7 @@ describe('saml_members actions', () => { ...@@ -23,7 +23,7 @@ describe('saml_members actions', () => {
}); });
describe('fetchPage', () => { describe('fetchPage', () => {
it('should commit RECEIVE_SAML_MEMBERS_SUCCESS mutation on correct data', done => { it('should commit RECEIVE_SAML_MEMBERS_SUCCESS mutation on correct data', (done) => {
const members = [ const members = [
{ id: 1, name: 'user 1', group_saml_identity: null }, { id: 1, name: 'user 1', group_saml_identity: null },
{ id: 2, name: 'user 2', group_saml_identity: { extern_uid: 'a' } }, { id: 2, name: 'user 2', group_saml_identity: { extern_uid: 'a' } },
...@@ -72,7 +72,7 @@ describe('saml_members actions', () => { ...@@ -72,7 +72,7 @@ describe('saml_members actions', () => {
); );
}); });
it('should show flash on wrong data', done => { it('should show flash on wrong data', (done) => {
Api.groupMembers.mockReturnValue(Promise.reject(new Error())); Api.groupMembers.mockReturnValue(Promise.reject(new Error()));
testAction(fetchPage, undefined, state, [], [], () => { testAction(fetchPage, undefined, state, [], [], () => {
expect(flash).toHaveBeenCalledTimes(1); expect(flash).toHaveBeenCalledTimes(1);
......
...@@ -6,19 +6,19 @@ describe('blocking mr input root', () => { ...@@ -6,19 +6,19 @@ describe('blocking mr input root', () => {
let wrapper; let wrapper;
const getInput = () => wrapper.find(RelatedIssuableInput); const getInput = () => wrapper.find(RelatedIssuableInput);
const addTokenizedInput = input => { const addTokenizedInput = (input) => {
getInput().vm.$emit('addIssuableFormInput', { getInput().vm.$emit('addIssuableFormInput', {
untouchedRawReferences: [input], untouchedRawReferences: [input],
touchedReference: '', touchedReference: '',
}); });
}; };
const addInput = input => { const addInput = (input) => {
getInput().vm.$emit('addIssuableFormInput', { getInput().vm.$emit('addIssuableFormInput', {
untouchedRawReferences: [], untouchedRawReferences: [],
touchedReference: input, touchedReference: input,
}); });
}; };
const removeRef = index => { const removeRef = (index) => {
getInput().vm.$emit('pendingIssuableRemoveRequest', index); getInput().vm.$emit('pendingIssuableRemoveRequest', index);
}; };
const createComponent = (propsData = {}) => { const createComponent = (propsData = {}) => {
...@@ -71,7 +71,7 @@ describe('blocking mr input root', () => { ...@@ -71,7 +71,7 @@ describe('blocking mr input root', () => {
}); });
describe('hidden inputs', () => { describe('hidden inputs', () => {
const createHiddenInputExpectation = selector => bool => { const createHiddenInputExpectation = (selector) => (bool) => {
expect(wrapper.find(selector).element.value).toBe(`${bool}`); expect(wrapper.find(selector).element.value).toBe(`${bool}`);
}; };
......
...@@ -187,7 +187,7 @@ describe('CreateIssueForm', () => { ...@@ -187,7 +187,7 @@ describe('CreateIssueForm', () => {
it('renders Projects dropdown contents containing only matching project when searchKey is provided', () => { it('renders Projects dropdown contents containing only matching project when searchKey is provided', () => {
const searchKey = 'Underscore'; const searchKey = 'Underscore';
const filteredMockProjects = mockProjects.filter(project => project.name === searchKey); const filteredMockProjects = mockProjects.filter((project) => project.name === searchKey);
jest.spyOn(wrapper.vm, 'fetchProjects').mockImplementation(jest.fn()); jest.spyOn(wrapper.vm, 'fetchProjects').mockImplementation(jest.fn());
wrapper.find(GlDeprecatedDropdown).trigger('click'); wrapper.find(GlDeprecatedDropdown).trigger('click');
...@@ -208,7 +208,7 @@ describe('CreateIssueForm', () => { ...@@ -208,7 +208,7 @@ describe('CreateIssueForm', () => {
it('renders Projects dropdown contents containing string string "No matches found" when searchKey provided does not match any project', () => { it('renders Projects dropdown contents containing string string "No matches found" when searchKey provided does not match any project', () => {
const searchKey = "this-project-shouldn't exist"; const searchKey = "this-project-shouldn't exist";
const filteredMockProjects = mockProjects.filter(project => project.name === searchKey); const filteredMockProjects = mockProjects.filter((project) => project.name === searchKey);
jest.spyOn(wrapper.vm, 'fetchProjects').mockImplementation(jest.fn()); jest.spyOn(wrapper.vm, 'fetchProjects').mockImplementation(jest.fn());
wrapper.find(GlDeprecatedDropdown).trigger('click'); wrapper.find(GlDeprecatedDropdown).trigger('click');
......
...@@ -40,7 +40,7 @@ describe('RelatedItemTree', () => { ...@@ -40,7 +40,7 @@ describe('RelatedItemTree', () => {
describe('store', () => { describe('store', () => {
describe('actions', () => { describe('actions', () => {
let state; let state;
const mockItems = mockEpics.map(item => const mockItems = mockEpics.map((item) =>
epicUtils.formatChildItem(Object.assign(item, { type: ChildType.Epic })), epicUtils.formatChildItem(Object.assign(item, { type: ChildType.Epic })),
); );
...@@ -101,9 +101,9 @@ describe('RelatedItemTree', () => { ...@@ -101,9 +101,9 @@ describe('RelatedItemTree', () => {
}); });
describe('updateChildrenCount', () => { describe('updateChildrenCount', () => {
const mockEpicsWithType = mockEpics.map(item => ({ ...item, type: ChildType.Epic })); const mockEpicsWithType = mockEpics.map((item) => ({ ...item, type: ChildType.Epic }));
const mockIssuesWithType = mockIssues.map(item => ({ ...item, type: ChildType.Issue })); const mockIssuesWithType = mockIssues.map((item) => ({ ...item, type: ChildType.Issue }));
it('should update openedEpics, by incrementing it', () => { it('should update openedEpics, by incrementing it', () => {
testAction( testAction(
...@@ -826,7 +826,7 @@ describe('RelatedItemTree', () => { ...@@ -826,7 +826,7 @@ describe('RelatedItemTree', () => {
state.issuableType = issuableTypesMap.EPIC; state.issuableType = issuableTypesMap.EPIC;
state.isEpic = true; state.isEpic = true;
const mockEpicsWithoutPerm = mockEpics.map(item => ({ const mockEpicsWithoutPerm = mockEpics.map((item) => ({
...item, ...item,
pathIdSeparator: PathIdSeparator.Epic, pathIdSeparator: PathIdSeparator.Epic,
userPermissions: { adminEpic: undefined }, userPermissions: { adminEpic: undefined },
...@@ -1511,7 +1511,7 @@ describe('RelatedItemTree', () => { ...@@ -1511,7 +1511,7 @@ describe('RelatedItemTree', () => {
beforeEach(() => { beforeEach(() => {
requestSpy = jest.fn(); requestSpy = jest.fn();
axiosMock.onPost(issuesEndpoint).replyOnce(config => requestSpy(config)); axiosMock.onPost(issuesEndpoint).replyOnce((config) => requestSpy(config));
context = { context = {
state: { state: {
...@@ -1551,7 +1551,7 @@ describe('RelatedItemTree', () => { ...@@ -1551,7 +1551,7 @@ describe('RelatedItemTree', () => {
requestSpy.mockReturnValue([500, '']); requestSpy.mockReturnValue([500, '']);
}); });
it('fails and shows flash message', done => { it('fails and shows flash message', (done) => {
return actions return actions
.createNewIssue(context, payload) .createNewIssue(context, payload)
.then(() => done.fail('expected action to throw error!')) .then(() => done.fail('expected action to throw error!'))
......
...@@ -118,7 +118,7 @@ describe('RelatedItemsTree', () => { ...@@ -118,7 +118,7 @@ describe('RelatedItemsTree', () => {
mutations[types.SET_ITEM_CHILDREN_FLAGS](state, data); mutations[types.SET_ITEM_CHILDREN_FLAGS](state, data);
data.children.forEach(item => { data.children.forEach((item) => {
expect(state.childrenFlags[item.reference]).toEqual( expect(state.childrenFlags[item.reference]).toEqual(
expect.objectContaining({ expect.objectContaining({
itemExpanded: false, itemExpanded: false,
......
...@@ -15,8 +15,8 @@ const createComponent = ({ ...@@ -15,8 +15,8 @@ const createComponent = ({
}, },
}); });
const findGlBadge = wrapper => wrapper.find(GlBadge); const findGlBadge = (wrapper) => wrapper.find(GlBadge);
const findGlTooltip = wrapper => wrapper.find(GlTooltip); const findGlTooltip = (wrapper) => wrapper.find(GlTooltip);
const successBadgeProps = { const successBadgeProps = {
variant: 'success', variant: 'success',
......
...@@ -69,7 +69,7 @@ describe('EpicItemDetails', () => { ...@@ -69,7 +69,7 @@ describe('EpicItemDetails', () => {
title: getGroupName().attributes('title'), title: getGroupName().attributes('title'),
}); });
const createMockEpic = epic => ({ const createMockEpic = (epic) => ({
...mockFormattedEpic, ...mockFormattedEpic,
...epic, ...epic,
}); });
......
...@@ -17,7 +17,7 @@ import { ...@@ -17,7 +17,7 @@ import {
} from 'ee_jest/roadmap/mock_data'; } from 'ee_jest/roadmap/mock_data';
jest.mock('lodash/delay', () => jest.mock('lodash/delay', () =>
jest.fn(func => { jest.fn((func) => {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
func.delay = jest.fn(); func.delay = jest.fn();
return func; return func;
......
...@@ -26,7 +26,7 @@ const createComponent = ({ ...@@ -26,7 +26,7 @@ const createComponent = ({
}); });
}; };
const getEpicBar = wrapper => wrapper.find('.epic-bar'); const getEpicBar = (wrapper) => wrapper.find('.epic-bar');
describe('EpicItemTimelineComponent', () => { describe('EpicItemTimelineComponent', () => {
let wrapper; let wrapper;
......
...@@ -55,7 +55,7 @@ describe('EpicsListEmptyComponent', () => { ...@@ -55,7 +55,7 @@ describe('EpicsListEmptyComponent', () => {
expect(vm.message).toBe('The roadmap shows the progress of your epics along a timeline'); expect(vm.message).toBe('The roadmap shows the progress of your epics along a timeline');
}); });
it('returns empty state message when `hasFiltersApplied` prop is true', done => { it('returns empty state message when `hasFiltersApplied` prop is true', (done) => {
vm.hasFiltersApplied = true; vm.hasFiltersApplied = true;
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
...@@ -74,7 +74,7 @@ describe('EpicsListEmptyComponent', () => { ...@@ -74,7 +74,7 @@ describe('EpicsListEmptyComponent', () => {
vm.timeframeEnd = mockTimeframeQuarters[mockTimeframeQuarters.length - 1]; vm.timeframeEnd = mockTimeframeQuarters[mockTimeframeQuarters.length - 1];
}); });
it('returns default empty state sub-message when `hasFiltersApplied` props is false', done => { it('returns default empty state sub-message when `hasFiltersApplied` props is false', (done) => {
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
expect(vm.subMessage).toBe( expect(vm.subMessage).toBe(
...@@ -85,7 +85,7 @@ describe('EpicsListEmptyComponent', () => { ...@@ -85,7 +85,7 @@ describe('EpicsListEmptyComponent', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('returns empty state sub-message when `hasFiltersApplied` prop is true', done => { it('returns empty state sub-message when `hasFiltersApplied` prop is true', (done) => {
vm.hasFiltersApplied = true; vm.hasFiltersApplied = true;
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
...@@ -103,7 +103,7 @@ describe('EpicsListEmptyComponent', () => { ...@@ -103,7 +103,7 @@ describe('EpicsListEmptyComponent', () => {
vm.presetType = PRESET_TYPES.MONTHS; vm.presetType = PRESET_TYPES.MONTHS;
}); });
it('returns default empty state sub-message when `hasFiltersApplied` props is false', done => { it('returns default empty state sub-message when `hasFiltersApplied` props is false', (done) => {
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
expect(vm.subMessage).toBe( expect(vm.subMessage).toBe(
...@@ -114,7 +114,7 @@ describe('EpicsListEmptyComponent', () => { ...@@ -114,7 +114,7 @@ describe('EpicsListEmptyComponent', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('returns empty state sub-message when `hasFiltersApplied` prop is true', done => { it('returns empty state sub-message when `hasFiltersApplied` prop is true', (done) => {
vm.hasFiltersApplied = true; vm.hasFiltersApplied = true;
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
...@@ -137,7 +137,7 @@ describe('EpicsListEmptyComponent', () => { ...@@ -137,7 +137,7 @@ describe('EpicsListEmptyComponent', () => {
vm.timeframeEnd = timeframeEnd; vm.timeframeEnd = timeframeEnd;
}); });
it('returns default empty state sub-message when `hasFiltersApplied` props is false', done => { it('returns default empty state sub-message when `hasFiltersApplied` props is false', (done) => {
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
expect(vm.subMessage).toBe( expect(vm.subMessage).toBe(
...@@ -148,7 +148,7 @@ describe('EpicsListEmptyComponent', () => { ...@@ -148,7 +148,7 @@ describe('EpicsListEmptyComponent', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('returns empty state sub-message when `hasFiltersApplied` prop is true', done => { it('returns empty state sub-message when `hasFiltersApplied` prop is true', (done) => {
vm.hasFiltersApplied = true; vm.hasFiltersApplied = true;
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
...@@ -162,7 +162,7 @@ describe('EpicsListEmptyComponent', () => { ...@@ -162,7 +162,7 @@ describe('EpicsListEmptyComponent', () => {
}); });
describe('with child epics context', () => { describe('with child epics context', () => {
it('returns empty state sub-message when `isChildEpics` is set to `true`', done => { it('returns empty state sub-message when `isChildEpics` is set to `true`', (done) => {
vm.isChildEpics = true; vm.isChildEpics = true;
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
...@@ -195,7 +195,7 @@ describe('EpicsListEmptyComponent', () => { ...@@ -195,7 +195,7 @@ describe('EpicsListEmptyComponent', () => {
expect(vm.$el.querySelector('#epic-create-root')).not.toBeNull(); expect(vm.$el.querySelector('#epic-create-root')).not.toBeNull();
}); });
it('does not render new epic button element when `hasFiltersApplied` prop is true', done => { it('does not render new epic button element when `hasFiltersApplied` prop is true', (done) => {
vm.hasFiltersApplied = true; vm.hasFiltersApplied = true;
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
......
...@@ -12,7 +12,7 @@ import { getTimeframeForMonthsView } from 'ee/roadmap/utils/roadmap_utils'; ...@@ -12,7 +12,7 @@ import { getTimeframeForMonthsView } from 'ee/roadmap/utils/roadmap_utils';
import { mockTimeframeInitialDate, mockGroupId, rawMilestones } from 'ee_jest/roadmap/mock_data'; import { mockTimeframeInitialDate, mockGroupId, rawMilestones } from 'ee_jest/roadmap/mock_data';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
const initializeStore = mockTimeframeMonths => { const initializeStore = (mockTimeframeMonths) => {
const store = createStore(); const store = createStore();
store.dispatch('setInitialData', { store.dispatch('setInitialData', {
currentGroupId: mockGroupId, currentGroupId: mockGroupId,
......
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