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
ee/app/assets/javascripts/vulnerabilities/helpers.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
ee/spec/frontend/issues_analytics/components/issues_analytics_spec.js
ee/spec/frontend/issues_analytics/components/issues_analytics_table_spec.js
......
......@@ -13,7 +13,7 @@ describe('EE DiffLineNoteForm', () => {
let saveDraft;
let wrapper;
const createStoreOptions = headSha => {
const createStoreOptions = (headSha) => {
const state = {
notes: {
notesData: { draftsPath: null },
......
......@@ -64,7 +64,7 @@ describe('ee/environments/components/canary_ingress.vue', () => {
it('is set to open the change modal', () => {
stableWeightDropdown
.findAll(GlDropdownItem)
.wrappers.forEach(w =>
.wrappers.forEach((w) =>
expect(getBinding(w.element, 'gl-modal')).toMatchObject({ value: CANARY_UPDATE_MODAL }),
);
});
......
......@@ -23,7 +23,7 @@ describe('Deploy Board', () => {
});
describe('with valid data', () => {
beforeEach(done => {
beforeEach((done) => {
wrapper = createComponent();
wrapper.vm.$nextTick(done);
});
......@@ -73,7 +73,7 @@ describe('Deploy Board', () => {
});
describe('with empty state', () => {
beforeEach(done => {
beforeEach((done) => {
wrapper = createComponent({
deployBoardData: {},
isLoading: false,
......@@ -92,7 +92,7 @@ describe('Deploy Board', () => {
});
describe('with loading state', () => {
beforeEach(done => {
beforeEach((done) => {
wrapper = createComponent({
deployBoardData: {},
isLoading: true,
......@@ -109,7 +109,7 @@ describe('Deploy Board', () => {
describe('has legend component', () => {
let statuses = [];
beforeEach(done => {
beforeEach((done) => {
wrapper = createComponent({
isLoading: false,
isEmpty: false,
......@@ -127,7 +127,7 @@ describe('Deploy Board', () => {
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`, () => {
expect(wrapper.find(`.deployment-instance-${item}`)).toBeDefined();
expect(wrapper.find(`.deployment-instance-${item} + .legend-text`).text()).toBe(
......
......@@ -31,7 +31,7 @@ describe('Environment', () => {
return axios.waitForAll();
};
const mockRequest = environmentList => {
const mockRequest = (environmentList) => {
mock.onGet(mockData.endpoint).reply(
200,
{
......
......@@ -80,7 +80,7 @@ describe('Environment table', () => {
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 = {
name: 'review',
size: 1,
......@@ -98,7 +98,7 @@ describe('Environment table', () => {
isDeployBoardVisible: false,
};
eventHub.$on('toggleDeployBoard', env => {
eventHub.$on('toggleDeployBoard', (env) => {
expect(env.id).toEqual(mockItem.id);
done();
});
......
......@@ -104,7 +104,7 @@ export const environment = {
updated_at: '2016-11-10T15:55:58.778Z',
};
const sharedEnvironmentData = id => ({
const sharedEnvironmentData = (id) => ({
environment_path: `/root/review-app/environments/${id}`,
external_url: null,
folderName: 'build',
......
......@@ -68,7 +68,7 @@ describe('Project Header', () => {
const removeLink = wrapper
.find(GlDropdown)
.findAll(GlDropdownItem)
.filter(w => w.text() === 'Remove');
.filter((w) => w.text() === 'Remove');
expect(removeLink.exists()).toBe(true);
});
......@@ -76,7 +76,7 @@ describe('Project Header', () => {
const removeLink = wrapper
.find(GlDropdown)
.findAll(GlDropdownItem)
.filter(w => w.text() === 'Remove');
.filter((w) => w.text() === 'Remove');
removeLink.at(0).vm.$emit('click');
return wrapper.vm.$nextTick().then(() => {
......
......@@ -20,10 +20,10 @@ describe('SidebarDatePicker', () => {
let wrapper;
const findIconByName = name =>
const findIconByName = (name) =>
wrapper
.findAll(GlIcon)
.filter(w => w.props().name === name)
.filter((w) => w.props().name === name)
.at(0);
const findEditButton = () => wrapper.find({ ref: 'editButton' });
const findRemoveButton = () => wrapper.find({ ref: 'removeButton' });
......@@ -35,7 +35,7 @@ describe('SidebarDatePicker', () => {
findEditButton().vm.$emit('click', e);
};
const createComponent = props => {
const createComponent = (props) => {
wrapper = shallowMount(SidebarDatepicker, {
propsData: {
...mockDatePickerProps,
......
......@@ -39,7 +39,7 @@ describe('SidebarHeaderComponent', () => {
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.$nextTick()
......
......@@ -31,7 +31,7 @@ describe('SidebarTodoComponent', () => {
});
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.$nextTick()
......
This diff is collapsed.
......@@ -20,13 +20,13 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
});
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);
});
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');
});
......@@ -40,7 +40,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
});
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);
});
......@@ -49,7 +49,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
describe('searchByKey', () => {
it('should return weight tokenKey when found by weight key', () => {
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);
expect(result).toEqual(match);
......@@ -59,7 +59,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
describe('searchBySymbol', () => {
it('should return weight tokenKey when found by weight symbol', () => {
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);
expect(result).toEqual(match);
......@@ -69,7 +69,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
describe('searchByKeyParam', () => {
it('should return weight tokenKey when found by weight key param', () => {
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);
expect(result).toEqual(match);
......@@ -79,7 +79,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
describe('searchByConditionUrl', () => {
it('should return weight condition when found by weight url', () => {
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);
expect(result).toBe(weightConditions[0]);
......@@ -89,7 +89,7 @@ describe('Issues Filtered Search Token Keys (EE)', () => {
describe('searchByConditionKeyValue', () => {
it('should return weight condition when found by weight tokenKey and value', () => {
const conditions = IssuableFilteredSearchTokenKeys.getConditions();
const weightConditions = conditions.filter(c => c.tokenKey === 'weight');
const weightConditions = conditions.filter((c) => c.tokenKey === 'weight');
const result = IssuableFilteredSearchTokenKeys.searchByConditionKeyValue(
weightConditions[0].tokenKey,
weightConditions[0].operator,
......
......@@ -48,7 +48,7 @@ describe('GeoNodeFormNamespaces', () => {
const findGlDropdown = () => wrapper.find(GlDropdown);
const findGlDropdownSearch = () => findGlDropdown().find(GlSearchBoxByType);
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);
describe('template', () => {
......@@ -94,11 +94,11 @@ describe('GeoNodeFormNamespaces', () => {
});
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', () => {
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', () => {
});
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');
vm.fetchGeoNodes()
......@@ -122,7 +122,7 @@ describe('AppComponent', () => {
.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';
statusCode = 500;
......@@ -139,7 +139,7 @@ describe('AppComponent', () => {
});
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);
vm.fetchNodeDetails(mockNode)
......@@ -151,7 +151,7 @@ describe('AppComponent', () => {
.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, {});
jest.spyOn(vm.service, 'getGeoNodeDetails');
......@@ -168,7 +168,7 @@ describe('AppComponent', () => {
.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();
jest.spyOn(vm.service, 'getGeoNodeDetails');
......@@ -185,7 +185,7 @@ describe('AppComponent', () => {
.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();
jest.spyOn(vm.service, 'getGeoNodeDetails');
......@@ -204,7 +204,7 @@ describe('AppComponent', () => {
});
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 };
mock.onPost(node.repairPath).reply(() => {
expect(node.nodeActionActive).toBe(true);
......@@ -224,7 +224,7 @@ describe('AppComponent', () => {
.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 };
mock.onPost(node.repairPath).reply(() => {
expect(node.nodeActionActive).toBe(true);
......@@ -247,7 +247,7 @@ describe('AppComponent', () => {
});
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 };
mock.onPut(node.basePath).reply(() => {
expect(node.nodeActionActive).toBe(true);
......@@ -271,7 +271,7 @@ describe('AppComponent', () => {
.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 };
mock.onPut(node.basePath).reply(() => {
expect(node.nodeActionActive).toBe(true);
......@@ -295,7 +295,7 @@ describe('AppComponent', () => {
});
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 };
mock.onDelete(node.basePath).reply(() => {
expect(node.nodeActionActive).toBe(true);
......@@ -315,7 +315,7 @@ describe('AppComponent', () => {
.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 };
mock.onDelete(node.basePath).reply(() => {
expect(node.nodeActionActive).toBe(true);
......
......@@ -37,7 +37,7 @@ describe('GeoNodeHeader', () => {
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/';
Vue.nextTick()
.then(() => {
......
......@@ -48,7 +48,7 @@ describe('GeoNodeSyncProgress', () => {
});
it('renders each row of popover correctly', () => {
findCounts().wrappers.forEach(row => {
findCounts().wrappers.forEach((row) => {
expect(row.element).toMatchSnapshot();
});
});
......
......@@ -39,7 +39,7 @@ describe('NodeDetailsSectionMain', () => {
describe('computed', () => {
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.revision = null;
Vue.nextTick()
......@@ -56,7 +56,7 @@ describe('NodeDetailsSectionMain', () => {
});
describe('nodeHealthStatus', () => {
it('returns health status string', done => {
it('returns health status string', (done) => {
// With default mock data
expect(vm.nodeHealthStatus).toBe('Healthy');
......
......@@ -63,7 +63,7 @@ describe('NodeDetailsSectionOther', () => {
});
describe('storageShardsStatus', () => {
it('returns `Unknown` when `nodeDetails.storageShardsMatch` is null', done => {
it('returns `Unknown` when `nodeDetails.storageShardsMatch` is null', (done) => {
vm.nodeDetails.storageShardsMatch = null;
Vue.nextTick()
.then(() => {
......@@ -73,7 +73,7 @@ describe('NodeDetailsSectionOther', () => {
.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;
Vue.nextTick()
.then(() => {
......@@ -89,7 +89,7 @@ describe('NodeDetailsSectionOther', () => {
});
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;
Vue.nextTick()
.then(() => {
......@@ -117,7 +117,7 @@ describe('NodeDetailsSectionOther', () => {
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;
Vue.nextTick(() => {
expect(vm.$el.querySelector('.section-items-container')).not.toBeNull();
......
......@@ -50,7 +50,7 @@ describe('GeoNodesStore', () => {
store.setNodes(mockNodes);
const nodeToBeRemoved = store.getNodes()[1];
store.removeNode(nodeToBeRemoved);
store.getNodes().forEach(node => {
store.getNodes().forEach((node) => {
expect(node.id).not.toBe(nodeToBeRemoved);
});
});
......
......@@ -26,7 +26,7 @@ describe('GeoReplicableApp', () => {
geoReplicableEmptySvgPath: MOCK_GEO_REPLICATION_SVG_PATH,
};
const createStore = options => {
const createStore = (options) => {
store = initStore({ replicableType: MOCK_REPLICABLE_TYPE, graphqlFieldName: null, ...options });
jest.spyOn(store, 'dispatch').mockImplementation();
};
......
......@@ -37,7 +37,7 @@ describe('GeoReplicableFilterBar', () => {
const findNavContainer = () => wrapper.find('nav');
const findGlDropdown = () => findNavContainer().find(GlDropdown);
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 findGlButton = () => findNavContainer().find(GlButton);
......@@ -57,7 +57,7 @@ describe('GeoReplicableFilterBar', () => {
describe('Filter options', () => {
it('renders a dropdown item for each filterOption', () => {
expect(findDropdownItemsText()).toStrictEqual(
wrapper.vm.filterOptions.map(n => {
wrapper.vm.filterOptions.map((n) => {
if (n.label === 'All') {
return `${n.label} ${MOCK_REPLICABLE_TYPE}`;
}
......
......@@ -21,7 +21,7 @@ describe('GeoReplicable', () => {
let wrapper;
let store;
const createStore = options => {
const createStore = (options) => {
store = initStore({ replicableType: MOCK_REPLICABLE_TYPE, graphqlFieldName: null, ...options });
jest.spyOn(store, 'dispatch').mockImplementation();
};
......
......@@ -31,7 +31,7 @@ describe('GeoReplicable Store Actions', () => {
});
describe('requestReplicableItems', () => {
it('should commit mutation REQUEST_REPLICABLE_ITEMS', done => {
it('should commit mutation REQUEST_REPLICABLE_ITEMS', (done) => {
testAction(
actions.requestReplicableItems,
null,
......@@ -44,7 +44,7 @@ describe('GeoReplicable Store Actions', () => {
});
describe('receiveReplicableItemsSuccess', () => {
it('should commit mutation RECEIVE_REPLICABLE_ITEMS_SUCCESS', done => {
it('should commit mutation RECEIVE_REPLICABLE_ITEMS_SUCCESS', (done) => {
testAction(
actions.receiveReplicableItemsSuccess,
{ data: MOCK_BASIC_FETCH_DATA_MAP, pagination: MOCK_RESTFUL_PAGINATION_DATA },
......@@ -82,7 +82,7 @@ describe('GeoReplicable Store Actions', () => {
state.useGraphQl = true;
});
it('calls fetchReplicableItemsGraphQl', done => {
it('calls fetchReplicableItemsGraphQl', (done) => {
testAction(
actions.fetchReplicableItems,
null,
......@@ -102,7 +102,7 @@ describe('GeoReplicable Store Actions', () => {
state.useGraphQl = false;
});
it('calls fetchReplicableItemsRestful', done => {
it('calls fetchReplicableItemsRestful', (done) => {
testAction(
actions.fetchReplicableItems,
null,
......@@ -258,7 +258,7 @@ describe('GeoReplicable Store Actions', () => {
jest.spyOn(gqClient, 'query').mockRejectedValue();
});
it('should dispatch the request and error actions', done => {
it('should dispatch the request and error actions', (done) => {
testAction(
actions.fetchReplicableItemsGraphQl,
null,
......@@ -345,7 +345,7 @@ describe('GeoReplicable Store Actions', () => {
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(
actions.fetchReplicableItemsRestful,
{},
......@@ -359,7 +359,7 @@ describe('GeoReplicable Store Actions', () => {
});
describe('requestInitiateAllReplicableSyncs', () => {
it('should commit mutation REQUEST_INITIATE_ALL_REPLICABLE_SYNCS', done => {
it('should commit mutation REQUEST_INITIATE_ALL_REPLICABLE_SYNCS', (done) => {
testAction(
actions.requestInitiateAllReplicableSyncs,
null,
......@@ -439,7 +439,7 @@ describe('GeoReplicable Store Actions', () => {
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(
actions.initiateAllReplicableSyncs,
action,
......@@ -456,7 +456,7 @@ describe('GeoReplicable Store Actions', () => {
});
describe('requestInitiateReplicableSync', () => {
it('should commit mutation REQUEST_INITIATE_REPLICABLE_SYNC', done => {
it('should commit mutation REQUEST_INITIATE_REPLICABLE_SYNC', (done) => {
testAction(
actions.requestInitiateReplicableSync,
null,
......@@ -540,7 +540,7 @@ describe('GeoReplicable Store Actions', () => {
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(
actions.initiateReplicableSync,
{ projectId, name, action },
......@@ -560,7 +560,7 @@ describe('GeoReplicable Store Actions', () => {
});
describe('setFilter', () => {
it('should commit mutation SET_FILTER', done => {
it('should commit mutation SET_FILTER', (done) => {
const testValue = 1;
testAction(
......@@ -575,7 +575,7 @@ describe('GeoReplicable Store Actions', () => {
});
describe('setSearch', () => {
it('should commit mutation SET_SEARCH', done => {
it('should commit mutation SET_SEARCH', (done) => {
const testValue = 'Test Search';
testAction(
......@@ -590,7 +590,7 @@ describe('GeoReplicable Store Actions', () => {
});
describe('setPage', () => {
it('should commit mutation SET_PAGE', done => {
it('should commit mutation SET_PAGE', (done) => {
state.paginationData.page = 1;
const testValue = 2;
......
......@@ -25,7 +25,7 @@ describe('TableHeaderComponent', () => {
describe('data', () => {
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].iconTooltip).toBe('Ascending');
});
......
......@@ -29,7 +29,7 @@ describe('GroupMemberStore', () => {
});
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);
});
});
......@@ -70,7 +70,7 @@ describe('GroupMemberStore', () => {
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);
jest.spyOn(store, 'setColumns').mockImplementation(() => {});
jest.spyOn(store, 'setMembers').mockImplementation(() => {});
......@@ -88,13 +88,13 @@ describe('GroupMemberStore', () => {
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, {});
store
.fetchContributedMembers()
.then(() => done.fail('Expected error to be thrown!'))
.catch(e => {
.catch((e) => {
expect(e.message).toBe('Request failed with status code 500');
expect(store.isLoading).toBe(false);
expect(createFlash).toHaveBeenCalledWith(
......
......@@ -5,7 +5,7 @@ import Component from 'ee/groups/components/invite_members.vue';
describe('User invites', () => {
let wrapper;
const createComponent = propsData => {
const createComponent = (propsData) => {
wrapper = shallowMount(Component, {
propsData,
});
......@@ -44,7 +44,7 @@ describe('User invites', () => {
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]);
});
});
......@@ -63,7 +63,7 @@ describe('User invites', () => {
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);
});
......
......@@ -5,7 +5,7 @@ import RegistrationTrialToggle from 'ee/registrations/components/registration_tr
describe('Registration Trial Toggle', () => {
let wrapper;
const createComponent = propsData => {
const createComponent = (propsData) => {
wrapper = shallowMount(RegistrationTrialToggle, {
propsData,
});
......
......@@ -154,7 +154,7 @@ describe('List', () => {
it('shows the list items with expect props', () => {
expect(findListItems()).toHaveLength(2);
findListItems().wrappers.forEach(item =>
findListItems().wrappers.forEach((item) =>
expect(item.props()).toEqual(
expect.objectContaining({
framework: {
......
......@@ -16,7 +16,7 @@ describe('CommaSeparatedListTokenSelector', () => {
disallowedValueErrorMessage: 'The value entered is not allowed',
};
const createComponent = options => {
const createComponent = (options) => {
wrapper = mount(CommaSeparatedListTokenSelector, {
attachTo: div,
scopedSlots: {
......@@ -39,7 +39,7 @@ describe('CommaSeparatedListTokenSelector', () => {
const findErrorMessageText = () =>
findTokenSelector().find('[role="menuitem"][disabled="disabled"]').text();
const setTokenSelectorInputValue = value => {
const setTokenSelectorInputValue = (value) => {
const tokenSelectorInput = findTokenSelectorInput();
tokenSelectorInput.element.value = value;
......@@ -48,7 +48,7 @@ describe('CommaSeparatedListTokenSelector', () => {
return nextTick();
};
const tokenSelectorTriggerEnter = event => {
const tokenSelectorTriggerEnter = (event) => {
const tokenSelectorInput = findTokenSelectorInput();
tokenSelectorInput.trigger('keydown.enter', event);
};
......
......@@ -24,7 +24,7 @@ const DEFAULT_PROPS = {
describe('Insights chart component', () => {
let wrapper;
const factory = propsData =>
const factory = (propsData) =>
shallowMount(InsightsChart, {
propsData,
stubs: { 'gl-column-chart': true, 'insights-chart-error': true },
......
......@@ -11,7 +11,7 @@ const defaultProvide = { fullPath: 'test', iid: 1, slaFeatureAvailable: true };
describe('Incident SLA', () => {
let wrapper;
const mountComponent = options => {
const mountComponent = (options) => {
wrapper = shallowMount(
IncidentSla,
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