Commit d1b6d05c authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 31 files - 47 of 73

Part of our prettier migration; changing the arrow-parens style.
parent 557c22a8
...@@ -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
## gallant-ride
ee/spec/frontend/diffs/components/diff_line_note_form_spec.js
ee/spec/frontend/environments/canary_ingress_spec.js
ee/spec/frontend/environments/deploy_board_component_spec.js
ee/spec/frontend/environments/environments_app_spec.js
ee/spec/frontend/environments/environments_table_spec.js
ee/spec/frontend/environments/mock_data.js
ee/spec/frontend/environments_dashboard/components/project_header_spec.js
ee/spec/frontend/epic/components/sidebar_items/sidebar_date_picker_spec.js
ee/spec/frontend/epic/components/sidebar_items/sidebar_header_spec.js
ee/spec/frontend/epic/components/sidebar_items/sidebar_todo_spec.js
ee/spec/frontend/epic/store/actions_spec.js
ee/spec/frontend/filtered_search/issues_filtered_search_token_keys_spec.js
ee/spec/frontend/geo_node_form/components/geo_node_form_namespaces_spec.js
ee/spec/frontend/geo_nodes/components/app_spec.js
ee/spec/frontend/geo_nodes/components/geo_node_header_spec.js
ee/spec/frontend/geo_nodes/components/geo_node_sync_progress_spec.js
ee/spec/frontend/geo_nodes/components/node_detail_sections/node_details_section_main_spec.js
ee/spec/frontend/geo_nodes/components/node_detail_sections/node_details_section_other_spec.js
ee/spec/frontend/geo_nodes/store/geo_nodes_store_spec.js
ee/spec/frontend/geo_replicable/components/app_spec.js
ee/spec/frontend/geo_replicable/components/geo_replicable_filter_bar_spec.js
ee/spec/frontend/geo_replicable/components/geo_replicable_spec.js
ee/spec/frontend/geo_replicable/store/actions_spec.js
ee/spec/frontend/group_member_contributions/components/table_header_spec.js
ee/spec/frontend/group_member_contributions/store/group_member_store_spec.js
ee/spec/frontend/groups/components/invite_members_spec.js
ee/spec/frontend/groups/components/registration_trial_toggle_spec.js
ee/spec/frontend/groups/settings/compliance_frameworks/components/list_spec.js
ee/spec/frontend/groups/settings/components/comma_separated_list_token_selector_spec.js
ee/spec/frontend/insights/components/insights_chart_spec.js
ee/spec/frontend/issue_show/components/incidents/incident_sla_spec.js
## boring-brattain ## boring-brattain
ee/spec/frontend/issues_analytics/components/issues_analytics_spec.js 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/components/issues_analytics_table_spec.js
......
...@@ -13,7 +13,7 @@ describe('EE DiffLineNoteForm', () => { ...@@ -13,7 +13,7 @@ describe('EE DiffLineNoteForm', () => {
let saveDraft; let saveDraft;
let wrapper; let wrapper;
const createStoreOptions = headSha => { const createStoreOptions = (headSha) => {
const state = { const state = {
notes: { notes: {
notesData: { draftsPath: null }, notesData: { draftsPath: null },
......
...@@ -64,7 +64,7 @@ describe('ee/environments/components/canary_ingress.vue', () => { ...@@ -64,7 +64,7 @@ describe('ee/environments/components/canary_ingress.vue', () => {
it('is set to open the change modal', () => { it('is set to open the change modal', () => {
stableWeightDropdown stableWeightDropdown
.findAll(GlDropdownItem) .findAll(GlDropdownItem)
.wrappers.forEach(w => .wrappers.forEach((w) =>
expect(getBinding(w.element, 'gl-modal')).toMatchObject({ value: CANARY_UPDATE_MODAL }), expect(getBinding(w.element, 'gl-modal')).toMatchObject({ value: CANARY_UPDATE_MODAL }),
); );
}); });
......
...@@ -23,7 +23,7 @@ describe('Deploy Board', () => { ...@@ -23,7 +23,7 @@ describe('Deploy Board', () => {
}); });
describe('with valid data', () => { describe('with valid data', () => {
beforeEach(done => { beforeEach((done) => {
wrapper = createComponent(); wrapper = createComponent();
wrapper.vm.$nextTick(done); wrapper.vm.$nextTick(done);
}); });
...@@ -73,7 +73,7 @@ describe('Deploy Board', () => { ...@@ -73,7 +73,7 @@ describe('Deploy Board', () => {
}); });
describe('with empty state', () => { describe('with empty state', () => {
beforeEach(done => { beforeEach((done) => {
wrapper = createComponent({ wrapper = createComponent({
deployBoardData: {}, deployBoardData: {},
isLoading: false, isLoading: false,
...@@ -92,7 +92,7 @@ describe('Deploy Board', () => { ...@@ -92,7 +92,7 @@ describe('Deploy Board', () => {
}); });
describe('with loading state', () => { describe('with loading state', () => {
beforeEach(done => { beforeEach((done) => {
wrapper = createComponent({ wrapper = createComponent({
deployBoardData: {}, deployBoardData: {},
isLoading: true, isLoading: true,
...@@ -109,7 +109,7 @@ describe('Deploy Board', () => { ...@@ -109,7 +109,7 @@ describe('Deploy Board', () => {
describe('has legend component', () => { describe('has legend component', () => {
let statuses = []; let statuses = [];
beforeEach(done => { beforeEach((done) => {
wrapper = createComponent({ wrapper = createComponent({
isLoading: false, isLoading: false,
isEmpty: false, isEmpty: false,
...@@ -127,7 +127,7 @@ describe('Deploy Board', () => { ...@@ -127,7 +127,7 @@ describe('Deploy Board', () => {
expect(deployBoardLegend.findAll('a')).toHaveLength(Object.keys(statuses).length); expect(deployBoardLegend.findAll('a')).toHaveLength(Object.keys(statuses).length);
}); });
Object.keys(statuses).forEach(item => { Object.keys(statuses).forEach((item) => {
it(`with ${item} text next to deployment instance icon`, () => { it(`with ${item} text next to deployment instance icon`, () => {
expect(wrapper.find(`.deployment-instance-${item}`)).toBeDefined(); expect(wrapper.find(`.deployment-instance-${item}`)).toBeDefined();
expect(wrapper.find(`.deployment-instance-${item} + .legend-text`).text()).toBe( expect(wrapper.find(`.deployment-instance-${item} + .legend-text`).text()).toBe(
......
...@@ -31,7 +31,7 @@ describe('Environment', () => { ...@@ -31,7 +31,7 @@ describe('Environment', () => {
return axios.waitForAll(); return axios.waitForAll();
}; };
const mockRequest = environmentList => { const mockRequest = (environmentList) => {
mock.onGet(mockData.endpoint).reply( mock.onGet(mockData.endpoint).reply(
200, 200,
{ {
......
...@@ -80,7 +80,7 @@ describe('Environment table', () => { ...@@ -80,7 +80,7 @@ describe('Environment table', () => {
expect(wrapper.find('.deploy-board-icon').exists()).toBe(true); expect(wrapper.find('.deploy-board-icon').exists()).toBe(true);
}); });
it('should toggle deploy board visibility when arrow is clicked', done => { it('should toggle deploy board visibility when arrow is clicked', (done) => {
const mockItem = { const mockItem = {
name: 'review', name: 'review',
size: 1, size: 1,
...@@ -98,7 +98,7 @@ describe('Environment table', () => { ...@@ -98,7 +98,7 @@ describe('Environment table', () => {
isDeployBoardVisible: false, isDeployBoardVisible: false,
}; };
eventHub.$on('toggleDeployBoard', env => { eventHub.$on('toggleDeployBoard', (env) => {
expect(env.id).toEqual(mockItem.id); expect(env.id).toEqual(mockItem.id);
done(); done();
}); });
......
...@@ -104,7 +104,7 @@ export const environment = { ...@@ -104,7 +104,7 @@ export const environment = {
updated_at: '2016-11-10T15:55:58.778Z', updated_at: '2016-11-10T15:55:58.778Z',
}; };
const sharedEnvironmentData = id => ({ const sharedEnvironmentData = (id) => ({
environment_path: `/root/review-app/environments/${id}`, environment_path: `/root/review-app/environments/${id}`,
external_url: null, external_url: null,
folderName: 'build', folderName: 'build',
......
...@@ -68,7 +68,7 @@ describe('Project Header', () => { ...@@ -68,7 +68,7 @@ describe('Project Header', () => {
const removeLink = wrapper const removeLink = wrapper
.find(GlDropdown) .find(GlDropdown)
.findAll(GlDropdownItem) .findAll(GlDropdownItem)
.filter(w => w.text() === 'Remove'); .filter((w) => w.text() === 'Remove');
expect(removeLink.exists()).toBe(true); expect(removeLink.exists()).toBe(true);
}); });
...@@ -76,7 +76,7 @@ describe('Project Header', () => { ...@@ -76,7 +76,7 @@ describe('Project Header', () => {
const removeLink = wrapper const removeLink = wrapper
.find(GlDropdown) .find(GlDropdown)
.findAll(GlDropdownItem) .findAll(GlDropdownItem)
.filter(w => w.text() === 'Remove'); .filter((w) => w.text() === 'Remove');
removeLink.at(0).vm.$emit('click'); removeLink.at(0).vm.$emit('click');
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
......
...@@ -20,10 +20,10 @@ describe('SidebarDatePicker', () => { ...@@ -20,10 +20,10 @@ describe('SidebarDatePicker', () => {
let wrapper; let wrapper;
const findIconByName = name => const findIconByName = (name) =>
wrapper wrapper
.findAll(GlIcon) .findAll(GlIcon)
.filter(w => w.props().name === name) .filter((w) => w.props().name === name)
.at(0); .at(0);
const findEditButton = () => wrapper.find({ ref: 'editButton' }); const findEditButton = () => wrapper.find({ ref: 'editButton' });
const findRemoveButton = () => wrapper.find({ ref: 'removeButton' }); const findRemoveButton = () => wrapper.find({ ref: 'removeButton' });
...@@ -35,7 +35,7 @@ describe('SidebarDatePicker', () => { ...@@ -35,7 +35,7 @@ describe('SidebarDatePicker', () => {
findEditButton().vm.$emit('click', e); findEditButton().vm.$emit('click', e);
}; };
const createComponent = props => { const createComponent = (props) => {
wrapper = shallowMount(SidebarDatepicker, { wrapper = shallowMount(SidebarDatepicker, {
propsData: { propsData: {
...mockDatePickerProps, ...mockDatePickerProps,
......
...@@ -39,7 +39,7 @@ describe('SidebarHeaderComponent', () => { ...@@ -39,7 +39,7 @@ describe('SidebarHeaderComponent', () => {
expect(todoEl.innerText.trim()).toBe('To Do'); expect(todoEl.innerText.trim()).toBe('To Do');
}); });
it('renders Todo toggle button element when sidebar is expanded', done => { it('renders Todo toggle button element when sidebar is expanded', (done) => {
vm.sidebarCollapsed = false; vm.sidebarCollapsed = false;
vm.$nextTick() vm.$nextTick()
......
...@@ -31,7 +31,7 @@ describe('SidebarTodoComponent', () => { ...@@ -31,7 +31,7 @@ describe('SidebarTodoComponent', () => {
}); });
describe('template', () => { describe('template', () => {
it('renders component container element with classes `block` & `todo` when `isUserSignedIn` & `sidebarCollapsed` is `true`', done => { it('renders component container element with classes `block` & `todo` when `isUserSignedIn` & `sidebarCollapsed` is `true`', (done) => {
vm.sidebarCollapsed = true; vm.sidebarCollapsed = true;
vm.$nextTick() vm.$nextTick()
......
...@@ -18,7 +18,7 @@ describe('Epic Store Actions', () => { ...@@ -18,7 +18,7 @@ describe('Epic Store Actions', () => {
}); });
describe('setEpicMeta', () => { describe('setEpicMeta', () => {
it('should set received Epic meta', done => { it('should set received Epic meta', (done) => {
testAction( testAction(
actions.setEpicMeta, actions.setEpicMeta,
mockEpicMeta, mockEpicMeta,
...@@ -31,7 +31,7 @@ describe('Epic Store Actions', () => { ...@@ -31,7 +31,7 @@ describe('Epic Store Actions', () => {
}); });
describe('setEpicData', () => { describe('setEpicData', () => {
it('should set received Epic data', done => { it('should set received Epic data', (done) => {
testAction( testAction(
actions.setEpicData, actions.setEpicData,
mockEpicData, mockEpicData,
...@@ -97,7 +97,7 @@ describe('Epic Store Actions', () => { ...@@ -97,7 +97,7 @@ describe('Epic Store Actions', () => {
mock.restore(); mock.restore();
}); });
it('dispatches setEpicData when request is successful', done => { it('dispatches setEpicData when request is successful', (done) => {
mock.onPut(/(.*)/).replyOnce(200, {}); mock.onPut(/(.*)/).replyOnce(200, {});
jest.spyOn(epicUtils.gqClient, 'query').mockReturnValue( jest.spyOn(epicUtils.gqClient, 'query').mockReturnValue(
Promise.resolve({ Promise.resolve({
...@@ -120,7 +120,7 @@ describe('Epic Store Actions', () => { ...@@ -120,7 +120,7 @@ describe('Epic Store Actions', () => {
); );
}); });
it('dispatches requestEpicParticipantsFailure when request fails', done => { it('dispatches requestEpicParticipantsFailure when request fails', (done) => {
mock.onPut(/(.*)/).replyOnce(500, {}); mock.onPut(/(.*)/).replyOnce(500, {});
jest.spyOn(epicUtils.gqClient, 'query').mockReturnValue(Promise.resolve({})); jest.spyOn(epicUtils.gqClient, 'query').mockReturnValue(Promise.resolve({}));
...@@ -144,7 +144,7 @@ describe('Epic Store Actions', () => { ...@@ -144,7 +144,7 @@ describe('Epic Store Actions', () => {
setFixtures('<div class="flash-container"></div>'); setFixtures('<div class="flash-container"></div>');
}); });
it('does not invoke any mutations or actions', done => { it('does not invoke any mutations or actions', (done) => {
testAction(actions.requestEpicParticipantsFailure, {}, state, [], [], done); testAction(actions.requestEpicParticipantsFailure, {}, state, [], [], done);
}); });
...@@ -158,7 +158,7 @@ describe('Epic Store Actions', () => { ...@@ -158,7 +158,7 @@ describe('Epic Store Actions', () => {
}); });
describe('requestEpicStatusChange', () => { describe('requestEpicStatusChange', () => {
it('should set status change flag', done => { it('should set status change flag', (done) => {
testAction( testAction(
actions.requestEpicStatusChange, actions.requestEpicStatusChange,
{}, {},
...@@ -171,7 +171,7 @@ describe('Epic Store Actions', () => { ...@@ -171,7 +171,7 @@ describe('Epic Store Actions', () => {
}); });
describe('requestEpicStatusChangeSuccess', () => { describe('requestEpicStatusChangeSuccess', () => {
it('should set epic state type', done => { it('should set epic state type', (done) => {
testAction( testAction(
actions.requestEpicStatusChangeSuccess, actions.requestEpicStatusChangeSuccess,
{ state: statusType.close }, { state: statusType.close },
...@@ -188,7 +188,7 @@ describe('Epic Store Actions', () => { ...@@ -188,7 +188,7 @@ describe('Epic Store Actions', () => {
setFixtures('<div class="flash-container"></div>'); setFixtures('<div class="flash-container"></div>');
}); });
it('should set status change flag', done => { it('should set status change flag', (done) => {
testAction( testAction(
actions.requestEpicStatusChangeFailure, actions.requestEpicStatusChangeFailure,
{}, {},
...@@ -239,7 +239,7 @@ describe('Epic Store Actions', () => { ...@@ -239,7 +239,7 @@ describe('Epic Store Actions', () => {
}); });
describe('success', () => { describe('success', () => {
it('dispatches requestEpicStatusChange and requestEpicStatusChangeSuccess when request is complete', done => { it('dispatches requestEpicStatusChange and requestEpicStatusChangeSuccess when request is complete', (done) => {
mock.onPut(/(.*)/).replyOnce(200, { mock.onPut(/(.*)/).replyOnce(200, {
state: statusType.close, state: statusType.close,
}); });
...@@ -268,7 +268,7 @@ describe('Epic Store Actions', () => { ...@@ -268,7 +268,7 @@ describe('Epic Store Actions', () => {
}); });
describe('failure', () => { describe('failure', () => {
it('dispatches requestEpicStatusChange and requestEpicStatusChangeFailure when request fails', done => { it('dispatches requestEpicStatusChange and requestEpicStatusChangeFailure when request fails', (done) => {
mock.onPut(/(.*)/).replyOnce(500, {}); mock.onPut(/(.*)/).replyOnce(500, {});
testAction( testAction(
...@@ -295,7 +295,7 @@ describe('Epic Store Actions', () => { ...@@ -295,7 +295,7 @@ describe('Epic Store Actions', () => {
}); });
describe('toggleSidebarFlag', () => { describe('toggleSidebarFlag', () => {
it('should call `TOGGLE_SIDEBAR` mutation with param `sidebarCollapsed`', done => { it('should call `TOGGLE_SIDEBAR` mutation with param `sidebarCollapsed`', (done) => {
const sidebarCollapsed = true; const sidebarCollapsed = true;
testAction( testAction(
...@@ -333,7 +333,7 @@ describe('Epic Store Actions', () => { ...@@ -333,7 +333,7 @@ describe('Epic Store Actions', () => {
}); });
describe('toggleSidebar', () => { describe('toggleSidebar', () => {
it('dispatches toggleContainerClassAndCookie and toggleSidebarFlag actions with opposite value of `isSidebarCollapsed` param', done => { it('dispatches toggleContainerClassAndCookie and toggleSidebarFlag actions with opposite value of `isSidebarCollapsed` param', (done) => {
const sidebarCollapsed = true; const sidebarCollapsed = true;
testAction( testAction(
...@@ -357,7 +357,7 @@ describe('Epic Store Actions', () => { ...@@ -357,7 +357,7 @@ describe('Epic Store Actions', () => {
}); });
describe('requestEpicTodoToggle', () => { describe('requestEpicTodoToggle', () => {
it('should set `state.epicTodoToggleInProgress` flag to `true`', done => { it('should set `state.epicTodoToggleInProgress` flag to `true`', (done) => {
testAction( testAction(
actions.requestEpicTodoToggle, actions.requestEpicTodoToggle,
{}, {},
...@@ -370,7 +370,7 @@ describe('Epic Store Actions', () => { ...@@ -370,7 +370,7 @@ describe('Epic Store Actions', () => {
}); });
describe('requestEpicTodoToggleSuccess', () => { describe('requestEpicTodoToggleSuccess', () => {
it('should set epic state type', done => { it('should set epic state type', (done) => {
testAction( testAction(
actions.requestEpicTodoToggleSuccess, actions.requestEpicTodoToggleSuccess,
{ todoDeletePath: '/foo/bar' }, { todoDeletePath: '/foo/bar' },
...@@ -387,7 +387,7 @@ describe('Epic Store Actions', () => { ...@@ -387,7 +387,7 @@ describe('Epic Store Actions', () => {
setFixtures('<div class="flash-container"></div>'); setFixtures('<div class="flash-container"></div>');
}); });
it('Should set `state.epicTodoToggleInProgress` flag to `false`', done => { it('Should set `state.epicTodoToggleInProgress` flag to `false`', (done) => {
testAction( testAction(
actions.requestEpicTodoToggleFailure, actions.requestEpicTodoToggleFailure,
{}, {},
...@@ -450,7 +450,7 @@ describe('Epic Store Actions', () => { ...@@ -450,7 +450,7 @@ describe('Epic Store Actions', () => {
}); });
describe('when `state.togoExists` is false', () => { describe('when `state.togoExists` is false', () => {
it('dispatches requestEpicTodoToggle, triggerTodoToggleEvent and requestEpicTodoToggleSuccess when request is successful', done => { it('dispatches requestEpicTodoToggle, triggerTodoToggleEvent and requestEpicTodoToggleSuccess when request is successful', (done) => {
mock.onPost(/(.*)/).replyOnce(200, { mock.onPost(/(.*)/).replyOnce(200, {
count: 5, count: 5,
delete_path: '/foo/bar', delete_path: '/foo/bar',
...@@ -478,7 +478,7 @@ describe('Epic Store Actions', () => { ...@@ -478,7 +478,7 @@ describe('Epic Store Actions', () => {
); );
}); });
it('dispatches requestEpicTodoToggle and requestEpicTodoToggleFailure when request fails', done => { it('dispatches requestEpicTodoToggle and requestEpicTodoToggleFailure when request fails', (done) => {
mock.onPost(/(.*)/).replyOnce(500, {}); mock.onPost(/(.*)/).replyOnce(500, {});
testAction( testAction(
...@@ -500,7 +500,7 @@ describe('Epic Store Actions', () => { ...@@ -500,7 +500,7 @@ describe('Epic Store Actions', () => {
}); });
describe('when `state.togoExists` is true', () => { describe('when `state.togoExists` is true', () => {
it('dispatches requestEpicTodoToggle, triggerTodoToggleEvent and requestEpicTodoToggleSuccess when request is successful', done => { it('dispatches requestEpicTodoToggle, triggerTodoToggleEvent and requestEpicTodoToggleSuccess when request is successful', (done) => {
mock.onDelete(/(.*)/).replyOnce(200, { mock.onDelete(/(.*)/).replyOnce(200, {
count: 5, count: 5,
}); });
...@@ -527,7 +527,7 @@ describe('Epic Store Actions', () => { ...@@ -527,7 +527,7 @@ describe('Epic Store Actions', () => {
); );
}); });
it('dispatches requestEpicTodoToggle and requestEpicTodoToggleFailure when request fails', done => { it('dispatches requestEpicTodoToggle and requestEpicTodoToggleFailure when request fails', (done) => {
mock.onDelete(/(.*)/).replyOnce(500, {}); mock.onDelete(/(.*)/).replyOnce(500, {});
testAction( testAction(
...@@ -550,7 +550,7 @@ describe('Epic Store Actions', () => { ...@@ -550,7 +550,7 @@ describe('Epic Store Actions', () => {
}); });
describe('toggleStartDateType', () => { describe('toggleStartDateType', () => {
it('should set `state.startDateIsFixed` flag to `true`', done => { it('should set `state.startDateIsFixed` flag to `true`', (done) => {
const dateTypeIsFixed = true; const dateTypeIsFixed = true;
testAction( testAction(
...@@ -565,7 +565,7 @@ describe('Epic Store Actions', () => { ...@@ -565,7 +565,7 @@ describe('Epic Store Actions', () => {
}); });
describe('toggleDueDateType', () => { describe('toggleDueDateType', () => {
it('should set `state.dueDateIsFixed` flag to `true`', done => { it('should set `state.dueDateIsFixed` flag to `true`', (done) => {
const dateTypeIsFixed = true; const dateTypeIsFixed = true;
testAction( testAction(
...@@ -580,7 +580,7 @@ describe('Epic Store Actions', () => { ...@@ -580,7 +580,7 @@ describe('Epic Store Actions', () => {
}); });
describe('requestEpicDateSave', () => { describe('requestEpicDateSave', () => {
it('should set `state.epicStartDateSaveInProgress` flag to `true` when called with `dateType` as `start`', done => { it('should set `state.epicStartDateSaveInProgress` flag to `true` when called with `dateType` as `start`', (done) => {
const dateType = dateTypes.start; const dateType = dateTypes.start;
testAction( testAction(
...@@ -593,7 +593,7 @@ describe('Epic Store Actions', () => { ...@@ -593,7 +593,7 @@ describe('Epic Store Actions', () => {
); );
}); });
it('should set `state.epicDueDateSaveInProgress` flag to `true` when called with `dateType` as `due`', done => { it('should set `state.epicDueDateSaveInProgress` flag to `true` when called with `dateType` as `due`', (done) => {
const dateType = dateTypes.due; const dateType = dateTypes.due;
testAction( testAction(
...@@ -608,7 +608,7 @@ describe('Epic Store Actions', () => { ...@@ -608,7 +608,7 @@ describe('Epic Store Actions', () => {
}); });
describe('requestEpicDateSaveSuccess', () => { describe('requestEpicDateSaveSuccess', () => {
it('should set `state.epicStartDateSaveInProgress` flag to `false` and set values of `startDateIsFixed` & `startDate` with params `dateTypeIsFixed` & `newDate` when called with `dateType` as `start`', done => { it('should set `state.epicStartDateSaveInProgress` flag to `false` and set values of `startDateIsFixed` & `startDate` with params `dateTypeIsFixed` & `newDate` when called with `dateType` as `start`', (done) => {
const data = { const data = {
dateType: dateTypes.start, dateType: dateTypes.start,
dateTypeIsFixed: true, dateTypeIsFixed: true,
...@@ -625,7 +625,7 @@ describe('Epic Store Actions', () => { ...@@ -625,7 +625,7 @@ describe('Epic Store Actions', () => {
); );
}); });
it('should set `state.epicDueDateSaveInProgress` flag to `false` and set values of `dueDateIsFixed` & `dueDate` with params `dateTypeIsFixed` & `newDate` when called with `dateType` as `due`', done => { it('should set `state.epicDueDateSaveInProgress` flag to `false` and set values of `dueDateIsFixed` & `dueDate` with params `dateTypeIsFixed` & `newDate` when called with `dateType` as `due`', (done) => {
const data = { const data = {
dateType: dateTypes.due, dateType: dateTypes.due,
dateTypeIsFixed: true, dateTypeIsFixed: true,
...@@ -648,7 +648,7 @@ describe('Epic Store Actions', () => { ...@@ -648,7 +648,7 @@ describe('Epic Store Actions', () => {
setFixtures('<div class="flash-container"></div>'); setFixtures('<div class="flash-container"></div>');
}); });
it('should set `state.epicStartDateSaveInProgress` flag to `false` and set value of `startDateIsFixed` to that of param `dateTypeIsFixed` when called with `dateType` as `start`', done => { it('should set `state.epicStartDateSaveInProgress` flag to `false` and set value of `startDateIsFixed` to that of param `dateTypeIsFixed` when called with `dateType` as `start`', (done) => {
const data = { const data = {
dateType: dateTypes.start, dateType: dateTypes.start,
dateTypeIsFixed: true, dateTypeIsFixed: true,
...@@ -669,7 +669,7 @@ describe('Epic Store Actions', () => { ...@@ -669,7 +669,7 @@ describe('Epic Store Actions', () => {
); );
}); });
it('should set `state.epicDueDateSaveInProgress` flag to `false` and set value of `dueDateIsFixed` to that of param `dateTypeIsFixed` when called with `dateType` as `due`', done => { it('should set `state.epicDueDateSaveInProgress` flag to `false` and set value of `dueDateIsFixed` to that of param `dateTypeIsFixed` when called with `dateType` as `due`', (done) => {
const data = { const data = {
dateType: dateTypes.due, dateType: dateTypes.due,
dateTypeIsFixed: true, dateTypeIsFixed: true,
...@@ -741,7 +741,7 @@ describe('Epic Store Actions', () => { ...@@ -741,7 +741,7 @@ describe('Epic Store Actions', () => {
mock.restore(); mock.restore();
}); });
it('dispatches requestEpicDateSave and requestEpicDateSaveSuccess when request is successful', done => { it('dispatches requestEpicDateSave and requestEpicDateSaveSuccess when request is successful', (done) => {
mock.onPut(/(.*)/).replyOnce(200, {}); mock.onPut(/(.*)/).replyOnce(200, {});
jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue( jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue(
Promise.resolve({ Promise.resolve({
...@@ -768,7 +768,7 @@ describe('Epic Store Actions', () => { ...@@ -768,7 +768,7 @@ describe('Epic Store Actions', () => {
); );
}); });
it('dispatches requestEpicDateSave and requestEpicDateSaveFailure when request fails', done => { it('dispatches requestEpicDateSave and requestEpicDateSaveFailure when request fails', (done) => {
mock.onPut(/(.*)/).replyOnce(500, {}); mock.onPut(/(.*)/).replyOnce(500, {});
jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue( jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue(
Promise.resolve({ Promise.resolve({
...@@ -802,7 +802,7 @@ describe('Epic Store Actions', () => { ...@@ -802,7 +802,7 @@ describe('Epic Store Actions', () => {
}); });
describe('requestEpicLabelsSelect', () => { describe('requestEpicLabelsSelect', () => {
it('should set `state.epicLabelsSelectInProgress` flag to `true`', done => { it('should set `state.epicLabelsSelectInProgress` flag to `true`', (done) => {
testAction( testAction(
actions.requestEpicLabelsSelect, actions.requestEpicLabelsSelect,
{}, {},
...@@ -815,7 +815,7 @@ describe('Epic Store Actions', () => { ...@@ -815,7 +815,7 @@ describe('Epic Store Actions', () => {
}); });
describe('receiveEpicLabelsSelectSuccess', () => { describe('receiveEpicLabelsSelectSuccess', () => {
it('should set provided labels param to `state.labels`', done => { it('should set provided labels param to `state.labels`', (done) => {
const labels = [ const labels = [
{ id: 1, set: false }, { id: 1, set: false },
{ id: 2, set: true }, { id: 2, set: true },
...@@ -842,7 +842,7 @@ describe('Epic Store Actions', () => { ...@@ -842,7 +842,7 @@ describe('Epic Store Actions', () => {
setFixtures('<div class="flash-container"></div>'); setFixtures('<div class="flash-container"></div>');
}); });
it('should set `state.epicLabelsSelectInProgress` flag to `false`', done => { it('should set `state.epicLabelsSelectInProgress` flag to `false`', (done) => {
testAction( testAction(
actions.receiveEpicLabelsSelectFailure, actions.receiveEpicLabelsSelectFailure,
{}, {},
...@@ -873,7 +873,7 @@ describe('Epic Store Actions', () => { ...@@ -873,7 +873,7 @@ describe('Epic Store Actions', () => {
{ id: 2, set: true }, { id: 2, set: true },
]; ];
it('dispatches `requestEpicLabelsSelect` and `receiveEpicLabelsSelectSuccess` actions when request succeeds', done => { it('dispatches `requestEpicLabelsSelect` and `receiveEpicLabelsSelectSuccess` actions when request succeeds', (done) => {
jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue( jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue(
Promise.resolve({ Promise.resolve({
data: { data: {
...@@ -902,7 +902,7 @@ describe('Epic Store Actions', () => { ...@@ -902,7 +902,7 @@ describe('Epic Store Actions', () => {
); );
}); });
it('dispatches `requestEpicLabelsSelect` and `receiveEpicLabelsSelectFailure` actions when request fails', done => { it('dispatches `requestEpicLabelsSelect` and `receiveEpicLabelsSelectFailure` actions when request fails', (done) => {
jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue( jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue(
Promise.resolve({ Promise.resolve({
data: { data: {
...@@ -932,7 +932,7 @@ describe('Epic Store Actions', () => { ...@@ -932,7 +932,7 @@ describe('Epic Store Actions', () => {
}); });
describe('requestEpicSubscriptionToggle', () => { describe('requestEpicSubscriptionToggle', () => {
it('should set `state.epicSubscriptionToggleInProgress` flag to `true`', done => { it('should set `state.epicSubscriptionToggleInProgress` flag to `true`', (done) => {
testAction( testAction(
actions.requestEpicSubscriptionToggle, actions.requestEpicSubscriptionToggle,
{}, {},
...@@ -945,7 +945,7 @@ describe('Epic Store Actions', () => { ...@@ -945,7 +945,7 @@ describe('Epic Store Actions', () => {
}); });
describe('requestEpicSubscriptionToggleSuccess', () => { describe('requestEpicSubscriptionToggleSuccess', () => {
it('should set `state.requestEpicSubscriptionToggleSuccess` flag to `false` and passes opposite of the value of `subscribed` as param', done => { it('should set `state.requestEpicSubscriptionToggleSuccess` flag to `false` and passes opposite of the value of `subscribed` as param', (done) => {
const stateSubscribed = { const stateSubscribed = {
subscribed: false, subscribed: false,
}; };
...@@ -971,7 +971,7 @@ describe('Epic Store Actions', () => { ...@@ -971,7 +971,7 @@ describe('Epic Store Actions', () => {
setFixtures('<div class="flash-container"></div>'); setFixtures('<div class="flash-container"></div>');
}); });
it('should set `state.requestEpicSubscriptionToggleFailure` flag to `false`', done => { it('should set `state.requestEpicSubscriptionToggleFailure` flag to `false`', (done) => {
testAction( testAction(
actions.requestEpicSubscriptionToggleFailure, actions.requestEpicSubscriptionToggleFailure,
{}, {},
...@@ -1037,7 +1037,7 @@ describe('Epic Store Actions', () => { ...@@ -1037,7 +1037,7 @@ describe('Epic Store Actions', () => {
}); });
describe('success', () => { describe('success', () => {
it('dispatches requestEpicSubscriptionToggle and requestEpicSubscriptionToggleSuccess with param `subscribed` when request is complete', done => { it('dispatches requestEpicSubscriptionToggle and requestEpicSubscriptionToggleSuccess with param `subscribed` when request is complete', (done) => {
mock.onPost(/(.*)/).replyOnce(200, {}); mock.onPost(/(.*)/).replyOnce(200, {});
jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue( jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue(
Promise.resolve({ Promise.resolve({
...@@ -1079,7 +1079,7 @@ describe('Epic Store Actions', () => { ...@@ -1079,7 +1079,7 @@ describe('Epic Store Actions', () => {
}); });
describe('failure', () => { describe('failure', () => {
it('dispatches requestEpicSubscriptionToggle and requestEpicSubscriptionToggleFailure when request fails', done => { it('dispatches requestEpicSubscriptionToggle and requestEpicSubscriptionToggleFailure when request fails', (done) => {
mock.onPost(/(.*)/).replyOnce(500, {}); mock.onPost(/(.*)/).replyOnce(500, {});
jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue( jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue(
Promise.resolve({ Promise.resolve({
...@@ -1112,7 +1112,7 @@ describe('Epic Store Actions', () => { ...@@ -1112,7 +1112,7 @@ describe('Epic Store Actions', () => {
}); });
describe('setEpicCreateTitle', () => { describe('setEpicCreateTitle', () => {
it('should set `state.newEpicTitle` value to the value of `newEpicTitle` param', done => { it('should set `state.newEpicTitle` value to the value of `newEpicTitle` param', (done) => {
const data = { const data = {
newEpicTitle: 'foobar', newEpicTitle: 'foobar',
}; };
...@@ -1129,7 +1129,7 @@ describe('Epic Store Actions', () => { ...@@ -1129,7 +1129,7 @@ describe('Epic Store Actions', () => {
}); });
describe('setEpicCreateConfidential', () => { describe('setEpicCreateConfidential', () => {
it('should set `state.newEpicConfidential` value to the value of `newEpicConfidential` param', done => { it('should set `state.newEpicConfidential` value to the value of `newEpicConfidential` param', (done) => {
const data = { const data = {
newEpicConfidential: true, newEpicConfidential: true,
}; };
...@@ -1146,7 +1146,7 @@ describe('Epic Store Actions', () => { ...@@ -1146,7 +1146,7 @@ describe('Epic Store Actions', () => {
}); });
describe('requestEpicCreate', () => { describe('requestEpicCreate', () => {
it('should set `state.epicCreateInProgress` flag to `true`', done => { it('should set `state.epicCreateInProgress` flag to `true`', (done) => {
testAction( testAction(
actions.requestEpicCreate, actions.requestEpicCreate,
{}, {},
...@@ -1163,7 +1163,7 @@ describe('Epic Store Actions', () => { ...@@ -1163,7 +1163,7 @@ describe('Epic Store Actions', () => {
setFixtures('<div class="flash-container"></div>'); setFixtures('<div class="flash-container"></div>');
}); });
it('should set `state.epicCreateInProgress` flag to `false`', done => { it('should set `state.epicCreateInProgress` flag to `false`', (done) => {
testAction( testAction(
actions.requestEpicCreateFailure, actions.requestEpicCreateFailure,
{}, {},
...@@ -1201,7 +1201,7 @@ describe('Epic Store Actions', () => { ...@@ -1201,7 +1201,7 @@ describe('Epic Store Actions', () => {
}); });
describe('success', () => { describe('success', () => {
it('dispatches requestEpicCreate when request is complete', done => { it('dispatches requestEpicCreate when request is complete', (done) => {
mock.onPost(/(.*)/).replyOnce(200, {}); mock.onPost(/(.*)/).replyOnce(200, {});
testAction( testAction(
...@@ -1223,7 +1223,7 @@ describe('Epic Store Actions', () => { ...@@ -1223,7 +1223,7 @@ describe('Epic Store Actions', () => {
}); });
describe('failure', () => { describe('failure', () => {
it('dispatches requestEpicCreate and requestEpicCreateFailure when request fails', done => { it('dispatches requestEpicCreate and requestEpicCreateFailure when request fails', (done) => {
mock.onPost(/(.*)/).replyOnce(500, {}); mock.onPost(/(.*)/).replyOnce(500, {});
testAction( testAction(
...@@ -1267,7 +1267,7 @@ describe('Epic Store Actions', () => { ...@@ -1267,7 +1267,7 @@ describe('Epic Store Actions', () => {
mock.restore(); mock.restore();
}); });
it('commits SET_EPIC_CONFIDENTIAL when request is successful', done => { it('commits SET_EPIC_CONFIDENTIAL when request is successful', (done) => {
mock.onPut(/(.*)/).replyOnce(200, {}); mock.onPut(/(.*)/).replyOnce(200, {});
jest.spyOn(epicUtils.gqClient, 'mutate').mockResolvedValue({ jest.spyOn(epicUtils.gqClient, 'mutate').mockResolvedValue({
data: mockUpdateConfidentialMutationRes, data: mockUpdateConfidentialMutationRes,
...@@ -1283,7 +1283,7 @@ describe('Epic Store Actions', () => { ...@@ -1283,7 +1283,7 @@ describe('Epic Store Actions', () => {
); );
}); });
it("doesn't commit/dispatch and throws error when request fails", done => { it("doesn't commit/dispatch and throws error when request fails", (done) => {
mock.onPut(/(.*)/).replyOnce(500, {}); mock.onPut(/(.*)/).replyOnce(500, {});
const errors = ['bar']; const errors = ['bar'];
...@@ -1297,7 +1297,7 @@ describe('Epic Store Actions', () => { ...@@ -1297,7 +1297,7 @@ describe('Epic Store Actions', () => {
}); });
testAction(actions.updateConfidentialityOnIssuable, { ...data }, state, [], []) testAction(actions.updateConfidentialityOnIssuable, { ...data }, state, [], [])
.catch(err => { .catch((err) => {
expect(err).toEqual('bar'); expect(err).toEqual('bar');
}) })
.finally(done); .finally(done);
......
...@@ -20,13 +20,13 @@ describe('Issues Filtered Search Token Keys (EE)', () => { ...@@ -20,13 +20,13 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
}); });
it('should return weightTokenKey as part of tokenKeys', () => { it('should return weightTokenKey as part of tokenKeys', () => {
const match = tokenKeys.find(tk => tk.key === weightTokenKey.key); const match = tokenKeys.find((tk) => tk.key === weightTokenKey.key);
expect(match).toEqual(weightTokenKey); expect(match).toEqual(weightTokenKey);
}); });
it('should return assignee as an array', () => { it('should return assignee as an array', () => {
const assignee = tokenKeys.find(tokenKey => tokenKey.key === 'assignee'); const assignee = tokenKeys.find((tokenKey) => tokenKey.key === 'assignee');
expect(assignee.type).toBe('array'); expect(assignee.type).toBe('array');
}); });
...@@ -40,7 +40,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => { ...@@ -40,7 +40,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
}); });
it('should return weightConditions as part of conditions', () => { it('should return weightConditions as part of conditions', () => {
const weightConditions = conditions.filter(c => c.tokenKey === 'weight'); const weightConditions = conditions.filter((c) => c.tokenKey === 'weight');
expect(weightConditions).toHaveLength(4); expect(weightConditions).toHaveLength(4);
}); });
...@@ -49,7 +49,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => { ...@@ -49,7 +49,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
describe('searchByKey', () => { describe('searchByKey', () => {
it('should return weight tokenKey when found by weight key', () => { it('should return weight tokenKey when found by weight key', () => {
const tokenKeys = IssuableFilteredSearchTokenKeys.get(); const tokenKeys = IssuableFilteredSearchTokenKeys.get();
const match = tokenKeys.find(tk => tk.key === weightTokenKey.key); const match = tokenKeys.find((tk) => tk.key === weightTokenKey.key);
const result = IssuableFilteredSearchTokenKeys.searchByKey(weightTokenKey.key); const result = IssuableFilteredSearchTokenKeys.searchByKey(weightTokenKey.key);
expect(result).toEqual(match); expect(result).toEqual(match);
...@@ -59,7 +59,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => { ...@@ -59,7 +59,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
describe('searchBySymbol', () => { describe('searchBySymbol', () => {
it('should return weight tokenKey when found by weight symbol', () => { it('should return weight tokenKey when found by weight symbol', () => {
const tokenKeys = IssuableFilteredSearchTokenKeys.get(); const tokenKeys = IssuableFilteredSearchTokenKeys.get();
const match = tokenKeys.find(tk => tk.symbol === weightTokenKey.symbol); const match = tokenKeys.find((tk) => tk.symbol === weightTokenKey.symbol);
const result = IssuableFilteredSearchTokenKeys.searchBySymbol(weightTokenKey.symbol); const result = IssuableFilteredSearchTokenKeys.searchBySymbol(weightTokenKey.symbol);
expect(result).toEqual(match); expect(result).toEqual(match);
...@@ -69,7 +69,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => { ...@@ -69,7 +69,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
describe('searchByKeyParam', () => { describe('searchByKeyParam', () => {
it('should return weight tokenKey when found by weight key param', () => { it('should return weight tokenKey when found by weight key param', () => {
const tokenKeys = IssuableFilteredSearchTokenKeys.get(); const tokenKeys = IssuableFilteredSearchTokenKeys.get();
const match = tokenKeys.find(tk => tk.key === weightTokenKey.key); const match = tokenKeys.find((tk) => tk.key === weightTokenKey.key);
const result = IssuableFilteredSearchTokenKeys.searchByKeyParam(weightTokenKey.key); const result = IssuableFilteredSearchTokenKeys.searchByKeyParam(weightTokenKey.key);
expect(result).toEqual(match); expect(result).toEqual(match);
...@@ -79,7 +79,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => { ...@@ -79,7 +79,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
describe('searchByConditionUrl', () => { describe('searchByConditionUrl', () => {
it('should return weight condition when found by weight url', () => { it('should return weight condition when found by weight url', () => {
const conditions = IssuableFilteredSearchTokenKeys.getConditions(); const conditions = IssuableFilteredSearchTokenKeys.getConditions();
const weightConditions = conditions.filter(c => c.tokenKey === 'weight'); const weightConditions = conditions.filter((c) => c.tokenKey === 'weight');
const result = IssuableFilteredSearchTokenKeys.searchByConditionUrl(weightConditions[0].url); const result = IssuableFilteredSearchTokenKeys.searchByConditionUrl(weightConditions[0].url);
expect(result).toBe(weightConditions[0]); expect(result).toBe(weightConditions[0]);
...@@ -89,7 +89,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => { ...@@ -89,7 +89,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
describe('searchByConditionKeyValue', () => { describe('searchByConditionKeyValue', () => {
it('should return weight condition when found by weight tokenKey and value', () => { it('should return weight condition when found by weight tokenKey and value', () => {
const conditions = IssuableFilteredSearchTokenKeys.getConditions(); const conditions = IssuableFilteredSearchTokenKeys.getConditions();
const weightConditions = conditions.filter(c => c.tokenKey === 'weight'); const weightConditions = conditions.filter((c) => c.tokenKey === 'weight');
const result = IssuableFilteredSearchTokenKeys.searchByConditionKeyValue( const result = IssuableFilteredSearchTokenKeys.searchByConditionKeyValue(
weightConditions[0].tokenKey, weightConditions[0].tokenKey,
weightConditions[0].operator, weightConditions[0].operator,
......
...@@ -48,7 +48,7 @@ describe('GeoNodeFormNamespaces', () => { ...@@ -48,7 +48,7 @@ describe('GeoNodeFormNamespaces', () => {
const findGlDropdown = () => wrapper.find(GlDropdown); const findGlDropdown = () => wrapper.find(GlDropdown);
const findGlDropdownSearch = () => findGlDropdown().find(GlSearchBoxByType); const findGlDropdownSearch = () => findGlDropdown().find(GlSearchBoxByType);
const findDropdownItems = () => findGlDropdown().findAll('button'); const findDropdownItems = () => findGlDropdown().findAll('button');
const findDropdownItemsText = () => findDropdownItems().wrappers.map(w => w.text()); const findDropdownItemsText = () => findDropdownItems().wrappers.map((w) => w.text());
const findGlIcons = () => wrapper.findAll(GlIcon); const findGlIcons = () => wrapper.findAll(GlIcon);
describe('template', () => { describe('template', () => {
...@@ -94,11 +94,11 @@ describe('GeoNodeFormNamespaces', () => { ...@@ -94,11 +94,11 @@ describe('GeoNodeFormNamespaces', () => {
}); });
it('renders an instance for each namespace', () => { it('renders an instance for each namespace', () => {
expect(findDropdownItemsText()).toStrictEqual(MOCK_SYNC_NAMESPACES.map(n => n.name)); expect(findDropdownItemsText()).toStrictEqual(MOCK_SYNC_NAMESPACES.map((n) => n.name));
}); });
it('hides GlIcon if namespace not in selectedNamespaces', () => { it('hides GlIcon if namespace not in selectedNamespaces', () => {
expect(findGlIcons().wrappers.every(w => w.classes('gl-visibility-hidden'))).toBe(true); expect(findGlIcons().wrappers.every((w) => w.classes('gl-visibility-hidden'))).toBe(true);
}); });
}); });
}); });
......
...@@ -110,7 +110,7 @@ describe('AppComponent', () => { ...@@ -110,7 +110,7 @@ describe('AppComponent', () => {
}); });
describe('fetchGeoNodes', () => { describe('fetchGeoNodes', () => {
it('calls service.getGeoNodes and sets response to the store on success', done => { it('calls service.getGeoNodes and sets response to the store on success', (done) => {
jest.spyOn(vm.store, 'setNodes'); jest.spyOn(vm.store, 'setNodes');
vm.fetchGeoNodes() vm.fetchGeoNodes()
...@@ -122,7 +122,7 @@ describe('AppComponent', () => { ...@@ -122,7 +122,7 @@ describe('AppComponent', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('sets error flag and message on failure', done => { it('sets error flag and message on failure', (done) => {
response = 'Something went wrong'; response = 'Something went wrong';
statusCode = 500; statusCode = 500;
...@@ -139,7 +139,7 @@ describe('AppComponent', () => { ...@@ -139,7 +139,7 @@ describe('AppComponent', () => {
}); });
describe('fetchNodeDetails', () => { describe('fetchNodeDetails', () => {
it('calls service.getGeoNodeDetails and sets response to the store on success', done => { it('calls service.getGeoNodeDetails and sets response to the store on success', (done) => {
mock.onGet(mockNode.statusPath).reply(200, rawMockNodeDetails); mock.onGet(mockNode.statusPath).reply(200, rawMockNodeDetails);
vm.fetchNodeDetails(mockNode) vm.fetchNodeDetails(mockNode)
...@@ -151,7 +151,7 @@ describe('AppComponent', () => { ...@@ -151,7 +151,7 @@ describe('AppComponent', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('emits `nodeDetailsLoaded` event with fake nodeDetails object on 404 failure', done => { it('emits `nodeDetailsLoaded` event with fake nodeDetails object on 404 failure', (done) => {
mock.onGet(mockNode.statusPath).reply(404, {}); mock.onGet(mockNode.statusPath).reply(404, {});
jest.spyOn(vm.service, 'getGeoNodeDetails'); jest.spyOn(vm.service, 'getGeoNodeDetails');
...@@ -168,7 +168,7 @@ describe('AppComponent', () => { ...@@ -168,7 +168,7 @@ describe('AppComponent', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('emits `nodeDetailsLoaded` event with fake nodeDetails object when a network error occurs', done => { it('emits `nodeDetailsLoaded` event with fake nodeDetails object when a network error occurs', (done) => {
mock.onGet(mockNode.statusPath).networkError(); mock.onGet(mockNode.statusPath).networkError();
jest.spyOn(vm.service, 'getGeoNodeDetails'); jest.spyOn(vm.service, 'getGeoNodeDetails');
...@@ -185,7 +185,7 @@ describe('AppComponent', () => { ...@@ -185,7 +185,7 @@ describe('AppComponent', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('emits `nodeDetailsLoaded` event with fake nodeDetails object when a timeout occurs', done => { it('emits `nodeDetailsLoaded` event with fake nodeDetails object when a timeout occurs', (done) => {
mock.onGet(mockNode.statusPath).timeout(); mock.onGet(mockNode.statusPath).timeout();
jest.spyOn(vm.service, 'getGeoNodeDetails'); jest.spyOn(vm.service, 'getGeoNodeDetails');
...@@ -204,7 +204,7 @@ describe('AppComponent', () => { ...@@ -204,7 +204,7 @@ describe('AppComponent', () => {
}); });
describe('repairNode', () => { describe('repairNode', () => {
it('calls service.repairNode and shows success Toast message on request success', done => { it('calls service.repairNode and shows success Toast message on request success', (done) => {
const node = { ...mockNode }; const node = { ...mockNode };
mock.onPost(node.repairPath).reply(() => { mock.onPost(node.repairPath).reply(() => {
expect(node.nodeActionActive).toBe(true); expect(node.nodeActionActive).toBe(true);
...@@ -224,7 +224,7 @@ describe('AppComponent', () => { ...@@ -224,7 +224,7 @@ describe('AppComponent', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('calls service.repairNode and shows failure Flash message on request failure', done => { it('calls service.repairNode and shows failure Flash message on request failure', (done) => {
const node = { ...mockNode }; const node = { ...mockNode };
mock.onPost(node.repairPath).reply(() => { mock.onPost(node.repairPath).reply(() => {
expect(node.nodeActionActive).toBe(true); expect(node.nodeActionActive).toBe(true);
...@@ -247,7 +247,7 @@ describe('AppComponent', () => { ...@@ -247,7 +247,7 @@ describe('AppComponent', () => {
}); });
describe('toggleNode', () => { describe('toggleNode', () => {
it('calls service.toggleNode for enabling node and updates toggle button on request success', done => { it('calls service.toggleNode for enabling node and updates toggle button on request success', (done) => {
const node = { ...mockNode }; const node = { ...mockNode };
mock.onPut(node.basePath).reply(() => { mock.onPut(node.basePath).reply(() => {
expect(node.nodeActionActive).toBe(true); expect(node.nodeActionActive).toBe(true);
...@@ -271,7 +271,7 @@ describe('AppComponent', () => { ...@@ -271,7 +271,7 @@ describe('AppComponent', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('calls service.toggleNode and shows Flash error on request failure', done => { it('calls service.toggleNode and shows Flash error on request failure', (done) => {
const node = { ...mockNode }; const node = { ...mockNode };
mock.onPut(node.basePath).reply(() => { mock.onPut(node.basePath).reply(() => {
expect(node.nodeActionActive).toBe(true); expect(node.nodeActionActive).toBe(true);
...@@ -295,7 +295,7 @@ describe('AppComponent', () => { ...@@ -295,7 +295,7 @@ describe('AppComponent', () => {
}); });
describe('removeNode', () => { describe('removeNode', () => {
it('calls service.removeNode for removing node and shows Toast message on request success', done => { it('calls service.removeNode for removing node and shows Toast message on request success', (done) => {
const node = { ...mockNode }; const node = { ...mockNode };
mock.onDelete(node.basePath).reply(() => { mock.onDelete(node.basePath).reply(() => {
expect(node.nodeActionActive).toBe(true); expect(node.nodeActionActive).toBe(true);
...@@ -315,7 +315,7 @@ describe('AppComponent', () => { ...@@ -315,7 +315,7 @@ describe('AppComponent', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('calls service.removeNode and shows Flash message on request failure', done => { it('calls service.removeNode and shows Flash message on request failure', (done) => {
const node = { ...mockNode }; const node = { ...mockNode };
mock.onDelete(node.basePath).reply(() => { mock.onDelete(node.basePath).reply(() => {
expect(node.nodeActionActive).toBe(true); expect(node.nodeActionActive).toBe(true);
......
...@@ -37,7 +37,7 @@ describe('GeoNodeHeader', () => { ...@@ -37,7 +37,7 @@ describe('GeoNodeHeader', () => {
expect(vm.isNodeHTTP).toBe(true); expect(vm.isNodeHTTP).toBe(true);
}); });
it('returns `false` when Node URL protocol is HTTPS', done => { it('returns `false` when Node URL protocol is HTTPS', (done) => {
vm.node.url = 'https://127.0.0.1:3001/'; vm.node.url = 'https://127.0.0.1:3001/';
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
......
...@@ -48,7 +48,7 @@ describe('GeoNodeSyncProgress', () => { ...@@ -48,7 +48,7 @@ describe('GeoNodeSyncProgress', () => {
}); });
it('renders each row of popover correctly', () => { it('renders each row of popover correctly', () => {
findCounts().wrappers.forEach(row => { findCounts().wrappers.forEach((row) => {
expect(row.element).toMatchSnapshot(); expect(row.element).toMatchSnapshot();
}); });
}); });
......
...@@ -39,7 +39,7 @@ describe('NodeDetailsSectionMain', () => { ...@@ -39,7 +39,7 @@ describe('NodeDetailsSectionMain', () => {
describe('computed', () => { describe('computed', () => {
describe('nodeVersion', () => { describe('nodeVersion', () => {
it('returns `Unknown` when `version` and `revision` are null', done => { it('returns `Unknown` when `version` and `revision` are null', (done) => {
vm.nodeDetails.version = null; vm.nodeDetails.version = null;
vm.nodeDetails.revision = null; vm.nodeDetails.revision = null;
Vue.nextTick() Vue.nextTick()
...@@ -56,7 +56,7 @@ describe('NodeDetailsSectionMain', () => { ...@@ -56,7 +56,7 @@ describe('NodeDetailsSectionMain', () => {
}); });
describe('nodeHealthStatus', () => { describe('nodeHealthStatus', () => {
it('returns health status string', done => { it('returns health status string', (done) => {
// With default mock data // With default mock data
expect(vm.nodeHealthStatus).toBe('Healthy'); expect(vm.nodeHealthStatus).toBe('Healthy');
......
...@@ -63,7 +63,7 @@ describe('NodeDetailsSectionOther', () => { ...@@ -63,7 +63,7 @@ describe('NodeDetailsSectionOther', () => {
}); });
describe('storageShardsStatus', () => { describe('storageShardsStatus', () => {
it('returns `Unknown` when `nodeDetails.storageShardsMatch` is null', done => { it('returns `Unknown` when `nodeDetails.storageShardsMatch` is null', (done) => {
vm.nodeDetails.storageShardsMatch = null; vm.nodeDetails.storageShardsMatch = null;
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
...@@ -73,7 +73,7 @@ describe('NodeDetailsSectionOther', () => { ...@@ -73,7 +73,7 @@ describe('NodeDetailsSectionOther', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('returns `OK` when `nodeDetails.storageShardsMatch` is true', done => { it('returns `OK` when `nodeDetails.storageShardsMatch` is true', (done) => {
vm.nodeDetails.storageShardsMatch = true; vm.nodeDetails.storageShardsMatch = true;
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
...@@ -89,7 +89,7 @@ describe('NodeDetailsSectionOther', () => { ...@@ -89,7 +89,7 @@ describe('NodeDetailsSectionOther', () => {
}); });
describe('storageShardsCssClass', () => { describe('storageShardsCssClass', () => {
it('returns CSS class `font-weight-bold` when `nodeDetails.storageShardsMatch` is true', done => { it('returns CSS class `font-weight-bold` when `nodeDetails.storageShardsMatch` is true', (done) => {
vm.nodeDetails.storageShardsMatch = true; vm.nodeDetails.storageShardsMatch = true;
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
...@@ -117,7 +117,7 @@ describe('NodeDetailsSectionOther', () => { ...@@ -117,7 +117,7 @@ describe('NodeDetailsSectionOther', () => {
expect(vm.$el.querySelector('.btn-link > span').innerText.trim()).toBe('Other information'); expect(vm.$el.querySelector('.btn-link > span').innerText.trim()).toBe('Other information');
}); });
it('renders section items container element', done => { it('renders section items container element', (done) => {
vm.showSectionItems = true; vm.showSectionItems = true;
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.$el.querySelector('.section-items-container')).not.toBeNull(); expect(vm.$el.querySelector('.section-items-container')).not.toBeNull();
......
...@@ -50,7 +50,7 @@ describe('GeoNodesStore', () => { ...@@ -50,7 +50,7 @@ describe('GeoNodesStore', () => {
store.setNodes(mockNodes); store.setNodes(mockNodes);
const nodeToBeRemoved = store.getNodes()[1]; const nodeToBeRemoved = store.getNodes()[1];
store.removeNode(nodeToBeRemoved); store.removeNode(nodeToBeRemoved);
store.getNodes().forEach(node => { store.getNodes().forEach((node) => {
expect(node.id).not.toBe(nodeToBeRemoved); expect(node.id).not.toBe(nodeToBeRemoved);
}); });
}); });
......
...@@ -26,7 +26,7 @@ describe('GeoReplicableApp', () => { ...@@ -26,7 +26,7 @@ describe('GeoReplicableApp', () => {
geoReplicableEmptySvgPath: MOCK_GEO_REPLICATION_SVG_PATH, geoReplicableEmptySvgPath: MOCK_GEO_REPLICATION_SVG_PATH,
}; };
const createStore = options => { const createStore = (options) => {
store = initStore({ replicableType: MOCK_REPLICABLE_TYPE, graphqlFieldName: null, ...options }); store = initStore({ replicableType: MOCK_REPLICABLE_TYPE, graphqlFieldName: null, ...options });
jest.spyOn(store, 'dispatch').mockImplementation(); jest.spyOn(store, 'dispatch').mockImplementation();
}; };
......
...@@ -37,7 +37,7 @@ describe('GeoReplicableFilterBar', () => { ...@@ -37,7 +37,7 @@ describe('GeoReplicableFilterBar', () => {
const findNavContainer = () => wrapper.find('nav'); const findNavContainer = () => wrapper.find('nav');
const findGlDropdown = () => findNavContainer().find(GlDropdown); const findGlDropdown = () => findNavContainer().find(GlDropdown);
const findGlDropdownItems = () => findNavContainer().findAll(GlDropdownItem); const findGlDropdownItems = () => findNavContainer().findAll(GlDropdownItem);
const findDropdownItemsText = () => findGlDropdownItems().wrappers.map(w => w.text()); const findDropdownItemsText = () => findGlDropdownItems().wrappers.map((w) => w.text());
const findGlSearchBox = () => findNavContainer().find(GlSearchBoxByType); const findGlSearchBox = () => findNavContainer().find(GlSearchBoxByType);
const findGlButton = () => findNavContainer().find(GlButton); const findGlButton = () => findNavContainer().find(GlButton);
...@@ -57,7 +57,7 @@ describe('GeoReplicableFilterBar', () => { ...@@ -57,7 +57,7 @@ describe('GeoReplicableFilterBar', () => {
describe('Filter options', () => { describe('Filter options', () => {
it('renders a dropdown item for each filterOption', () => { it('renders a dropdown item for each filterOption', () => {
expect(findDropdownItemsText()).toStrictEqual( expect(findDropdownItemsText()).toStrictEqual(
wrapper.vm.filterOptions.map(n => { wrapper.vm.filterOptions.map((n) => {
if (n.label === 'All') { if (n.label === 'All') {
return `${n.label} ${MOCK_REPLICABLE_TYPE}`; return `${n.label} ${MOCK_REPLICABLE_TYPE}`;
} }
......
...@@ -21,7 +21,7 @@ describe('GeoReplicable', () => { ...@@ -21,7 +21,7 @@ describe('GeoReplicable', () => {
let wrapper; let wrapper;
let store; let store;
const createStore = options => { const createStore = (options) => {
store = initStore({ replicableType: MOCK_REPLICABLE_TYPE, graphqlFieldName: null, ...options }); store = initStore({ replicableType: MOCK_REPLICABLE_TYPE, graphqlFieldName: null, ...options });
jest.spyOn(store, 'dispatch').mockImplementation(); jest.spyOn(store, 'dispatch').mockImplementation();
}; };
......
...@@ -31,7 +31,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -31,7 +31,7 @@ describe('GeoReplicable Store Actions', () => {
}); });
describe('requestReplicableItems', () => { describe('requestReplicableItems', () => {
it('should commit mutation REQUEST_REPLICABLE_ITEMS', done => { it('should commit mutation REQUEST_REPLICABLE_ITEMS', (done) => {
testAction( testAction(
actions.requestReplicableItems, actions.requestReplicableItems,
null, null,
...@@ -44,7 +44,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -44,7 +44,7 @@ describe('GeoReplicable Store Actions', () => {
}); });
describe('receiveReplicableItemsSuccess', () => { describe('receiveReplicableItemsSuccess', () => {
it('should commit mutation RECEIVE_REPLICABLE_ITEMS_SUCCESS', done => { it('should commit mutation RECEIVE_REPLICABLE_ITEMS_SUCCESS', (done) => {
testAction( testAction(
actions.receiveReplicableItemsSuccess, actions.receiveReplicableItemsSuccess,
{ data: MOCK_BASIC_FETCH_DATA_MAP, pagination: MOCK_RESTFUL_PAGINATION_DATA }, { data: MOCK_BASIC_FETCH_DATA_MAP, pagination: MOCK_RESTFUL_PAGINATION_DATA },
...@@ -82,7 +82,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -82,7 +82,7 @@ describe('GeoReplicable Store Actions', () => {
state.useGraphQl = true; state.useGraphQl = true;
}); });
it('calls fetchReplicableItemsGraphQl', done => { it('calls fetchReplicableItemsGraphQl', (done) => {
testAction( testAction(
actions.fetchReplicableItems, actions.fetchReplicableItems,
null, null,
...@@ -102,7 +102,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -102,7 +102,7 @@ describe('GeoReplicable Store Actions', () => {
state.useGraphQl = false; state.useGraphQl = false;
}); });
it('calls fetchReplicableItemsRestful', done => { it('calls fetchReplicableItemsRestful', (done) => {
testAction( testAction(
actions.fetchReplicableItems, actions.fetchReplicableItems,
null, null,
...@@ -258,7 +258,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -258,7 +258,7 @@ describe('GeoReplicable Store Actions', () => {
jest.spyOn(gqClient, 'query').mockRejectedValue(); jest.spyOn(gqClient, 'query').mockRejectedValue();
}); });
it('should dispatch the request and error actions', done => { it('should dispatch the request and error actions', (done) => {
testAction( testAction(
actions.fetchReplicableItemsGraphQl, actions.fetchReplicableItemsGraphQl,
null, null,
...@@ -345,7 +345,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -345,7 +345,7 @@ describe('GeoReplicable Store Actions', () => {
jest.spyOn(Api, 'getGeoReplicableItems').mockRejectedValue(new Error(500)); jest.spyOn(Api, 'getGeoReplicableItems').mockRejectedValue(new Error(500));
}); });
it('should dispatch the request and error actions', done => { it('should dispatch the request and error actions', (done) => {
testAction( testAction(
actions.fetchReplicableItemsRestful, actions.fetchReplicableItemsRestful,
{}, {},
...@@ -359,7 +359,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -359,7 +359,7 @@ describe('GeoReplicable Store Actions', () => {
}); });
describe('requestInitiateAllReplicableSyncs', () => { describe('requestInitiateAllReplicableSyncs', () => {
it('should commit mutation REQUEST_INITIATE_ALL_REPLICABLE_SYNCS', done => { it('should commit mutation REQUEST_INITIATE_ALL_REPLICABLE_SYNCS', (done) => {
testAction( testAction(
actions.requestInitiateAllReplicableSyncs, actions.requestInitiateAllReplicableSyncs,
null, null,
...@@ -439,7 +439,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -439,7 +439,7 @@ describe('GeoReplicable Store Actions', () => {
jest.spyOn(Api, 'initiateAllGeoReplicableSyncs').mockRejectedValue(new Error(500)); jest.spyOn(Api, 'initiateAllGeoReplicableSyncs').mockRejectedValue(new Error(500));
}); });
it('should dispatch the request and error actions', done => { it('should dispatch the request and error actions', (done) => {
testAction( testAction(
actions.initiateAllReplicableSyncs, actions.initiateAllReplicableSyncs,
action, action,
...@@ -456,7 +456,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -456,7 +456,7 @@ describe('GeoReplicable Store Actions', () => {
}); });
describe('requestInitiateReplicableSync', () => { describe('requestInitiateReplicableSync', () => {
it('should commit mutation REQUEST_INITIATE_REPLICABLE_SYNC', done => { it('should commit mutation REQUEST_INITIATE_REPLICABLE_SYNC', (done) => {
testAction( testAction(
actions.requestInitiateReplicableSync, actions.requestInitiateReplicableSync,
null, null,
...@@ -540,7 +540,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -540,7 +540,7 @@ describe('GeoReplicable Store Actions', () => {
jest.spyOn(Api, 'initiateGeoReplicableSync').mockRejectedValue(new Error(500)); jest.spyOn(Api, 'initiateGeoReplicableSync').mockRejectedValue(new Error(500));
}); });
it('should dispatch the request and error actions', done => { it('should dispatch the request and error actions', (done) => {
testAction( testAction(
actions.initiateReplicableSync, actions.initiateReplicableSync,
{ projectId, name, action }, { projectId, name, action },
...@@ -560,7 +560,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -560,7 +560,7 @@ describe('GeoReplicable Store Actions', () => {
}); });
describe('setFilter', () => { describe('setFilter', () => {
it('should commit mutation SET_FILTER', done => { it('should commit mutation SET_FILTER', (done) => {
const testValue = 1; const testValue = 1;
testAction( testAction(
...@@ -575,7 +575,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -575,7 +575,7 @@ describe('GeoReplicable Store Actions', () => {
}); });
describe('setSearch', () => { describe('setSearch', () => {
it('should commit mutation SET_SEARCH', done => { it('should commit mutation SET_SEARCH', (done) => {
const testValue = 'Test Search'; const testValue = 'Test Search';
testAction( testAction(
...@@ -590,7 +590,7 @@ describe('GeoReplicable Store Actions', () => { ...@@ -590,7 +590,7 @@ describe('GeoReplicable Store Actions', () => {
}); });
describe('setPage', () => { describe('setPage', () => {
it('should commit mutation SET_PAGE', done => { it('should commit mutation SET_PAGE', (done) => {
state.paginationData.page = 1; state.paginationData.page = 1;
const testValue = 2; const testValue = 2;
......
...@@ -25,7 +25,7 @@ describe('TableHeaderComponent', () => { ...@@ -25,7 +25,7 @@ describe('TableHeaderComponent', () => {
describe('data', () => { describe('data', () => {
it('returns data with columnIconMeta prop initialized', () => { it('returns data with columnIconMeta prop initialized', () => {
defaultColumns.forEach(column => { defaultColumns.forEach((column) => {
expect(vm.columnIconMeta[column.name].sortIcon).toBe('angle-up'); expect(vm.columnIconMeta[column.name].sortIcon).toBe('angle-up');
expect(vm.columnIconMeta[column.name].iconTooltip).toBe('Ascending'); expect(vm.columnIconMeta[column.name].iconTooltip).toBe('Ascending');
}); });
......
...@@ -29,7 +29,7 @@ describe('GroupMemberStore', () => { ...@@ -29,7 +29,7 @@ describe('GroupMemberStore', () => {
}); });
it('initializes sortOrders on store state', () => { it('initializes sortOrders on store state', () => {
Object.keys(store.state.sortOrders).forEach(column => { Object.keys(store.state.sortOrders).forEach((column) => {
expect(store.state.sortOrders[column]).toBe(1); expect(store.state.sortOrders[column]).toBe(1);
}); });
}); });
...@@ -70,7 +70,7 @@ describe('GroupMemberStore', () => { ...@@ -70,7 +70,7 @@ describe('GroupMemberStore', () => {
mock.restore(); mock.restore();
}); });
it('calls service.getContributedMembers and sets response to the store on success', done => { it('calls service.getContributedMembers and sets response to the store on success', (done) => {
mock.onGet(contributionsPath).reply(200, rawMembers); mock.onGet(contributionsPath).reply(200, rawMembers);
jest.spyOn(store, 'setColumns').mockImplementation(() => {}); jest.spyOn(store, 'setColumns').mockImplementation(() => {});
jest.spyOn(store, 'setMembers').mockImplementation(() => {}); jest.spyOn(store, 'setMembers').mockImplementation(() => {});
...@@ -88,13 +88,13 @@ describe('GroupMemberStore', () => { ...@@ -88,13 +88,13 @@ describe('GroupMemberStore', () => {
expect(store.isLoading).toBe(true); expect(store.isLoading).toBe(true);
}); });
it('calls service.getContributedMembers and sets `isLoading` to false and shows flash message if request failed', done => { it('calls service.getContributedMembers and sets `isLoading` to false and shows flash message if request failed', (done) => {
mock.onGet(contributionsPath).reply(500, {}); mock.onGet(contributionsPath).reply(500, {});
store store
.fetchContributedMembers() .fetchContributedMembers()
.then(() => done.fail('Expected error to be thrown!')) .then(() => done.fail('Expected error to be thrown!'))
.catch(e => { .catch((e) => {
expect(e.message).toBe('Request failed with status code 500'); expect(e.message).toBe('Request failed with status code 500');
expect(store.isLoading).toBe(false); expect(store.isLoading).toBe(false);
expect(createFlash).toHaveBeenCalledWith( expect(createFlash).toHaveBeenCalledWith(
......
...@@ -5,7 +5,7 @@ import Component from 'ee/groups/components/invite_members.vue'; ...@@ -5,7 +5,7 @@ import Component from 'ee/groups/components/invite_members.vue';
describe('User invites', () => { describe('User invites', () => {
let wrapper; let wrapper;
const createComponent = propsData => { const createComponent = (propsData) => {
wrapper = shallowMount(Component, { wrapper = shallowMount(Component, {
propsData, propsData,
}); });
...@@ -44,7 +44,7 @@ describe('User invites', () => { ...@@ -44,7 +44,7 @@ describe('User invites', () => {
expect(inputs().length).toBe(3); expect(inputs().length).toBe(3);
}); });
it.each([0, 1, 2])('restores the value of the passed emails', index => { it.each([0, 1, 2])('restores the value of the passed emails', (index) => {
expect(inputs().at(index).attributes('value')).toBe(emails[index]); expect(inputs().at(index).attributes('value')).toBe(emails[index]);
}); });
}); });
...@@ -63,7 +63,7 @@ describe('User invites', () => { ...@@ -63,7 +63,7 @@ describe('User invites', () => {
expect(inputs().length).toBe(2); expect(inputs().length).toBe(2);
}); });
it.each([0, 1])('does not set a value', index => { it.each([0, 1])('does not set a value', (index) => {
expect(inputs().at(index).attributes('value')).toBe(undefined); expect(inputs().at(index).attributes('value')).toBe(undefined);
}); });
......
...@@ -5,7 +5,7 @@ import RegistrationTrialToggle from 'ee/registrations/components/registration_tr ...@@ -5,7 +5,7 @@ import RegistrationTrialToggle from 'ee/registrations/components/registration_tr
describe('Registration Trial Toggle', () => { describe('Registration Trial Toggle', () => {
let wrapper; let wrapper;
const createComponent = propsData => { const createComponent = (propsData) => {
wrapper = shallowMount(RegistrationTrialToggle, { wrapper = shallowMount(RegistrationTrialToggle, {
propsData, propsData,
}); });
......
...@@ -154,7 +154,7 @@ describe('List', () => { ...@@ -154,7 +154,7 @@ describe('List', () => {
it('shows the list items with expect props', () => { it('shows the list items with expect props', () => {
expect(findListItems()).toHaveLength(2); expect(findListItems()).toHaveLength(2);
findListItems().wrappers.forEach(item => findListItems().wrappers.forEach((item) =>
expect(item.props()).toEqual( expect(item.props()).toEqual(
expect.objectContaining({ expect.objectContaining({
framework: { framework: {
......
...@@ -16,7 +16,7 @@ describe('CommaSeparatedListTokenSelector', () => { ...@@ -16,7 +16,7 @@ describe('CommaSeparatedListTokenSelector', () => {
disallowedValueErrorMessage: 'The value entered is not allowed', disallowedValueErrorMessage: 'The value entered is not allowed',
}; };
const createComponent = options => { const createComponent = (options) => {
wrapper = mount(CommaSeparatedListTokenSelector, { wrapper = mount(CommaSeparatedListTokenSelector, {
attachTo: div, attachTo: div,
scopedSlots: { scopedSlots: {
...@@ -39,7 +39,7 @@ describe('CommaSeparatedListTokenSelector', () => { ...@@ -39,7 +39,7 @@ describe('CommaSeparatedListTokenSelector', () => {
const findErrorMessageText = () => const findErrorMessageText = () =>
findTokenSelector().find('[role="menuitem"][disabled="disabled"]').text(); findTokenSelector().find('[role="menuitem"][disabled="disabled"]').text();
const setTokenSelectorInputValue = value => { const setTokenSelectorInputValue = (value) => {
const tokenSelectorInput = findTokenSelectorInput(); const tokenSelectorInput = findTokenSelectorInput();
tokenSelectorInput.element.value = value; tokenSelectorInput.element.value = value;
...@@ -48,7 +48,7 @@ describe('CommaSeparatedListTokenSelector', () => { ...@@ -48,7 +48,7 @@ describe('CommaSeparatedListTokenSelector', () => {
return nextTick(); return nextTick();
}; };
const tokenSelectorTriggerEnter = event => { const tokenSelectorTriggerEnter = (event) => {
const tokenSelectorInput = findTokenSelectorInput(); const tokenSelectorInput = findTokenSelectorInput();
tokenSelectorInput.trigger('keydown.enter', event); tokenSelectorInput.trigger('keydown.enter', event);
}; };
......
...@@ -24,7 +24,7 @@ const DEFAULT_PROPS = { ...@@ -24,7 +24,7 @@ const DEFAULT_PROPS = {
describe('Insights chart component', () => { describe('Insights chart component', () => {
let wrapper; let wrapper;
const factory = propsData => const factory = (propsData) =>
shallowMount(InsightsChart, { shallowMount(InsightsChart, {
propsData, propsData,
stubs: { 'gl-column-chart': true, 'insights-chart-error': true }, stubs: { 'gl-column-chart': true, 'insights-chart-error': true },
......
...@@ -11,7 +11,7 @@ const defaultProvide = { fullPath: 'test', iid: 1, slaFeatureAvailable: true }; ...@@ -11,7 +11,7 @@ const defaultProvide = { fullPath: 'test', iid: 1, slaFeatureAvailable: true };
describe('Incident SLA', () => { describe('Incident SLA', () => {
let wrapper; let wrapper;
const mountComponent = options => { const mountComponent = (options) => {
wrapper = shallowMount( wrapper = shallowMount(
IncidentSla, IncidentSla,
merge( merge(
......
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