Commit 13130993 authored by Nathan Friend's avatar Nathan Friend

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

Format files with prettier arrowParens [10/15]

See merge request gitlab-org/gitlab!50537
parents 4ad3f344 99bff445
This diff is collapsed.
...@@ -29,7 +29,7 @@ const mutate = jest.fn().mockResolvedValue({ ...@@ -29,7 +29,7 @@ const mutate = jest.fn().mockResolvedValue({
}, },
}, },
}); });
const mutateWithDataErrors = segment => const mutateWithDataErrors = (segment) =>
jest.fn().mockResolvedValue({ jest.fn().mockResolvedValue({
data: { data: {
[segment ? 'updateDevopsAdoptionSegment' : 'createDevopsAdoptionSegment']: { [segment ? 'updateDevopsAdoptionSegment' : 'createDevopsAdoptionSegment']: {
...@@ -64,13 +64,13 @@ describe('DevopsAdoptionSegmentModal', () => { ...@@ -64,13 +64,13 @@ describe('DevopsAdoptionSegmentModal', () => {
}; };
const findModal = () => wrapper.find(GlModal); const findModal = () => wrapper.find(GlModal);
const findByTestId = testId => findModal().find(`[data-testid="${testId}"]`); const findByTestId = (testId) => findModal().find(`[data-testid="${testId}"]`);
const actionButtonDisabledState = () => findModal().props('actionPrimary').attributes[0].disabled; const actionButtonDisabledState = () => findModal().props('actionPrimary').attributes[0].disabled;
const cancelButtonDisabledState = () => findModal().props('actionCancel').attributes[0].disabled; const cancelButtonDisabledState = () => findModal().props('actionCancel').attributes[0].disabled;
const actionButtonLoadingState = () => findModal().props('actionPrimary').attributes[0].loading; const actionButtonLoadingState = () => findModal().props('actionPrimary').attributes[0].loading;
const findAlert = () => findModal().find(GlAlert); const findAlert = () => findModal().find(GlAlert);
const assertHelperText = text => expect(getByText(wrapper.element, text)).not.toBeNull(); const assertHelperText = (text) => expect(getByText(wrapper.element, text)).not.toBeNull();
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
...@@ -89,7 +89,7 @@ describe('DevopsAdoptionSegmentModal', () => { ...@@ -89,7 +89,7 @@ describe('DevopsAdoptionSegmentModal', () => {
describe('displays the correct content', () => { describe('displays the correct content', () => {
beforeEach(() => createComponent()); beforeEach(() => createComponent());
const isCorrectShape = option => { const isCorrectShape = (option) => {
const keys = Object.keys(option); const keys = Object.keys(option);
return keys.includes('label') && keys.includes('value'); return keys.includes('label') && keys.includes('value');
}; };
......
...@@ -5,7 +5,7 @@ import DevopsAdoptionTableCellFlag from 'ee/admin/dev_ops_report/components/devo ...@@ -5,7 +5,7 @@ import DevopsAdoptionTableCellFlag from 'ee/admin/dev_ops_report/components/devo
describe('DevopsAdoptionTableCellFlag', () => { describe('DevopsAdoptionTableCellFlag', () => {
let wrapper; let wrapper;
const createComponent = props => { const createComponent = (props) => {
wrapper = shallowMount(DevopsAdoptionTableCellFlag, { wrapper = shallowMount(DevopsAdoptionTableCellFlag, {
propsData: { propsData: {
enabled: true, enabled: true,
......
...@@ -31,7 +31,7 @@ describe('DevopsAdoptionTable', () => { ...@@ -31,7 +31,7 @@ describe('DevopsAdoptionTable', () => {
const findTable = () => wrapper.find(GlTable); const findTable = () => wrapper.find(GlTable);
const findCol = testId => findTable().find(`[data-testid="${testId}"]`); const findCol = (testId) => findTable().find(`[data-testid="${testId}"]`);
const findColRowChild = (col, row, child) => const findColRowChild = (col, row, child) =>
findTable().findAll(`[data-testid="${col}"]`).at(row).find(child); findTable().findAll(`[data-testid="${col}"]`).at(row).find(child);
......
...@@ -55,7 +55,7 @@ describe('CodeReviewAnalyticsApp component', () => { ...@@ -55,7 +55,7 @@ describe('CodeReviewAnalyticsApp component', () => {
}, },
}); });
const createComponent = store => const createComponent = (store) =>
shallowMount(CodeReviewAnalyticsApp, { shallowMount(CodeReviewAnalyticsApp, {
localVue, localVue,
store, store,
......
...@@ -102,10 +102,10 @@ describe('Filter bar', () => { ...@@ -102,10 +102,10 @@ describe('Filter bar', () => {
}); });
const findFilteredSearch = () => wrapper.find(FilteredSearchBar); const findFilteredSearch = () => wrapper.find(FilteredSearchBar);
const getSearchToken = type => const getSearchToken = (type) =>
findFilteredSearch() findFilteredSearch()
.props('tokens') .props('tokens')
.find(token => token.type === type); .find((token) => token.type === type);
describe('default', () => { describe('default', () => {
beforeEach(() => { beforeEach(() => {
......
...@@ -25,13 +25,13 @@ describe('MergeRequestTable component', () => { ...@@ -25,13 +25,13 @@ describe('MergeRequestTable component', () => {
}, },
}); });
const createComponent = store => const createComponent = (store) =>
mount(MergeRequestTable, { mount(MergeRequestTable, {
localVue, localVue,
store, store,
}); });
const bootstrap = initialState => { const bootstrap = (initialState) => {
vuexStore = createStore(initialState); vuexStore = createStore(initialState);
wrapper = createComponent(vuexStore); wrapper = createComponent(vuexStore);
}; };
...@@ -41,8 +41,8 @@ describe('MergeRequestTable component', () => { ...@@ -41,8 +41,8 @@ describe('MergeRequestTable component', () => {
}); });
const findTable = () => wrapper.find(GlTable); const findTable = () => wrapper.find(GlTable);
const findTableRow = index => findTable().findAll('tbody tr').at(index); const findTableRow = (index) => findTable().findAll('tbody tr').at(index);
const findReviewTimeCol = rowIndex => findTableRow(rowIndex).findAll('td').at(1); const findReviewTimeCol = (rowIndex) => findTableRow(rowIndex).findAll('td').at(1);
const updateMergeRequests = (index, attrs) => const updateMergeRequests = (index, attrs) =>
mockMergeRequests.map((item, idx) => { mockMergeRequests.map((item, idx) => {
......
...@@ -91,7 +91,7 @@ describe('Code review analytics mergeRequests actions', () => { ...@@ -91,7 +91,7 @@ describe('Code review analytics mergeRequests actions', () => {
mock.onGet(/api\/(.*)\/analytics\/code_review/).replyOnce(500); mock.onGet(/api\/(.*)\/analytics\/code_review/).replyOnce(500);
}); });
it('dispatches error', done => { it('dispatches error', (done) => {
testAction( testAction(
actions.fetchMergeRequests, actions.fetchMergeRequests,
null, null,
......
...@@ -152,48 +152,48 @@ describe('Value Stream Analytics component', () => { ...@@ -152,48 +152,48 @@ describe('Value Stream Analytics component', () => {
return comp; return comp;
} }
const findStageNavItemAtIndex = index => const findStageNavItemAtIndex = (index) =>
wrapper.find(StageTableNav).findAll(StageNavItem).at(index); wrapper.find(StageTableNav).findAll(StageNavItem).at(index);
const findAddStageButton = () => wrapper.find(AddStageButton); const findAddStageButton = () => wrapper.find(AddStageButton);
const displaysProjectsDropdownFilter = flag => { const displaysProjectsDropdownFilter = (flag) => {
expect(wrapper.find(ProjectsDropdownFilter).exists()).toBe(flag); expect(wrapper.find(ProjectsDropdownFilter).exists()).toBe(flag);
}; };
const displaysDateRangePicker = flag => { const displaysDateRangePicker = (flag) => {
expect(wrapper.find(Daterange).exists()).toBe(flag); expect(wrapper.find(Daterange).exists()).toBe(flag);
}; };
const displaysMetrics = flag => { const displaysMetrics = (flag) => {
expect(wrapper.find(Metrics).exists()).toBe(flag); expect(wrapper.find(Metrics).exists()).toBe(flag);
}; };
const displaysStageTable = flag => { const displaysStageTable = (flag) => {
expect(wrapper.find(StageTable).exists()).toBe(flag); expect(wrapper.find(StageTable).exists()).toBe(flag);
}; };
const displaysDurationChart = flag => { const displaysDurationChart = (flag) => {
expect(wrapper.find(DurationChart).exists()).toBe(flag); expect(wrapper.find(DurationChart).exists()).toBe(flag);
}; };
const displaysTypeOfWork = flag => { const displaysTypeOfWork = (flag) => {
expect(wrapper.find(TypeOfWorkCharts).exists()).toBe(flag); expect(wrapper.find(TypeOfWorkCharts).exists()).toBe(flag);
}; };
const displaysPathNavigation = flag => { const displaysPathNavigation = (flag) => {
expect(wrapper.find(PathNavigation).exists()).toBe(flag); expect(wrapper.find(PathNavigation).exists()).toBe(flag);
}; };
const displaysAddStageButton = flag => { const displaysAddStageButton = (flag) => {
expect(wrapper.find(AddStageButton).exists()).toBe(flag); expect(wrapper.find(AddStageButton).exists()).toBe(flag);
}; };
const displaysFilterBar = flag => { const displaysFilterBar = (flag) => {
expect(wrapper.find(FilterBar).exists()).toBe(flag); expect(wrapper.find(FilterBar).exists()).toBe(flag);
}; };
const displaysValueStreamSelect = flag => { const displaysValueStreamSelect = (flag) => {
expect(wrapper.find(ValueStreamSelect).exists()).toBe(flag); expect(wrapper.find(ValueStreamSelect).exists()).toBe(flag);
}; };
...@@ -548,7 +548,7 @@ describe('Value Stream Analytics component', () => { ...@@ -548,7 +548,7 @@ describe('Value Stream Analytics component', () => {
}); });
const findFlashError = () => document.querySelector('.flash-container .flash-text'); const findFlashError = () => document.querySelector('.flash-container .flash-text');
const findError = async msg => { const findError = async (msg) => {
await waitForPromises(); await waitForPromises();
expect(findFlashError().innerText.trim()).toEqual(msg); expect(findFlashError().innerText.trim()).toEqual(msg);
}; };
......
...@@ -12,17 +12,17 @@ import { ...@@ -12,17 +12,17 @@ import {
customStageStopEvents as endEvents, customStageStopEvents as endEvents,
} from '../../mock_data'; } from '../../mock_data';
const formatStartEventOpts = _events => [ const formatStartEventOpts = (_events) => [
{ text: 'Select start event', value: null }, { text: 'Select start event', value: null },
..._events ..._events
.filter(ev => ev.canBeStartEvent) .filter((ev) => ev.canBeStartEvent)
.map(({ name: text, identifier: value }) => ({ text, value })), .map(({ name: text, identifier: value }) => ({ text, value })),
]; ];
const formatEndEventOpts = _events => [ const formatEndEventOpts = (_events) => [
{ text: 'Select end event', value: null }, { text: 'Select end event', value: null },
..._events ..._events
.filter(ev => !ev.canBeStartEvent) .filter((ev) => !ev.canBeStartEvent)
.map(({ name: text, identifier: value }) => ({ text, value })), .map(({ name: text, identifier: value }) => ({ text, value })),
]; ];
...@@ -54,8 +54,8 @@ describe('CustomStageFields', () => { ...@@ -54,8 +54,8 @@ describe('CustomStageFields', () => {
let wrapper = null; let wrapper = null;
const getSelectField = dropdownEl => dropdownEl.find(GlFormSelect); const getSelectField = (dropdownEl) => dropdownEl.find(GlFormSelect);
const getLabelSelect = dropdownEl => dropdownEl.find(LabelsSelector); const getLabelSelect = (dropdownEl) => dropdownEl.find(LabelsSelector);
const findName = () => wrapper.find('[data-testid="custom-stage-name"]'); const findName = () => wrapper.find('[data-testid="custom-stage-name"]');
const findStartEvent = () => wrapper.find('[data-testid="custom-stage-start-event"]'); const findStartEvent = () => wrapper.find('[data-testid="custom-stage-start-event"]');
...@@ -144,7 +144,7 @@ describe('CustomStageFields', () => { ...@@ -144,7 +144,7 @@ describe('CustomStageFields', () => {
}); });
describe('End event', () => { describe('End event', () => {
const possibleEndEvents = endEvents.filter(ev => const possibleEndEvents = endEvents.filter((ev) =>
labelStartEvent.allowedEndEvents.includes(ev.identifier), labelStartEvent.allowedEndEvents.includes(ev.identifier),
); );
......
...@@ -71,14 +71,14 @@ describe('CustomStageForm', () => { ...@@ -71,14 +71,14 @@ describe('CustomStageForm', () => {
let wrapper = null; let wrapper = null;
let mock; let mock;
const findEvent = ev => wrapper.emitted()[ev]; const findEvent = (ev) => wrapper.emitted()[ev];
const findSubmitButton = () => wrapper.find('[data-testid="save-custom-stage"]'); const findSubmitButton = () => wrapper.find('[data-testid="save-custom-stage"]');
const findCancelButton = () => wrapper.find('[data-testid="cancel-custom-stage"]'); const findCancelButton = () => wrapper.find('[data-testid="cancel-custom-stage"]');
const findRecoverStageDropdown = () => const findRecoverStageDropdown = () =>
wrapper.find('[data-testid="recover-hidden-stage-dropdown"]'); wrapper.find('[data-testid="recover-hidden-stage-dropdown"]');
const findFieldErrors = field => wrapper.vm.errors[field]; const findFieldErrors = (field) => wrapper.vm.errors[field];
const setFields = async (fields = minimumFields) => { const setFields = async (fields = minimumFields) => {
Object.entries(fields).forEach(([field, value]) => { Object.entries(fields).forEach(([field, value]) => {
......
...@@ -59,10 +59,10 @@ function createComponent({ ...@@ -59,10 +59,10 @@ function createComponent({
describe('DurationChart', () => { describe('DurationChart', () => {
let wrapper; let wrapper;
const findContainer = _wrapper => _wrapper.find('[data-testid="vsa-duration-chart"]'); const findContainer = (_wrapper) => _wrapper.find('[data-testid="vsa-duration-chart"]');
const findScatterPlot = _wrapper => _wrapper.find(Scatterplot); const findScatterPlot = (_wrapper) => _wrapper.find(Scatterplot);
const findStageDropdown = _wrapper => _wrapper.find(StageDropdownFilter); const findStageDropdown = (_wrapper) => _wrapper.find(StageDropdownFilter);
const findLoader = _wrapper => _wrapper.find(ChartSkeletonLoader); const findLoader = (_wrapper) => _wrapper.find(ChartSkeletonLoader);
const selectStage = (_wrapper, index = 0) => { const selectStage = (_wrapper, index = 0) => {
findStageDropdown(_wrapper).findAll(GlDropdownItem).at(index).vm.$emit('click'); findStageDropdown(_wrapper).findAll(GlDropdownItem).at(index).vm.$emit('click');
......
...@@ -75,7 +75,7 @@ describe('Filter bar', () => { ...@@ -75,7 +75,7 @@ describe('Filter bar', () => {
}); });
}; };
const createComponent = initialStore => { const createComponent = (initialStore) => {
return shallowMount(FilterBar, { return shallowMount(FilterBar, {
localVue, localVue,
store: initialStore, store: initialStore,
...@@ -101,10 +101,10 @@ describe('Filter bar', () => { ...@@ -101,10 +101,10 @@ describe('Filter bar', () => {
const selectedLabelList = [filterLabels[0]]; const selectedLabelList = [filterLabels[0]];
const findFilteredSearch = () => wrapper.find(FilteredSearchBar); const findFilteredSearch = () => wrapper.find(FilteredSearchBar);
const getSearchToken = type => const getSearchToken = (type) =>
findFilteredSearch() findFilteredSearch()
.props('tokens') .props('tokens')
.find(token => token.type === type); .find((token) => token.type === type);
describe('default', () => { describe('default', () => {
beforeEach(() => { beforeEach(() => {
......
...@@ -10,10 +10,10 @@ import waitForPromises from 'helpers/wait_for_promises'; ...@@ -10,10 +10,10 @@ import waitForPromises from 'helpers/wait_for_promises';
import { groupLabels } from '../mock_data'; import { groupLabels } from '../mock_data';
const selectedLabel = groupLabels[groupLabels.length - 1]; const selectedLabel = groupLabels[groupLabels.length - 1];
const findActiveItem = wrapper => const findActiveItem = (wrapper) =>
wrapper wrapper
.findAll('gl-dropdown-item-stub') .findAll('gl-dropdown-item-stub')
.filter(d => d.attributes('active')) .filter((d) => d.attributes('active'))
.at(0); .at(0);
const findFlashError = () => document.querySelector('.flash-container .flash-text'); const findFlashError = () => document.querySelector('.flash-container .flash-text');
...@@ -66,7 +66,7 @@ describe('Value Stream Analytics LabelsSelector', () => { ...@@ -66,7 +66,7 @@ describe('Value Stream Analytics LabelsSelector', () => {
expect(wrapper.html()).toMatchSnapshot(); expect(wrapper.html()).toMatchSnapshot();
}); });
it.each(labelNames)('generate a label item for the label %s', name => { it.each(labelNames)('generate a label item for the label %s', (name) => {
expect(wrapper.text()).toContain(name); expect(wrapper.text()).toContain(name);
}); });
......
...@@ -25,7 +25,7 @@ describe('Metrics', () => { ...@@ -25,7 +25,7 @@ describe('Metrics', () => {
wrapper.destroy(); wrapper.destroy();
}); });
const findTimeMetricsAtIndex = index => wrapper.findAll(TimeMetricsCard).at(index); const findTimeMetricsAtIndex = (index) => wrapper.findAll(TimeMetricsCard).at(index);
it.each` it.each`
metric | index | requestType metric | index | requestType
......
...@@ -6,7 +6,7 @@ import { transformedStagePathData, issueStage } from '../mock_data'; ...@@ -6,7 +6,7 @@ import { transformedStagePathData, issueStage } from '../mock_data';
describe('PathNavigation', () => { describe('PathNavigation', () => {
let wrapper = null; let wrapper = null;
const createComponent = props => { const createComponent = (props) => {
return mount(Component, { return mount(Component, {
propsData: { propsData: {
stages: transformedStagePathData, stages: transformedStagePathData,
...@@ -21,7 +21,7 @@ describe('PathNavigation', () => { ...@@ -21,7 +21,7 @@ describe('PathNavigation', () => {
return wrapper.findAll('.gl-path-button'); return wrapper.findAll('.gl-path-button');
}; };
const clickItemAt = index => { const clickItemAt = (index) => {
pathNavigationItems().at(index).trigger('click'); pathNavigationItems().at(index).trigger('click');
}; };
...@@ -42,7 +42,7 @@ describe('PathNavigation', () => { ...@@ -42,7 +42,7 @@ describe('PathNavigation', () => {
it('contains all the expected stages', () => { it('contains all the expected stages', () => {
const html = wrapper.find(GlPath).html(); const html = wrapper.find(GlPath).html();
transformedStagePathData.forEach(stage => { transformedStagePathData.forEach((stage) => {
expect(html).toContain(stage.title); expect(html).toContain(stage.title);
}); });
}); });
......
...@@ -38,7 +38,7 @@ describe('StageDropdownFilter component', () => { ...@@ -38,7 +38,7 @@ describe('StageDropdownFilter component', () => {
}); });
const findDropdown = () => wrapper.find(GlDropdown); const findDropdown = () => wrapper.find(GlDropdown);
const selectDropdownItemAtIndex = index => const selectDropdownItemAtIndex = (index) =>
findDropdown().findAll(GlDropdownItem).at(index).vm.$emit('click'); findDropdown().findAll(GlDropdownItem).at(index).vm.$emit('click');
describe('on stage click', () => { describe('on stage click', () => {
......
...@@ -18,7 +18,7 @@ import { ...@@ -18,7 +18,7 @@ import {
codeEvents, codeEvents,
} from '../mock_data'; } from '../mock_data';
const generateEvents = n => const generateEvents = (n) =>
Array(n) Array(n)
.fill(issueEvents[0]) .fill(issueEvents[0])
.map((ev, k) => ({ ...ev, title: `event-${k}`, id: k })); .map((ev, k) => ({ ...ev, title: `event-${k}`, id: k }));
......
...@@ -29,7 +29,7 @@ describe('StageNavItem', () => { ...@@ -29,7 +29,7 @@ describe('StageNavItem', () => {
const findStageTooltip = () => getBinding(findStageTitle().element, 'gl-tooltip'); const findStageTooltip = () => getBinding(findStageTitle().element, 'gl-tooltip');
const findStageMedian = () => wrapper.find({ ref: 'median' }); const findStageMedian = () => wrapper.find({ ref: 'median' });
const findDropdown = () => wrapper.find({ ref: 'dropdown' }); const findDropdown = () => wrapper.find({ ref: 'dropdown' });
const setFakeTitleWidth = value => const setFakeTitleWidth = (value) =>
Object.defineProperty(findStageTitle().element, 'scrollWidth', { Object.defineProperty(findStageTitle().element, 'scrollWidth', {
value, value,
}); });
......
...@@ -65,7 +65,7 @@ describe('StageTable', () => { ...@@ -65,7 +65,7 @@ describe('StageTable', () => {
expect(renderedHeaders).toHaveLength(headers.length); expect(renderedHeaders).toHaveLength(headers.length);
const headerText = wrapper.find($sel.headersList).text(); const headerText = wrapper.find($sel.headersList).text();
headers.forEach(title => { headers.forEach((title) => {
expect(headerText).toContain(title); expect(headerText).toContain(title);
}); });
}); });
...@@ -85,7 +85,7 @@ describe('StageTable', () => { ...@@ -85,7 +85,7 @@ describe('StageTable', () => {
expect(evs).toHaveLength(allowedStages.length); expect(evs).toHaveLength(allowedStages.length);
const nav = wrapper.find($sel.nav).html(); const nav = wrapper.find($sel.nav).html();
allowedStages.forEach(stage => { allowedStages.forEach((stage) => {
expect(nav).toContain(stage.title); expect(nav).toContain(stage.title);
}); });
}); });
...@@ -105,7 +105,7 @@ describe('StageTable', () => { ...@@ -105,7 +105,7 @@ describe('StageTable', () => {
expect(evs).toHaveLength(issueEvents.length); expect(evs).toHaveLength(issueEvents.length);
const evshtml = wrapper.find($sel.eventList).html(); const evshtml = wrapper.find($sel.eventList).html();
issueEvents.forEach(ev => { issueEvents.forEach((ev) => {
expect(evshtml).toContain(ev.title); expect(evshtml).toContain(ev.title);
}); });
}); });
...@@ -128,7 +128,7 @@ describe('StageTable', () => { ...@@ -128,7 +128,7 @@ describe('StageTable', () => {
it('will render the list of stages', () => { it('will render the list of stages', () => {
const navEl = wrapper.find($sel.nav).element; const navEl = wrapper.find($sel.nav).element;
allowedStages.forEach(stage => { allowedStages.forEach((stage) => {
expect(getByText(navEl, stage.title, { selector: 'li' })).not.toBe(null); expect(getByText(navEl, stage.title, { selector: 'li' })).not.toBe(null);
}); });
}); });
......
...@@ -18,9 +18,9 @@ import { groupLabels } from '../../mock_data'; ...@@ -18,9 +18,9 @@ import { groupLabels } from '../../mock_data';
const selectedLabelIds = [groupLabels[0].id]; const selectedLabelIds = [groupLabels[0].id];
const findSubjectFilters = ctx => ctx.find(GlSegmentedControl); const findSubjectFilters = (ctx) => ctx.find(GlSegmentedControl);
const findSelectedSubjectFilters = ctx => findSubjectFilters(ctx).attributes('checked'); const findSelectedSubjectFilters = (ctx) => findSubjectFilters(ctx).attributes('checked');
const findDropdownLabels = ctx => ctx.find(LabelsSelector).findAll(GlDropdownItem); const findDropdownLabels = (ctx) => ctx.find(LabelsSelector).findAll(GlDropdownItem);
const selectLabelAtIndex = (ctx, index) => { const selectLabelAtIndex = (ctx, index) => {
findDropdownLabels(ctx).at(index).trigger('click'); findDropdownLabels(ctx).at(index).trigger('click');
......
...@@ -51,9 +51,9 @@ describe('TypeOfWorkCharts', () => { ...@@ -51,9 +51,9 @@ describe('TypeOfWorkCharts', () => {
let wrapper = null; let wrapper = null;
const findSubjectFilters = _wrapper => _wrapper.find(TasksByTypeFilters); const findSubjectFilters = (_wrapper) => _wrapper.find(TasksByTypeFilters);
const findTasksByTypeChart = _wrapper => _wrapper.find(TasksByTypeChart); const findTasksByTypeChart = (_wrapper) => _wrapper.find(TasksByTypeChart);
const findLoader = _wrapper => _wrapper.find(ChartSkeletonLoader); const findLoader = (_wrapper) => _wrapper.find(ChartSkeletonLoader);
const selectedFilterText = const selectedFilterText =
"Type of work Showing data for group 'Gitlab Org' from Dec 11, 2019 to Jan 10, 2020"; "Type of work Showing data for group 'Gitlab Org' from Dec 11, 2019 to Jan 10, 2020";
......
...@@ -52,10 +52,10 @@ describe('ValueStreamSelect', () => { ...@@ -52,10 +52,10 @@ describe('ValueStreamSelect', () => {
}, },
}); });
const findModal = modal => wrapper.find(`[data-testid="${modal}-value-stream-modal"]`); const findModal = (modal) => wrapper.find(`[data-testid="${modal}-value-stream-modal"]`);
const submitModal = modal => findModal(modal).vm.$emit('primary', mockEvent); const submitModal = (modal) => findModal(modal).vm.$emit('primary', mockEvent);
const findSelectValueStreamDropdown = () => wrapper.find(GlDropdown); const findSelectValueStreamDropdown = () => wrapper.find(GlDropdown);
const findSelectValueStreamDropdownOptions = _wrapper => findDropdownItemText(_wrapper); const findSelectValueStreamDropdownOptions = (_wrapper) => findDropdownItemText(_wrapper);
const findCreateValueStreamButton = () => wrapper.find(GlButton); const findCreateValueStreamButton = () => wrapper.find(GlButton);
const findDeleteValueStreamButton = () => wrapper.find('[data-testid="delete-value-stream"]'); const findDeleteValueStreamButton = () => wrapper.find('[data-testid="delete-value-stream"]');
...@@ -82,7 +82,7 @@ describe('ValueStreamSelect', () => { ...@@ -82,7 +82,7 @@ describe('ValueStreamSelect', () => {
it('renders each value stream including a create button', () => { it('renders each value stream including a create button', () => {
const opts = findSelectValueStreamDropdownOptions(wrapper); const opts = findSelectValueStreamDropdownOptions(wrapper);
[...valueStreams.map(v => v.name), 'Create new Value Stream'].forEach(vs => { [...valueStreams.map((v) => v.name), 'Create new Value Stream'].forEach((vs) => {
expect(opts).toContain(vs); expect(opts).toContain(vs);
}); });
}); });
......
...@@ -19,10 +19,10 @@ export function renderTotalTime(selector, element, totalTime = {}) { ...@@ -19,10 +19,10 @@ export function renderTotalTime(selector, element, totalTime = {}) {
export const shouldFlashAMessage = (msg = '') => export const shouldFlashAMessage = (msg = '') =>
expect(document.querySelector('.flash-container .flash-text').innerText.trim()).toBe(msg); expect(document.querySelector('.flash-container .flash-text').innerText.trim()).toBe(msg);
export const findDropdownItems = wrapper => wrapper.findAll(GlDropdownItem); export const findDropdownItems = (wrapper) => wrapper.findAll(GlDropdownItem);
export const findDropdownItemText = wrapper => export const findDropdownItemText = (wrapper) =>
findDropdownItems(wrapper).wrappers.map(w => w.text()); findDropdownItems(wrapper).wrappers.map((w) => w.text());
export default { export default {
renderTotalTime, renderTotalTime,
......
...@@ -18,8 +18,8 @@ import { getDateInPast, getDatesInRange } from '~/lib/utils/datetime_utility'; ...@@ -18,8 +18,8 @@ import { getDateInPast, getDatesInRange } from '~/lib/utils/datetime_utility';
const fixtureEndpoints = { const fixtureEndpoints = {
customizableCycleAnalyticsStagesAndEvents: 'analytics/value_stream_analytics/stages.json', // customizable stages and events endpoint customizableCycleAnalyticsStagesAndEvents: 'analytics/value_stream_analytics/stages.json', // customizable stages and events endpoint
stageEvents: stage => `analytics/value_stream_analytics/stages/${stage}/records.json`, stageEvents: (stage) => `analytics/value_stream_analytics/stages/${stage}/records.json`,
stageMedian: stage => `analytics/value_stream_analytics/stages/${stage}/median.json`, stageMedian: (stage) => `analytics/value_stream_analytics/stages/${stage}/median.json`,
recentActivityData: 'analytics/metrics/value_stream_analytics/summary.json', recentActivityData: 'analytics/metrics/value_stream_analytics/summary.json',
timeMetricsData: 'analytics/metrics/value_stream_analytics/time_summary.json', timeMetricsData: 'analytics/metrics/value_stream_analytics/time_summary.json',
groupLabels: 'api/group_labels.json', groupLabels: 'api/group_labels.json',
...@@ -58,7 +58,7 @@ export const group = { ...@@ -58,7 +58,7 @@ export const group = {
export const currentGroup = convertObjectPropsToCamelCase(group, { deep: true }); export const currentGroup = convertObjectPropsToCamelCase(group, { deep: true });
const getStageByTitle = (stages, title) => const getStageByTitle = (stages, title) =>
stages.find(stage => stage.title && stage.title.toLowerCase().trim() === title) || {}; stages.find((stage) => stage.title && stage.title.toLowerCase().trim() === title) || {};
export const recentActivityData = getJSONFixture(fixtureEndpoints.recentActivityData); export const recentActivityData = getJSONFixture(fixtureEndpoints.recentActivityData);
export const timeMetricsData = getJSONFixture(fixtureEndpoints.timeMetricsData); export const timeMetricsData = getJSONFixture(fixtureEndpoints.timeMetricsData);
...@@ -81,7 +81,7 @@ export const stagingStage = getStageByTitle(dummyState.stages, 'staging'); ...@@ -81,7 +81,7 @@ export const stagingStage = getStageByTitle(dummyState.stages, 'staging');
export const allowedStages = [issueStage, planStage, codeStage]; export const allowedStages = [issueStage, planStage, codeStage];
const deepCamelCase = obj => convertObjectPropsToCamelCase(obj, { deep: true }); const deepCamelCase = (obj) => convertObjectPropsToCamelCase(obj, { deep: true });
export const defaultStages = ['issue', 'plan', 'review', 'code', 'test', 'staging']; export const defaultStages = ['issue', 'plan', 'review', 'code', 'test', 'staging'];
...@@ -135,24 +135,24 @@ export const medians = stageMedians; ...@@ -135,24 +135,24 @@ export const medians = stageMedians;
export const rawCustomStageEvents = customizableStagesAndEvents.events; export const rawCustomStageEvents = customizableStagesAndEvents.events;
export const camelCasedStageEvents = rawCustomStageEvents.map(deepCamelCase); export const camelCasedStageEvents = rawCustomStageEvents.map(deepCamelCase);
export const customStageLabelEvents = camelCasedStageEvents.filter(ev => ev.type === 'label'); export const customStageLabelEvents = camelCasedStageEvents.filter((ev) => ev.type === 'label');
export const customStageStartEvents = camelCasedStageEvents.filter(ev => ev.canBeStartEvent); export const customStageStartEvents = camelCasedStageEvents.filter((ev) => ev.canBeStartEvent);
// get all the possible stop events // get all the possible stop events
const allowedEndEventIds = new Set(customStageStartEvents.flatMap(e => e.allowedEndEvents)); const allowedEndEventIds = new Set(customStageStartEvents.flatMap((e) => e.allowedEndEvents));
export const customStageStopEvents = camelCasedStageEvents.filter(ev => export const customStageStopEvents = camelCasedStageEvents.filter((ev) =>
allowedEndEventIds.has(ev.identifier), allowedEndEventIds.has(ev.identifier),
); );
export const customStageEvents = uniq( export const customStageEvents = uniq(
[...customStageStartEvents, ...customStageStopEvents], [...customStageStartEvents, ...customStageStopEvents],
false, false,
ev => ev.identifier, (ev) => ev.identifier,
); );
export const labelStartEvent = customStageLabelEvents[0]; export const labelStartEvent = customStageLabelEvents[0];
export const labelStopEvent = customStageLabelEvents.find( export const labelStopEvent = customStageLabelEvents.find(
ev => ev.identifier === labelStartEvent.allowedEndEvents[0], (ev) => ev.identifier === labelStartEvent.allowedEndEvents[0],
); );
export const rawCustomStageFormErrors = { export const rawCustomStageFormErrors = {
...@@ -166,10 +166,10 @@ const dateRange = getDatesInRange(startDate, endDate, toYmd); ...@@ -166,10 +166,10 @@ const dateRange = getDatesInRange(startDate, endDate, toYmd);
export const apiTasksByTypeData = getJSONFixture( export const apiTasksByTypeData = getJSONFixture(
'analytics/charts/type_of_work/tasks_by_type.json', 'analytics/charts/type_of_work/tasks_by_type.json',
).map(labelData => { ).map((labelData) => {
// add data points for our mock date range // add data points for our mock date range
const maxValue = 10; const maxValue = 10;
const series = dateRange.map(date => [date, Math.floor(Math.random() * Math.floor(maxValue))]); const series = dateRange.map((date) => [date, Math.floor(Math.random() * Math.floor(maxValue))]);
return { return {
...labelData, ...labelData,
series, series,
......
...@@ -80,7 +80,7 @@ describe('Value Stream Analytics getters', () => { ...@@ -80,7 +80,7 @@ describe('Value Stream Analytics getters', () => {
}); });
describe('without a currentGroup set', () => { describe('without a currentGroup set', () => {
it.each([[''], [{}], [null]])('given "%s" will return null', value => { it.each([[''], [{}], [null]])('given "%s" will return null', (value) => {
state = { currentGroup: value }; state = { currentGroup: value };
expect(getters.currentGroupPath(state)).toEqual(null); expect(getters.currentGroupPath(state)).toEqual(null);
}); });
......
...@@ -130,7 +130,7 @@ describe('Value Stream Analytics mutations', () => { ...@@ -130,7 +130,7 @@ describe('Value Stream Analytics mutations', () => {
}); });
it('will convert the stats object to stages', () => { it('will convert the stats object to stages', () => {
[issueStage, planStage, codeStage, stagingStage, reviewStage].forEach(stage => { [issueStage, planStage, codeStage, stagingStage, reviewStage].forEach((stage) => {
expect(state.stages).toContainEqual(stage); expect(state.stages).toContainEqual(stage);
}); });
}); });
......
...@@ -39,7 +39,7 @@ import { ...@@ -39,7 +39,7 @@ import {
timeMetricsData, timeMetricsData,
} from './mock_data'; } from './mock_data';
const labelEventIds = labelEvents.map(ev => ev.identifier); const labelEventIds = labelEvents.map((ev) => ev.identifier);
describe('Value Stream Analytics utils', () => { describe('Value Stream Analytics utils', () => {
describe('isStartEvent', () => { describe('isStartEvent', () => {
...@@ -49,7 +49,7 @@ describe('Value Stream Analytics utils', () => { ...@@ -49,7 +49,7 @@ describe('Value Stream Analytics utils', () => {
it('will return false for input that is not a start event', () => { it('will return false for input that is not a start event', () => {
[{ identifier: 'fake-event', canBeStartEvent: false }, {}, [], null, undefined].forEach( [{ identifier: 'fake-event', canBeStartEvent: false }, {}, [], null, undefined].forEach(
ev => { (ev) => {
expect(isStartEvent(ev)).toEqual(false); expect(isStartEvent(ev)).toEqual(false);
}, },
); );
...@@ -62,7 +62,7 @@ describe('Value Stream Analytics utils', () => { ...@@ -62,7 +62,7 @@ describe('Value Stream Analytics utils', () => {
}); });
it('will return false if the given event identifier is not in the labelEvents array', () => { it('will return false if the given event identifier is not in the labelEvents array', () => {
[startEvents[1].identifier, null, undefined, ''].forEach(ev => { [startEvents[1].identifier, null, undefined, ''].forEach((ev) => {
expect(isLabelEvent(labelEventIds, ev)).toEqual(false); expect(isLabelEvent(labelEventIds, ev)).toEqual(false);
}); });
expect(isLabelEvent(labelEventIds)).toEqual(false); expect(isLabelEvent(labelEventIds)).toEqual(false);
...@@ -71,20 +71,20 @@ describe('Value Stream Analytics utils', () => { ...@@ -71,20 +71,20 @@ describe('Value Stream Analytics utils', () => {
describe('eventToOption', () => { describe('eventToOption', () => {
it('will return null if no valid object is passed in', () => { it('will return null if no valid object is passed in', () => {
[{}, [], null, undefined].forEach(i => { [{}, [], null, undefined].forEach((i) => {
expect(eventToOption(i)).toEqual(null); expect(eventToOption(i)).toEqual(null);
}); });
}); });
it('will set the "value" property to the events identifier', () => { it('will set the "value" property to the events identifier', () => {
events.forEach(ev => { events.forEach((ev) => {
const res = eventToOption(ev); const res = eventToOption(ev);
expect(res.value).toEqual(ev.identifier); expect(res.value).toEqual(ev.identifier);
}); });
}); });
it('will set the "text" property to the events name', () => { it('will set the "text" property to the events name', () => {
events.forEach(ev => { events.forEach((ev) => {
const res = eventToOption(ev); const res = eventToOption(ev);
expect(res.text).toEqual(ev.name); expect(res.text).toEqual(ev.name);
}); });
...@@ -111,7 +111,7 @@ describe('Value Stream Analytics utils', () => { ...@@ -111,7 +111,7 @@ describe('Value Stream Analytics utils', () => {
}); });
it('will return an empty array if there are no end events available', () => { it('will return an empty array if there are no end events available', () => {
['cool_issue_label_added', [], {}, null, undefined].forEach(ev => { ['cool_issue_label_added', [], {}, null, undefined].forEach((ev) => {
expect(getAllowedEndEvents(events, ev)).toEqual([]); expect(getAllowedEndEvents(events, ev)).toEqual([]);
}); });
}); });
...@@ -123,7 +123,7 @@ describe('Value Stream Analytics utils', () => { ...@@ -123,7 +123,7 @@ describe('Value Stream Analytics utils', () => {
}); });
it('will return an empty array if there are no matching events', () => { it('will return an empty array if there are no matching events', () => {
[['lol', 'bad'], [], {}, null, undefined].forEach(items => { [['lol', 'bad'], [], {}, null, undefined].forEach((items) => {
expect(eventsByIdentifier(events, items)).toEqual([]); expect(eventsByIdentifier(events, items)).toEqual([]);
}); });
expect(eventsByIdentifier([], labelEvents)).toEqual([]); expect(eventsByIdentifier([], labelEvents)).toEqual([]);
...@@ -162,14 +162,14 @@ describe('Value Stream Analytics utils', () => { ...@@ -162,14 +162,14 @@ describe('Value Stream Analytics utils', () => {
it('sets the slug to the value of the stage id', () => { it('sets the slug to the value of the stage id', () => {
const transformed = transformRawStages([issueStage, rawCustomStage]); const transformed = transformRawStages([issueStage, rawCustomStage]);
transformed.forEach(t => { transformed.forEach((t) => {
expect(t.slug).toEqual(t.id); expect(t.slug).toEqual(t.id);
}); });
}); });
it('sets the name to the value of the stage title if its not set', () => { it('sets the name to the value of the stage title if its not set', () => {
const transformed = transformRawStages([issueStage, rawCustomStage]); const transformed = transformRawStages([issueStage, rawCustomStage]);
transformed.forEach(t => { transformed.forEach((t) => {
expect(t.name.length > 0).toBe(true); expect(t.name.length > 0).toBe(true);
expect(t.name).toEqual(t.title); expect(t.name).toEqual(t.title);
}); });
...@@ -204,7 +204,7 @@ describe('Value Stream Analytics utils', () => { ...@@ -204,7 +204,7 @@ describe('Value Stream Analytics utils', () => {
it('extracts the value from an array of datetime / value pairs', () => { it('extracts the value from an array of datetime / value pairs', () => {
expect(transformedDummySeries.every(isNumber)).toEqual(true); expect(transformedDummySeries.every(isNumber)).toEqual(true);
Object.values(dummySeries).forEach(v => { Object.values(dummySeries).forEach((v) => {
expect(transformedDummySeries.includes(v)).toBeTruthy(); expect(transformedDummySeries.includes(v)).toBeTruthy();
}); });
}); });
...@@ -232,21 +232,21 @@ describe('Value Stream Analytics utils', () => { ...@@ -232,21 +232,21 @@ describe('Value Stream Analytics utils', () => {
const extractSeriesValues = ({ label: { title: name }, series }) => { const extractSeriesValues = ({ label: { title: name }, series }) => {
return { return {
name, name,
data: series.map(kv => kv[1]), data: series.map((kv) => kv[1]),
}; };
}; };
const data = rawTasksByTypeData.map(extractSeriesValues); const data = rawTasksByTypeData.map(extractSeriesValues);
const labels = rawTasksByTypeData.map(d => { const labels = rawTasksByTypeData.map((d) => {
const { label } = d; const { label } = d;
return label.title; return label.title;
}); });
it('will return blank arrays if given no data', () => { it('will return blank arrays if given no data', () => {
[{ data: [], startDate, endDate }, [], {}].forEach(chartData => { [{ data: [], startDate, endDate }, [], {}].forEach((chartData) => {
transformed = getTasksByTypeData(chartData); transformed = getTasksByTypeData(chartData);
['data', 'groupBy'].forEach(key => { ['data', 'groupBy'].forEach((key) => {
expect(transformed[key]).toEqual([]); expect(transformed[key]).toEqual([]);
}); });
}); });
...@@ -258,7 +258,7 @@ describe('Value Stream Analytics utils', () => { ...@@ -258,7 +258,7 @@ describe('Value Stream Analytics utils', () => {
}); });
it('will return an object with the properties needed for the chart', () => { it('will return an object with the properties needed for the chart', () => {
['data', 'groupBy'].forEach(key => { ['data', 'groupBy'].forEach((key) => {
expect(transformed).toHaveProperty(key); expect(transformed).toHaveProperty(key);
}); });
}); });
...@@ -287,7 +287,7 @@ describe('Value Stream Analytics utils', () => { ...@@ -287,7 +287,7 @@ describe('Value Stream Analytics utils', () => {
}); });
it('contains a value for each day in the groupBy', () => { it('contains a value for each day in the groupBy', () => {
transformed.data.forEach(d => { transformed.data.forEach((d) => {
expect(d.data).toHaveLength(transformed.groupBy.length); expect(d.data).toHaveLength(transformed.groupBy.length);
}); });
}); });
...@@ -326,13 +326,13 @@ describe('Value Stream Analytics utils', () => { ...@@ -326,13 +326,13 @@ describe('Value Stream Analytics utils', () => {
}); });
it('selects the correct stage', () => { it('selects the correct stage', () => {
const selected = response.filter(stage => stage.selected === true)[0]; const selected = response.filter((stage) => stage.selected === true)[0];
expect(selected.title).toEqual(issueStage.title); expect(selected.title).toEqual(issueStage.title);
}); });
it('includes the correct metric for the associated stage', () => { it('includes the correct metric for the associated stage', () => {
const issue = response.filter(stage => stage.name === 'Issue')[0]; const issue = response.filter((stage) => stage.name === 'Issue')[0];
expect(issue.metric).toEqual(pathNavIssueMetric); expect(issue.metric).toEqual(pathNavIssueMetric);
}); });
......
...@@ -125,10 +125,10 @@ describe('Filter bar', () => { ...@@ -125,10 +125,10 @@ describe('Filter bar', () => {
}); });
const findFilteredSearch = () => wrapper.find(FilteredSearchBar); const findFilteredSearch = () => wrapper.find(FilteredSearchBar);
const getSearchToken = type => const getSearchToken = (type) =>
findFilteredSearch() findFilteredSearch()
.props('tokens') .props('tokens')
.find(token => token.type === type); .find((token) => token.type === type);
describe('default', () => { describe('default', () => {
beforeEach(() => { beforeEach(() => {
......
...@@ -57,7 +57,7 @@ describe('ThroughputTable', () => { ...@@ -57,7 +57,7 @@ describe('ThroughputTable', () => {
expect(wrapper.find(component).exists()).toBe(visible); expect(wrapper.find(component).exists()).toBe(visible);
}; };
const additionalData = data => { const additionalData = (data) => {
wrapper.setData({ wrapper.setData({
throughputTableData: { throughputTableData: {
list: [{ ...throughputTableData[0], ...data }], list: [{ ...throughputTableData[0], ...data }],
...@@ -68,7 +68,7 @@ describe('ThroughputTable', () => { ...@@ -68,7 +68,7 @@ describe('ThroughputTable', () => {
const findTable = () => wrapper.find(GlTable); const findTable = () => wrapper.find(GlTable);
const findCol = testId => findTable().find(`[data-testid="${testId}"]`); const findCol = (testId) => findTable().find(`[data-testid="${testId}"]`);
const findColSubItem = (colTestId, childTetestId) => const findColSubItem = (colTestId, childTetestId) =>
findCol(colTestId).find(`[data-testid="${childTetestId}"]`); findCol(colTestId).find(`[data-testid="${childTetestId}"]`);
......
...@@ -570,7 +570,7 @@ describe('ProductivityApp component', () => { ...@@ -570,7 +570,7 @@ describe('ProductivityApp component', () => {
milestone_title: null, milestone_title: null,
}; };
const shouldSetUrlParams = result => { const shouldSetUrlParams = (result) => {
expect(urlUtils.setUrlParams).toHaveBeenCalledWith(result, window.location.href, true); expect(urlUtils.setUrlParams).toHaveBeenCalledWith(result, window.location.href, true);
expect(commonUtils.historyPushState).toHaveBeenCalled(); expect(commonUtils.historyPushState).toHaveBeenCalled();
}; };
......
...@@ -3,7 +3,7 @@ import filterState from 'ee/analytics/productivity_analytics/store/modules/filte ...@@ -3,7 +3,7 @@ import filterState from 'ee/analytics/productivity_analytics/store/modules/filte
import tableState from 'ee/analytics/productivity_analytics/store/modules/table/state'; import tableState from 'ee/analytics/productivity_analytics/store/modules/table/state';
import state from 'ee/analytics/productivity_analytics/store/state'; import state from 'ee/analytics/productivity_analytics/store/state';
const resetStore = store => { const resetStore = (store) => {
const newState = { const newState = {
...state(), ...state(),
filters: filterState(), filters: filterState(),
......
...@@ -5,7 +5,7 @@ import testAction from 'helpers/vuex_action_helper'; ...@@ -5,7 +5,7 @@ import testAction from 'helpers/vuex_action_helper';
describe('Productivity analytics actions', () => { describe('Productivity analytics actions', () => {
describe('setEndpoint', () => { describe('setEndpoint', () => {
it('commits the SET_ENDPOINT mutation', done => it('commits the SET_ENDPOINT mutation', (done) =>
testAction( testAction(
actions.setEndpoint, actions.setEndpoint,
'endpoint.json', 'endpoint.json',
......
...@@ -72,7 +72,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -72,7 +72,7 @@ describe('Productivity analytics chart actions', () => {
expect(axios.get).toHaveBeenCalledWith(mockedState.endpoint, { params: globalParams }); expect(axios.get).toHaveBeenCalledWith(mockedState.endpoint, { params: globalParams });
}); });
it('dispatches success with received data', done => it('dispatches success with received data', (done) =>
testAction( testAction(
actions.fetchChartData, actions.fetchChartData,
chartKey, chartKey,
...@@ -94,7 +94,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -94,7 +94,7 @@ describe('Productivity analytics chart actions', () => {
mock.onGet(mockedState.endpoint).replyOnce(200, mockScatterplotData); mock.onGet(mockedState.endpoint).replyOnce(200, mockScatterplotData);
}); });
it('dispatches success with received data and transformedData', done => { it('dispatches success with received data and transformedData', (done) => {
testAction( testAction(
actions.fetchChartData, actions.fetchChartData,
chartKeys.scatterplot, chartKeys.scatterplot,
...@@ -122,7 +122,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -122,7 +122,7 @@ describe('Productivity analytics chart actions', () => {
mock.onGet(mockedState.endpoint).replyOnce(500); mock.onGet(mockedState.endpoint).replyOnce(500);
}); });
it('dispatches error', done => { it('dispatches error', (done) => {
testAction( testAction(
actions.fetchChartData, actions.fetchChartData,
chartKey, chartKey,
...@@ -149,7 +149,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -149,7 +149,7 @@ describe('Productivity analytics chart actions', () => {
}); });
describe('requestChartData', () => { describe('requestChartData', () => {
it('should commit the request mutation', done => { it('should commit the request mutation', (done) => {
testAction( testAction(
actions.requestChartData, actions.requestChartData,
chartKey, chartKey,
...@@ -167,7 +167,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -167,7 +167,7 @@ describe('Productivity analytics chart actions', () => {
mockedState.charts[disabledChartKey].enabled = false; mockedState.charts[disabledChartKey].enabled = false;
}); });
it('does not dispatch the requestChartData action', done => { it('does not dispatch the requestChartData action', (done) => {
testAction(actions.fetchChartData, disabledChartKey, mockedState, [], [], done); testAction(actions.fetchChartData, disabledChartKey, mockedState, [], [], done);
}); });
...@@ -180,7 +180,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -180,7 +180,7 @@ describe('Productivity analytics chart actions', () => {
}); });
describe('receiveChartDataSuccess', () => { describe('receiveChartDataSuccess', () => {
it('should commit received data', done => { it('should commit received data', (done) => {
testAction( testAction(
actions.receiveChartDataSuccess, actions.receiveChartDataSuccess,
{ chartKey, data: mockHistogramData }, { chartKey, data: mockHistogramData },
...@@ -198,7 +198,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -198,7 +198,7 @@ describe('Productivity analytics chart actions', () => {
}); });
describe('receiveChartDataError', () => { describe('receiveChartDataError', () => {
it('should commit error', done => { it('should commit error', (done) => {
const error = { response: { status: 500 } }; const error = { response: { status: 500 } };
testAction( testAction(
actions.receiveChartDataError, actions.receiveChartDataError,
...@@ -220,7 +220,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -220,7 +220,7 @@ describe('Productivity analytics chart actions', () => {
}); });
describe('fetchSecondaryChartData', () => { describe('fetchSecondaryChartData', () => {
it('dispatches fetchChartData for all chart types except for the main chart', done => { it('dispatches fetchChartData for all chart types except for the main chart', (done) => {
testAction( testAction(
actions.fetchSecondaryChartData, actions.fetchSecondaryChartData,
null, null,
...@@ -239,7 +239,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -239,7 +239,7 @@ describe('Productivity analytics chart actions', () => {
describe('setMetricType', () => { describe('setMetricType', () => {
const metricType = 'time_to_merge'; const metricType = 'time_to_merge';
it('should commit metricType', done => { it('should commit metricType', (done) => {
testAction( testAction(
actions.setMetricType, actions.setMetricType,
{ chartKey, metricType }, { chartKey, metricType },
...@@ -252,7 +252,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -252,7 +252,7 @@ describe('Productivity analytics chart actions', () => {
}); });
describe('updateSelectedItems', () => { describe('updateSelectedItems', () => {
it('should commit selected chart item and dispatch fetchSecondaryChartData and setPage', done => { it('should commit selected chart item and dispatch fetchSecondaryChartData and setPage', (done) => {
testAction( testAction(
actions.updateSelectedItems, actions.updateSelectedItems,
{ chartKey, item: 5 }, { chartKey, item: 5 },
...@@ -266,7 +266,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -266,7 +266,7 @@ describe('Productivity analytics chart actions', () => {
describe('resetMainChartSelection', () => { describe('resetMainChartSelection', () => {
describe('when skipReload is false (by default)', () => { describe('when skipReload is false (by default)', () => {
it('should commit selected chart item and dispatch fetchSecondaryChartData and setPage', done => { it('should commit selected chart item and dispatch fetchSecondaryChartData and setPage', (done) => {
testAction( testAction(
actions.resetMainChartSelection, actions.resetMainChartSelection,
null, null,
...@@ -279,7 +279,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -279,7 +279,7 @@ describe('Productivity analytics chart actions', () => {
}); });
describe('when skipReload is true', () => { describe('when skipReload is true', () => {
it('should commit selected chart and it should not dispatch any further actions', done => { it('should commit selected chart and it should not dispatch any further actions', (done) => {
testAction( testAction(
actions.resetMainChartSelection, actions.resetMainChartSelection,
true, true,
...@@ -298,7 +298,7 @@ describe('Productivity analytics chart actions', () => { ...@@ -298,7 +298,7 @@ describe('Productivity analytics chart actions', () => {
}); });
describe('setChartEnabled', () => { describe('setChartEnabled', () => {
it('should commit enabled state', done => { it('should commit enabled state', (done) => {
testAction( testAction(
actions.setChartEnabled, actions.setChartEnabled,
{ chartKey: chartKeys.scatterplot, isEnabled: false }, { chartKey: chartKeys.scatterplot, isEnabled: false },
......
...@@ -255,7 +255,7 @@ describe('Productivity analytics chart getters', () => { ...@@ -255,7 +255,7 @@ describe('Productivity analytics chart getters', () => {
expect(getters.scatterplotYaxisLabel(null, mockGetters, mockRootState)).toBe('Days'); expect(getters.scatterplotYaxisLabel(null, mockGetters, mockRootState)).toBe('Days');
}); });
it.each(metricsInHours)('returns "Hours" for the "%s" metric', metric => { it.each(metricsInHours)('returns "Hours" for the "%s" metric', (metric) => {
const mockGetters = { const mockGetters = {
getSelectedMetric: () => metric, getSelectedMetric: () => metric,
}; };
......
...@@ -30,7 +30,7 @@ describe('Productivity analytics filter actions', () => { ...@@ -30,7 +30,7 @@ describe('Productivity analytics filter actions', () => {
}); });
describe('setInitialData', () => { describe('setInitialData', () => {
it('commits the SET_INITIAL_DATA mutation and fetches data by default', done => { it('commits the SET_INITIAL_DATA mutation and fetches data by default', (done) => {
actions actions
.setInitialData(store, { data: initialData }) .setInitialData(store, { data: initialData })
.then(() => { .then(() => {
...@@ -54,7 +54,7 @@ describe('Productivity analytics filter actions', () => { ...@@ -54,7 +54,7 @@ describe('Productivity analytics filter actions', () => {
.catch(done.fail); .catch(done.fail);
}); });
it("commits the SET_INITIAL_DATA mutation and doesn't fetch data when skipFetch=true", done => it("commits the SET_INITIAL_DATA mutation and doesn't fetch data when skipFetch=true", (done) =>
testAction( testAction(
actions.setInitialData, actions.setInitialData,
{ skipFetch: true, data: initialData }, { skipFetch: true, data: initialData },
...@@ -71,7 +71,7 @@ describe('Productivity analytics filter actions', () => { ...@@ -71,7 +71,7 @@ describe('Productivity analytics filter actions', () => {
}); });
describe('setGroupNamespace', () => { describe('setGroupNamespace', () => {
it('commits the SET_GROUP_NAMESPACE mutation', done => { it('commits the SET_GROUP_NAMESPACE mutation', (done) => {
actions actions
.setGroupNamespace(store, groupNamespace) .setGroupNamespace(store, groupNamespace)
.then(() => { .then(() => {
...@@ -103,7 +103,7 @@ describe('Productivity analytics filter actions', () => { ...@@ -103,7 +103,7 @@ describe('Productivity analytics filter actions', () => {
}); });
describe('setProjectPath', () => { describe('setProjectPath', () => {
it('commits the SET_PROJECT_PATH mutation', done => { it('commits the SET_PROJECT_PATH mutation', (done) => {
actions actions
.setProjectPath(store, projectPath) .setProjectPath(store, projectPath)
.then(() => { .then(() => {
...@@ -135,7 +135,7 @@ describe('Productivity analytics filter actions', () => { ...@@ -135,7 +135,7 @@ describe('Productivity analytics filter actions', () => {
}); });
describe('setFilters', () => { describe('setFilters', () => {
it('commits the SET_FILTERS mutation', done => { it('commits the SET_FILTERS mutation', (done) => {
actions actions
.setFilters(store, { author_username: 'root' }) .setFilters(store, { author_username: 'root' })
.then(() => { .then(() => {
...@@ -167,7 +167,7 @@ describe('Productivity analytics filter actions', () => { ...@@ -167,7 +167,7 @@ describe('Productivity analytics filter actions', () => {
}); });
describe('setDateRange', () => { describe('setDateRange', () => {
it('commits the SET_DATE_RANGE mutation', done => { it('commits the SET_DATE_RANGE mutation', (done) => {
actions actions
.setDateRange(store, { startDate, endDate }) .setDateRange(store, { startDate, endDate })
.then(() => { .then(() => {
......
...@@ -104,7 +104,7 @@ describe('Productivity analytics table actions', () => { ...@@ -104,7 +104,7 @@ describe('Productivity analytics table actions', () => {
}); });
}); });
it('dispatches success with received data', done => it('dispatches success with received data', (done) =>
testAction( testAction(
actions.fetchMergeRequests, actions.fetchMergeRequests,
null, null,
...@@ -126,7 +126,7 @@ describe('Productivity analytics table actions', () => { ...@@ -126,7 +126,7 @@ describe('Productivity analytics table actions', () => {
mock.onGet(mockedState.endpoint).replyOnce(500); mock.onGet(mockedState.endpoint).replyOnce(500);
}); });
it('dispatches error', done => { it('dispatches error', (done) => {
testAction( testAction(
actions.fetchMergeRequests, actions.fetchMergeRequests,
null, null,
...@@ -146,7 +146,7 @@ describe('Productivity analytics table actions', () => { ...@@ -146,7 +146,7 @@ describe('Productivity analytics table actions', () => {
}); });
describe('requestMergeRequests', () => { describe('requestMergeRequests', () => {
it('should commit the request mutation', done => it('should commit the request mutation', (done) =>
testAction( testAction(
actions.requestMergeRequests, actions.requestMergeRequests,
null, null,
...@@ -158,7 +158,7 @@ describe('Productivity analytics table actions', () => { ...@@ -158,7 +158,7 @@ describe('Productivity analytics table actions', () => {
}); });
describe('receiveMergeRequestsSuccess', () => { describe('receiveMergeRequestsSuccess', () => {
it('should commit received data', done => it('should commit received data', (done) =>
testAction( testAction(
actions.receiveMergeRequestsSuccess, actions.receiveMergeRequestsSuccess,
{ headers, data: mockMergeRequests }, { headers, data: mockMergeRequests },
...@@ -175,7 +175,7 @@ describe('Productivity analytics table actions', () => { ...@@ -175,7 +175,7 @@ describe('Productivity analytics table actions', () => {
}); });
describe('receiveMergeRequestsError', () => { describe('receiveMergeRequestsError', () => {
it('should commit error', done => it('should commit error', (done) =>
testAction( testAction(
actions.receiveMergeRequestsError, actions.receiveMergeRequestsError,
{ response: { status: 500 } }, { response: { status: 500 } },
...@@ -187,7 +187,7 @@ describe('Productivity analytics table actions', () => { ...@@ -187,7 +187,7 @@ describe('Productivity analytics table actions', () => {
}); });
describe('setSortField', () => { describe('setSortField', () => {
it('should commit setSortField', done => it('should commit setSortField', (done) =>
testAction( testAction(
actions.setSortField, actions.setSortField,
'time_to_last_commit', 'time_to_last_commit',
...@@ -200,7 +200,7 @@ describe('Productivity analytics table actions', () => { ...@@ -200,7 +200,7 @@ describe('Productivity analytics table actions', () => {
done, done,
)); ));
it('should not dispatch setColumnMetric when metric is "days_to_merge"', done => it('should not dispatch setColumnMetric when metric is "days_to_merge"', (done) =>
testAction( testAction(
actions.setSortField, actions.setSortField,
'days_to_merge', 'days_to_merge',
...@@ -212,7 +212,7 @@ describe('Productivity analytics table actions', () => { ...@@ -212,7 +212,7 @@ describe('Productivity analytics table actions', () => {
}); });
describe('toggleSortOrder', () => { describe('toggleSortOrder', () => {
it('should commit toggleSortOrder', done => it('should commit toggleSortOrder', (done) =>
testAction( testAction(
actions.toggleSortOrder, actions.toggleSortOrder,
null, null,
...@@ -224,7 +224,7 @@ describe('Productivity analytics table actions', () => { ...@@ -224,7 +224,7 @@ describe('Productivity analytics table actions', () => {
}); });
describe('setColumnMetric', () => { describe('setColumnMetric', () => {
it('should commit setColumnMetric', done => it('should commit setColumnMetric', (done) =>
testAction( testAction(
actions.setColumnMetric, actions.setColumnMetric,
'time_to_first_comment', 'time_to_first_comment',
...@@ -236,7 +236,7 @@ describe('Productivity analytics table actions', () => { ...@@ -236,7 +236,7 @@ describe('Productivity analytics table actions', () => {
}); });
describe('setPage', () => { describe('setPage', () => {
it('should commit setPage', done => it('should commit setPage', (done) =>
testAction( testAction(
actions.setPage, actions.setPage,
2, 2,
......
...@@ -14,9 +14,9 @@ describe('Select projects dropdown component', () => { ...@@ -14,9 +14,9 @@ describe('Select projects dropdown component', () => {
let wrapper; let wrapper;
const findSelectAllProjects = () => wrapper.find('[data-testid="select-all-projects"]'); const findSelectAllProjects = () => wrapper.find('[data-testid="select-all-projects"]');
const findProjectById = id => wrapper.find(`[data-testid="select-project-${id}"]`); const findProjectById = (id) => wrapper.find(`[data-testid="select-project-${id}"]`);
const selectAllProjects = () => findSelectAllProjects().trigger('click'); const selectAllProjects = () => findSelectAllProjects().trigger('click');
const selectProjectById = id => findProjectById(id).trigger('click'); const selectProjectById = (id) => findProjectById(id).trigger('click');
const findIntersectionObserver = () => wrapper.find(GlIntersectionObserver); const findIntersectionObserver = () => wrapper.find(GlIntersectionObserver);
const findLoadingIcon = () => wrapper.find(GlLoadingIcon); const findLoadingIcon = () => wrapper.find(GlLoadingIcon);
......
...@@ -18,10 +18,10 @@ describe('Test coverage table component', () => { ...@@ -18,10 +18,10 @@ describe('Test coverage table component', () => {
const findLoadingState = () => wrapper.find('[data-testid="test-coverage-loading-state"'); const findLoadingState = () => wrapper.find('[data-testid="test-coverage-loading-state"');
const findTable = () => wrapper.find('[data-testid="test-coverage-data-table"'); const findTable = () => wrapper.find('[data-testid="test-coverage-data-table"');
const findTableRows = () => findTable().findAll('tbody tr'); const findTableRows = () => findTable().findAll('tbody tr');
const findProjectNameById = id => wrapper.find(`[data-testid="${id}-name"`); const findProjectNameById = (id) => wrapper.find(`[data-testid="${id}-name"`);
const findProjectAverageById = id => wrapper.find(`[data-testid="${id}-average"`); const findProjectAverageById = (id) => wrapper.find(`[data-testid="${id}-average"`);
const findProjectCountById = id => wrapper.find(`[data-testid="${id}-count"`); const findProjectCountById = (id) => wrapper.find(`[data-testid="${id}-count"`);
const findProjectDateById = id => wrapper.find(`[data-testid="${id}-date"`); const findProjectDateById = (id) => wrapper.find(`[data-testid="${id}-date"`);
const createComponent = ({ data = {}, mountFn = shallowMount } = {}) => { const createComponent = ({ data = {}, mountFn = shallowMount } = {}) => {
wrapper = mountFn(TestCoverageTable, { wrapper = mountFn(TestCoverageTable, {
......
...@@ -192,7 +192,7 @@ describe('buildCycleAnalyticsInitialData', () => { ...@@ -192,7 +192,7 @@ describe('buildCycleAnalyticsInitialData', () => {
}); });
it('with no search term returns the data', () => { it('with no search term returns the data', () => {
['', null].forEach(search => { ['', null].forEach((search) => {
expect(filterBySearchTerm(data, search)).toEqual(data); expect(filterBySearchTerm(data, search)).toEqual(data);
}); });
}); });
......
...@@ -42,7 +42,7 @@ describe('Api', () => { ...@@ -42,7 +42,7 @@ describe('Api', () => {
}); });
describe('ldapGroups', () => { describe('ldapGroups', () => {
it('calls callback on completion', done => { it('calls callback on completion', (done) => {
const query = 'query'; const query = 'query';
const provider = 'provider'; const provider = 'provider';
const callback = jest.fn(); const callback = jest.fn();
...@@ -55,7 +55,7 @@ describe('Api', () => { ...@@ -55,7 +55,7 @@ describe('Api', () => {
]); ]);
Api.ldapGroups(query, provider, callback) Api.ldapGroups(query, provider, callback)
.then(response => { .then((response) => {
expect(callback).toHaveBeenCalledWith(response); expect(callback).toHaveBeenCalledWith(response);
}) })
.then(done) .then(done)
...@@ -64,7 +64,7 @@ describe('Api', () => { ...@@ -64,7 +64,7 @@ describe('Api', () => {
}); });
describe('createChildEpic', () => { describe('createChildEpic', () => {
it('calls `axios.post` using params `groupId`, `parentEpicIid` and title', done => { it('calls `axios.post` using params `groupId`, `parentEpicIid` and title', (done) => {
const groupId = 'gitlab-org'; const groupId = 'gitlab-org';
const parentEpicId = 1; const parentEpicId = 1;
const title = 'Sample epic'; const title = 'Sample epic';
...@@ -89,7 +89,7 @@ describe('Api', () => { ...@@ -89,7 +89,7 @@ describe('Api', () => {
}); });
describe('groupEpics', () => { describe('groupEpics', () => {
it('calls `axios.get` using param `groupId`', done => { it('calls `axios.get` using param `groupId`', (done) => {
const groupId = 2; const groupId = 2;
const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/groups/${groupId}/epics`; const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/groups/${groupId}/epics`;
...@@ -115,7 +115,7 @@ describe('Api', () => { ...@@ -115,7 +115,7 @@ describe('Api', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('calls `axios.get` using param `search` when it is provided', done => { it('calls `axios.get` using param `search` when it is provided', (done) => {
const groupId = 2; const groupId = 2;
const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/groups/${groupId}/epics`; const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/groups/${groupId}/epics`;
...@@ -144,7 +144,7 @@ describe('Api', () => { ...@@ -144,7 +144,7 @@ describe('Api', () => {
}); });
describe('addEpicIssue', () => { describe('addEpicIssue', () => {
it('calls `axios.post` using params `groupId`, `epicIid` and `issueId`', done => { it('calls `axios.post` using params `groupId`, `epicIid` and `issueId`', (done) => {
const groupId = 2; const groupId = 2;
const mockIssue = { const mockIssue = {
id: 20, id: 20,
...@@ -170,7 +170,7 @@ describe('Api', () => { ...@@ -170,7 +170,7 @@ describe('Api', () => {
}); });
describe('removeEpicIssue', () => { describe('removeEpicIssue', () => {
it('calls `axios.delete` using params `groupId`, `epicIid` and `epicIssueId`', done => { it('calls `axios.delete` using params `groupId`, `epicIid` and `epicIssueId`', (done) => {
const groupId = 2; const groupId = 2;
const mockIssue = { const mockIssue = {
id: 20, id: 20,
...@@ -227,7 +227,7 @@ describe('Api', () => { ...@@ -227,7 +227,7 @@ describe('Api', () => {
}; };
describe('cycleAnalyticsTasksByType', () => { describe('cycleAnalyticsTasksByType', () => {
it('fetches tasks by type data', done => { it('fetches tasks by type data', (done) => {
const tasksByTypeResponse = [ const tasksByTypeResponse = [
{ {
label: { label: {
...@@ -266,7 +266,7 @@ describe('Api', () => { ...@@ -266,7 +266,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsTopLabels', () => { describe('cycleAnalyticsTopLabels', () => {
it('fetches top group level labels', done => { it('fetches top group level labels', (done) => {
const response = []; const response = [];
const labelIds = [10, 9, 8, 7]; const labelIds = [10, 9, 8, 7];
const params = { const params = {
...@@ -291,7 +291,7 @@ describe('Api', () => { ...@@ -291,7 +291,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsSummaryData', () => { describe('cycleAnalyticsSummaryData', () => {
it('fetches value stream analytics summary data', done => { it('fetches value stream analytics summary data', (done) => {
const response = [ const response = [
{ value: 0, title: 'New Issues' }, { value: 0, title: 'New Issues' },
{ value: 0, title: 'Deploys' }, { value: 0, title: 'Deploys' },
...@@ -301,7 +301,7 @@ describe('Api', () => { ...@@ -301,7 +301,7 @@ describe('Api', () => {
mock.onGet(expectedUrl).reply(httpStatus.OK, response); mock.onGet(expectedUrl).reply(httpStatus.OK, response);
Api.cycleAnalyticsSummaryData(groupId, params) Api.cycleAnalyticsSummaryData(groupId, params)
.then(responseObj => .then((responseObj) =>
expectRequestWithCorrectParameters(responseObj, { expectRequestWithCorrectParameters(responseObj, {
response, response,
params, params,
...@@ -314,7 +314,7 @@ describe('Api', () => { ...@@ -314,7 +314,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsTimeSummaryData', () => { describe('cycleAnalyticsTimeSummaryData', () => {
it('fetches value stream analytics summary data', done => { it('fetches value stream analytics summary data', (done) => {
const response = [ const response = [
{ value: '10.0', title: 'Lead time', unit: 'per day' }, { value: '10.0', title: 'Lead time', unit: 'per day' },
{ value: '2.0', title: 'Cycle Time', unit: 'per day' }, { value: '2.0', title: 'Cycle Time', unit: 'per day' },
...@@ -325,7 +325,7 @@ describe('Api', () => { ...@@ -325,7 +325,7 @@ describe('Api', () => {
mock.onGet(expectedUrl).reply(httpStatus.OK, response); mock.onGet(expectedUrl).reply(httpStatus.OK, response);
Api.cycleAnalyticsTimeSummaryData(groupId, params) Api.cycleAnalyticsTimeSummaryData(groupId, params)
.then(responseObj => .then((responseObj) =>
expectRequestWithCorrectParameters(responseObj, { expectRequestWithCorrectParameters(responseObj, {
response, response,
params, params,
...@@ -338,13 +338,13 @@ describe('Api', () => { ...@@ -338,13 +338,13 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsValueStreams', () => { describe('cycleAnalyticsValueStreams', () => {
it('fetches custom value streams', done => { it('fetches custom value streams', (done) => {
const response = [{ name: 'value stream 1', id: 1 }]; const response = [{ name: 'value stream 1', id: 1 }];
const expectedUrl = valueStreamBaseUrl({ resource: 'value_streams' }); const expectedUrl = valueStreamBaseUrl({ resource: 'value_streams' });
mock.onGet(expectedUrl).reply(httpStatus.OK, response); mock.onGet(expectedUrl).reply(httpStatus.OK, response);
Api.cycleAnalyticsValueStreams(groupId) Api.cycleAnalyticsValueStreams(groupId)
.then(responseObj => .then((responseObj) =>
expectRequestWithCorrectParameters(responseObj, { expectRequestWithCorrectParameters(responseObj, {
response, response,
expectedUrl, expectedUrl,
...@@ -356,7 +356,7 @@ describe('Api', () => { ...@@ -356,7 +356,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsCreateValueStream', () => { describe('cycleAnalyticsCreateValueStream', () => {
it('submit the custom value stream data', done => { it('submit the custom value stream data', (done) => {
const response = {}; const response = {};
const customValueStream = { name: 'cool-value-stream-stage' }; const customValueStream = { name: 'cool-value-stream-stage' };
const expectedUrl = valueStreamBaseUrl({ resource: 'value_streams' }); const expectedUrl = valueStreamBaseUrl({ resource: 'value_streams' });
...@@ -374,7 +374,7 @@ describe('Api', () => { ...@@ -374,7 +374,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsDeleteValueStream', () => { describe('cycleAnalyticsDeleteValueStream', () => {
it('delete the custom value stream', done => { it('delete the custom value stream', (done) => {
const response = {}; const response = {};
const expectedUrl = valueStreamBaseUrl({ resource: `value_streams/${valueStreamId}` }); const expectedUrl = valueStreamBaseUrl({ resource: `value_streams/${valueStreamId}` });
mock.onDelete(expectedUrl).reply(httpStatus.OK, response); mock.onDelete(expectedUrl).reply(httpStatus.OK, response);
...@@ -390,7 +390,7 @@ describe('Api', () => { ...@@ -390,7 +390,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsGroupStagesAndEvents', () => { describe('cycleAnalyticsGroupStagesAndEvents', () => {
it('fetches custom stage events and all stages', done => { it('fetches custom stage events and all stages', (done) => {
const response = { events: [], stages: [] }; const response = { events: [], stages: [] };
const params = { const params = {
group_id: groupId, group_id: groupId,
...@@ -401,7 +401,7 @@ describe('Api', () => { ...@@ -401,7 +401,7 @@ describe('Api', () => {
mock.onGet(expectedUrl).reply(httpStatus.OK, response); mock.onGet(expectedUrl).reply(httpStatus.OK, response);
Api.cycleAnalyticsGroupStagesAndEvents({ groupId, valueStreamId, params }) Api.cycleAnalyticsGroupStagesAndEvents({ groupId, valueStreamId, params })
.then(responseObj => .then((responseObj) =>
expectRequestWithCorrectParameters(responseObj, { expectRequestWithCorrectParameters(responseObj, {
response, response,
params, params,
...@@ -414,7 +414,7 @@ describe('Api', () => { ...@@ -414,7 +414,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsStageEvents', () => { describe('cycleAnalyticsStageEvents', () => {
it('fetches stage events', done => { it('fetches stage events', (done) => {
const response = { events: [] }; const response = { events: [] };
const params = { ...defaultParams }; const params = { ...defaultParams };
const expectedUrl = valueStreamBaseUrl({ const expectedUrl = valueStreamBaseUrl({
...@@ -424,7 +424,7 @@ describe('Api', () => { ...@@ -424,7 +424,7 @@ describe('Api', () => {
mock.onGet(expectedUrl).reply(httpStatus.OK, response); mock.onGet(expectedUrl).reply(httpStatus.OK, response);
Api.cycleAnalyticsStageEvents({ groupId, valueStreamId, stageId, params }) Api.cycleAnalyticsStageEvents({ groupId, valueStreamId, stageId, params })
.then(responseObj => .then((responseObj) =>
expectRequestWithCorrectParameters(responseObj, { expectRequestWithCorrectParameters(responseObj, {
response, response,
params, params,
...@@ -437,7 +437,7 @@ describe('Api', () => { ...@@ -437,7 +437,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsStageMedian', () => { describe('cycleAnalyticsStageMedian', () => {
it('fetches stage events', done => { it('fetches stage events', (done) => {
const response = { value: '5 days ago' }; const response = { value: '5 days ago' };
const params = { ...defaultParams }; const params = { ...defaultParams };
const expectedUrl = valueStreamBaseUrl({ const expectedUrl = valueStreamBaseUrl({
...@@ -447,7 +447,7 @@ describe('Api', () => { ...@@ -447,7 +447,7 @@ describe('Api', () => {
mock.onGet(expectedUrl).reply(httpStatus.OK, response); mock.onGet(expectedUrl).reply(httpStatus.OK, response);
Api.cycleAnalyticsStageMedian({ groupId, valueStreamId, stageId, params }) Api.cycleAnalyticsStageMedian({ groupId, valueStreamId, stageId, params })
.then(responseObj => .then((responseObj) =>
expectRequestWithCorrectParameters(responseObj, { expectRequestWithCorrectParameters(responseObj, {
response, response,
params, params,
...@@ -460,7 +460,7 @@ describe('Api', () => { ...@@ -460,7 +460,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsCreateStage', () => { describe('cycleAnalyticsCreateStage', () => {
it('submit the custom stage data', done => { it('submit the custom stage data', (done) => {
const response = {}; const response = {};
const customStage = { const customStage = {
name: 'cool-stage', name: 'cool-stage',
...@@ -488,7 +488,7 @@ describe('Api', () => { ...@@ -488,7 +488,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsUpdateStage', () => { describe('cycleAnalyticsUpdateStage', () => {
it('updates the stage data', done => { it('updates the stage data', (done) => {
const response = { id: stageId, custom: false, hidden: true, name: 'nice-stage' }; const response = { id: stageId, custom: false, hidden: true, name: 'nice-stage' };
const stageData = { name: 'nice-stage', hidden: true }; const stageData = { name: 'nice-stage', hidden: true };
const expectedUrl = valueStreamBaseUrl({ const expectedUrl = valueStreamBaseUrl({
...@@ -509,7 +509,7 @@ describe('Api', () => { ...@@ -509,7 +509,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsRemoveStage', () => { describe('cycleAnalyticsRemoveStage', () => {
it('deletes the specified data', done => { it('deletes the specified data', (done) => {
const response = { id: stageId, hidden: true, custom: true }; const response = { id: stageId, hidden: true, custom: true };
const expectedUrl = valueStreamBaseUrl({ const expectedUrl = valueStreamBaseUrl({
id: valueStreamId, id: valueStreamId,
...@@ -529,7 +529,7 @@ describe('Api', () => { ...@@ -529,7 +529,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsDurationChart', () => { describe('cycleAnalyticsDurationChart', () => {
it('fetches stage duration data', done => { it('fetches stage duration data', (done) => {
const response = []; const response = [];
const params = { ...defaultParams }; const params = { ...defaultParams };
const expectedUrl = valueStreamBaseUrl({ const expectedUrl = valueStreamBaseUrl({
...@@ -539,7 +539,7 @@ describe('Api', () => { ...@@ -539,7 +539,7 @@ describe('Api', () => {
mock.onGet(expectedUrl).reply(httpStatus.OK, response); mock.onGet(expectedUrl).reply(httpStatus.OK, response);
Api.cycleAnalyticsDurationChart({ groupId, valueStreamId, stageId, params }) Api.cycleAnalyticsDurationChart({ groupId, valueStreamId, stageId, params })
.then(responseObj => .then((responseObj) =>
expectRequestWithCorrectParameters(responseObj, { expectRequestWithCorrectParameters(responseObj, {
response, response,
params, params,
...@@ -552,7 +552,7 @@ describe('Api', () => { ...@@ -552,7 +552,7 @@ describe('Api', () => {
}); });
describe('cycleAnalyticsGroupLabels', () => { describe('cycleAnalyticsGroupLabels', () => {
it('fetches group level labels', done => { it('fetches group level labels', (done) => {
const response = []; const response = [];
const expectedUrl = `${dummyUrlRoot}/groups/${groupId}/-/labels.json`; const expectedUrl = `${dummyUrlRoot}/groups/${groupId}/-/labels.json`;
......
...@@ -17,7 +17,7 @@ describe('Approval Check Popover', () => { ...@@ -17,7 +17,7 @@ describe('Approval Check Popover', () => {
describe('with a documentation link', () => { describe('with a documentation link', () => {
const documentationLink = `${TEST_HOST}/documentation`; const documentationLink = `${TEST_HOST}/documentation`;
beforeEach(done => { beforeEach((done) => {
wrapper.setProps({ wrapper.setProps({
documentationLink, documentationLink,
}); });
......
...@@ -20,20 +20,20 @@ describe('Approval Check Popover', () => { ...@@ -20,20 +20,20 @@ describe('Approval Check Popover', () => {
describe('computed props', () => { describe('computed props', () => {
const securityApprovalsHelpPagePath = `${TEST_HOST}/documentation`; const securityApprovalsHelpPagePath = `${TEST_HOST}/documentation`;
beforeEach(done => { beforeEach((done) => {
wrapper.setProps({ securityApprovalsHelpPagePath }); wrapper.setProps({ securityApprovalsHelpPagePath });
Vue.nextTick(done); Vue.nextTick(done);
}); });
describe('showVulnerabilityCheckPopover', () => { describe('showVulnerabilityCheckPopover', () => {
it('return true if the rule type is "Vulnerability-Check"', done => { it('return true if the rule type is "Vulnerability-Check"', (done) => {
wrapper.setProps({ rule: { name: VULNERABILITY_CHECK_NAME } }); wrapper.setProps({ rule: { name: VULNERABILITY_CHECK_NAME } });
Vue.nextTick(() => { Vue.nextTick(() => {
expect(wrapper.vm.showVulnerabilityCheckPopover).toBe(true); expect(wrapper.vm.showVulnerabilityCheckPopover).toBe(true);
done(); done();
}); });
}); });
it('return false if the rule type is "Vulnerability-Check"', done => { it('return false if the rule type is "Vulnerability-Check"', (done) => {
wrapper.setProps({ rule: { name: 'FooRule' } }); wrapper.setProps({ rule: { name: 'FooRule' } });
Vue.nextTick(() => { Vue.nextTick(() => {
expect(wrapper.vm.showVulnerabilityCheckPopover).toBe(false); expect(wrapper.vm.showVulnerabilityCheckPopover).toBe(false);
...@@ -43,14 +43,14 @@ describe('Approval Check Popover', () => { ...@@ -43,14 +43,14 @@ describe('Approval Check Popover', () => {
}); });
describe('showLicenseCheckPopover', () => { describe('showLicenseCheckPopover', () => {
it('return true if the rule type is "License-Check"', done => { it('return true if the rule type is "License-Check"', (done) => {
wrapper.setProps({ rule: { name: LICENSE_CHECK_NAME } }); wrapper.setProps({ rule: { name: LICENSE_CHECK_NAME } });
Vue.nextTick(() => { Vue.nextTick(() => {
expect(wrapper.vm.showLicenseCheckPopover).toBe(true); expect(wrapper.vm.showLicenseCheckPopover).toBe(true);
done(); done();
}); });
}); });
it('return false if the rule type is "License-Check"', done => { it('return false if the rule type is "License-Check"', (done) => {
wrapper.setProps({ rule: { name: 'FooRule' } }); wrapper.setProps({ rule: { name: 'FooRule' } });
Vue.nextTick(() => { Vue.nextTick(() => {
expect(wrapper.vm.showLicenseCheckPopover).toBe(false); expect(wrapper.vm.showLicenseCheckPopover).toBe(false);
...@@ -60,7 +60,7 @@ describe('Approval Check Popover', () => { ...@@ -60,7 +60,7 @@ describe('Approval Check Popover', () => {
}); });
describe('approvalConfig', () => { describe('approvalConfig', () => {
it('returns "Vulberability-Check" config', done => { it('returns "Vulberability-Check" config', (done) => {
wrapper.setProps({ rule: { name: VULNERABILITY_CHECK_NAME } }); wrapper.setProps({ rule: { name: VULNERABILITY_CHECK_NAME } });
Vue.nextTick(() => { Vue.nextTick(() => {
expect(wrapper.vm.approvalRuleConfig.title).toBe( expect(wrapper.vm.approvalRuleConfig.title).toBe(
...@@ -75,7 +75,7 @@ describe('Approval Check Popover', () => { ...@@ -75,7 +75,7 @@ describe('Approval Check Popover', () => {
done(); done();
}); });
}); });
it('returns "License-Check" config', done => { it('returns "License-Check" config', (done) => {
wrapper.setProps({ rule: { name: LICENSE_CHECK_NAME } }); wrapper.setProps({ rule: { name: LICENSE_CHECK_NAME } });
Vue.nextTick(() => { Vue.nextTick(() => {
expect(wrapper.vm.approvalRuleConfig.title).toBe( expect(wrapper.vm.approvalRuleConfig.title).toBe(
...@@ -90,7 +90,7 @@ describe('Approval Check Popover', () => { ...@@ -90,7 +90,7 @@ describe('Approval Check Popover', () => {
done(); done();
}); });
}); });
it('returns an undefined config', done => { it('returns an undefined config', (done) => {
wrapper.setProps({ rule: { name: 'FooRule' } }); wrapper.setProps({ rule: { name: 'FooRule' } });
Vue.nextTick(() => { Vue.nextTick(() => {
expect(wrapper.vm.approvalConfig).toBe(undefined); expect(wrapper.vm.approvalConfig).toBe(undefined);
...@@ -100,21 +100,21 @@ describe('Approval Check Popover', () => { ...@@ -100,21 +100,21 @@ describe('Approval Check Popover', () => {
}); });
describe('documentationLink', () => { describe('documentationLink', () => {
it('returns documentation link for "License-Check"', done => { it('returns documentation link for "License-Check"', (done) => {
wrapper.setProps({ rule: { name: 'License-Check' } }); wrapper.setProps({ rule: { name: 'License-Check' } });
Vue.nextTick(() => { Vue.nextTick(() => {
expect(wrapper.vm.documentationLink).toBe(securityApprovalsHelpPagePath); expect(wrapper.vm.documentationLink).toBe(securityApprovalsHelpPagePath);
done(); done();
}); });
}); });
it('returns documentation link for "Vulnerability-Check"', done => { it('returns documentation link for "Vulnerability-Check"', (done) => {
wrapper.setProps({ rule: { name: 'Vulnerability-Check' } }); wrapper.setProps({ rule: { name: 'Vulnerability-Check' } });
Vue.nextTick(() => { Vue.nextTick(() => {
expect(wrapper.vm.documentationLink).toBe(securityApprovalsHelpPagePath); expect(wrapper.vm.documentationLink).toBe(securityApprovalsHelpPagePath);
done(); done();
}); });
}); });
it('returns empty text', done => { it('returns empty text', (done) => {
const text = ''; const text = '';
wrapper.setProps({ rule: { name: 'FooRule' } }); wrapper.setProps({ rule: { name: 'FooRule' } });
Vue.nextTick(() => { Vue.nextTick(() => {
......
...@@ -26,13 +26,13 @@ const TEST_USERS = [ ...@@ -26,13 +26,13 @@ const TEST_USERS = [
const localVue = createLocalVue(); const localVue = createLocalVue();
const waitForEvent = ($input, event) => new Promise(resolve => $input.one(event, resolve)); const waitForEvent = ($input, event) => new Promise((resolve) => $input.one(event, resolve));
const parseAvatar = element => const parseAvatar = (element) =>
element.classList.contains('identicon') ? null : element.getAttribute('src'); element.classList.contains('identicon') ? null : element.getAttribute('src');
const select2Container = () => document.querySelector('.select2-container'); const select2Container = () => document.querySelector('.select2-container');
const select2DropdownOptions = () => document.querySelectorAll('#select2-drop .user-result'); const select2DropdownOptions = () => document.querySelectorAll('#select2-drop .user-result');
const select2DropdownItems = () => const select2DropdownItems = () =>
Array.prototype.map.call(select2DropdownOptions(), element => { Array.prototype.map.call(select2DropdownOptions(), (element) => {
const isGroup = element.classList.contains('group-result'); const isGroup = element.classList.contains('group-result');
const avatar = parseAvatar(element.querySelector('.avatar')); const avatar = parseAvatar(element.querySelector('.avatar'));
...@@ -92,7 +92,7 @@ describe('Approvals ApproversSelect', () => { ...@@ -92,7 +92,7 @@ describe('Approvals ApproversSelect', () => {
expect(select2Container()).not.toBe(null); expect(select2Container()).not.toBe(null);
}); });
it('queries and displays groups and users', async done => { it('queries and displays groups and users', async (done) => {
await factory(); await factory();
const expected = TEST_GROUPS.concat(TEST_USERS) const expected = TEST_GROUPS.concat(TEST_USERS)
...@@ -114,7 +114,7 @@ describe('Approvals ApproversSelect', () => { ...@@ -114,7 +114,7 @@ describe('Approvals ApproversSelect', () => {
describe('with search term', () => { describe('with search term', () => {
const term = 'lorem'; const term = 'lorem';
beforeEach(async done => { beforeEach(async (done) => {
await factory(); await factory();
waitForEvent($input, 'select2-loaded') waitForEvent($input, 'select2-loaded')
...@@ -140,7 +140,7 @@ describe('Approvals ApproversSelect', () => { ...@@ -140,7 +140,7 @@ describe('Approvals ApproversSelect', () => {
const skipGroupIds = [7, 8]; const skipGroupIds = [7, 8];
const skipUserIds = [9, 10]; const skipUserIds = [9, 10];
beforeEach(async done => { beforeEach(async (done) => {
await factory({ await factory({
propsData: { propsData: {
skipGroupIds, skipGroupIds,
...@@ -170,7 +170,7 @@ describe('Approvals ApproversSelect', () => { ...@@ -170,7 +170,7 @@ describe('Approvals ApproversSelect', () => {
}); });
}); });
it('emits input when data changes', async done => { it('emits input when data changes', async (done) => {
await factory(); await factory();
const expectedFinal = [ const expectedFinal = [
......
...@@ -12,11 +12,11 @@ const TEST_PROTECTED_BRANCHES = [ ...@@ -12,11 +12,11 @@ const TEST_PROTECTED_BRANCHES = [
{ id: 2, name: 'development' }, { id: 2, name: 'development' },
]; ];
const TEST_BRANCHES_SELECTIONS = [TEST_DEFAULT_BRANCH, ...TEST_PROTECTED_BRANCHES]; const TEST_BRANCHES_SELECTIONS = [TEST_DEFAULT_BRANCH, ...TEST_PROTECTED_BRANCHES];
const waitForEvent = ($input, event) => new Promise(resolve => $input.one(event, resolve)); const waitForEvent = ($input, event) => new Promise((resolve) => $input.one(event, resolve));
const select2Container = () => document.querySelector('.select2-container'); const select2Container = () => document.querySelector('.select2-container');
const select2DropdownOptions = () => document.querySelectorAll('.result-name'); const select2DropdownOptions = () => document.querySelectorAll('.result-name');
const branchNames = () => TEST_BRANCHES_SELECTIONS.map(branch => branch.name); const branchNames = () => TEST_BRANCHES_SELECTIONS.map((branch) => branch.name);
const protectedBranchNames = () => TEST_PROTECTED_BRANCHES.map(branch => branch.name); const protectedBranchNames = () => TEST_PROTECTED_BRANCHES.map((branch) => branch.name);
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
...@@ -64,12 +64,12 @@ describe('Branches Select', () => { ...@@ -64,12 +64,12 @@ describe('Branches Select', () => {
expect(select2Container()).not.toBe(null); expect(select2Container()).not.toBe(null);
}); });
it('displays all the protected branches and any branch', async done => { it('displays all the protected branches and any branch', async (done) => {
await createComponent(); await createComponent();
waitForEvent($input, 'select2-loaded') waitForEvent($input, 'select2-loaded')
.then(() => { .then(() => {
const nodeList = select2DropdownOptions(); const nodeList = select2DropdownOptions();
const names = [...nodeList].map(el => el.textContent); const names = [...nodeList].map((el) => el.textContent);
expect(names).toEqual(branchNames()); expect(names).toEqual(branchNames());
}) })
...@@ -83,7 +83,7 @@ describe('Branches Select', () => { ...@@ -83,7 +83,7 @@ describe('Branches Select', () => {
return createComponent(); return createComponent();
}); });
it('fetches protected branches with search term', done => { it('fetches protected branches with search term', (done) => {
const term = 'lorem'; const term = 'lorem';
waitForEvent($input, 'select2-loaded') waitForEvent($input, 'select2-loaded')
.then(() => {}) .then(() => {})
...@@ -95,11 +95,11 @@ describe('Branches Select', () => { ...@@ -95,11 +95,11 @@ describe('Branches Select', () => {
expect(Api.projectProtectedBranches).toHaveBeenCalledWith(TEST_PROJECT_ID, term); expect(Api.projectProtectedBranches).toHaveBeenCalledWith(TEST_PROJECT_ID, term);
}); });
it('fetches protected branches with no any branch if there is search', done => { it('fetches protected branches with no any branch if there is search', (done) => {
waitForEvent($input, 'select2-loaded') waitForEvent($input, 'select2-loaded')
.then(() => { .then(() => {
const nodeList = select2DropdownOptions(); const nodeList = select2DropdownOptions();
const names = [...nodeList].map(el => el.textContent); const names = [...nodeList].map((el) => el.textContent);
expect(names).toEqual(protectedBranchNames()); expect(names).toEqual(protectedBranchNames());
}) })
...@@ -108,11 +108,11 @@ describe('Branches Select', () => { ...@@ -108,11 +108,11 @@ describe('Branches Select', () => {
search('master'); search('master');
}); });
it('fetches protected branches with any branch if search contains term "any"', done => { it('fetches protected branches with any branch if search contains term "any"', (done) => {
waitForEvent($input, 'select2-loaded') waitForEvent($input, 'select2-loaded')
.then(() => { .then(() => {
const nodeList = select2DropdownOptions(); const nodeList = select2DropdownOptions();
const names = [...nodeList].map(el => el.textContent); const names = [...nodeList].map((el) => el.textContent);
expect(names).toEqual(branchNames()); expect(names).toEqual(branchNames());
}) })
...@@ -122,7 +122,7 @@ describe('Branches Select', () => { ...@@ -122,7 +122,7 @@ describe('Branches Select', () => {
}); });
}); });
it('emits input when data changes', async done => { it('emits input when data changes', async (done) => {
await createComponent(); await createComponent();
const selectedIndex = 1; const selectedIndex = 1;
......
...@@ -55,7 +55,7 @@ describe('EE Approvals LicenseCompliance', () => { ...@@ -55,7 +55,7 @@ describe('EE Approvals LicenseCompliance', () => {
wrapper = null; wrapper = null;
}); });
const findByHrefAttribute = href => wrapper.find(`[href="${href}"]`); const findByHrefAttribute = (href) => wrapper.find(`[href="${href}"]`);
const findOpenModalButton = () => wrapper.find('button'); const findOpenModalButton = () => wrapper.find('button');
const findLoadingIndicator = () => wrapper.find('[aria-label="loading"]'); const findLoadingIndicator = () => wrapper.find('[aria-label="loading"]');
const findInformationIcon = () => wrapper.find(GlIcon); const findInformationIcon = () => wrapper.find(GlIcon);
......
...@@ -72,7 +72,7 @@ describe('EE Approvals LicenseCompliance Modal', () => { ...@@ -72,7 +72,7 @@ describe('EE Approvals LicenseCompliance Modal', () => {
wrapper = null; wrapper = null;
}); });
const findByHref = href => wrapper.find(`[href="${href}"`); const findByHref = (href) => wrapper.find(`[href="${href}"`);
const findModal = () => wrapper.find(GlModalVuex); const findModal = () => wrapper.find(GlModalVuex);
const findRuleForm = () => wrapper.find(mocks.RuleForm); const findRuleForm = () => wrapper.find(mocks.RuleForm);
const findInformationIcon = () => wrapper.find('[name="question"]'); const findInformationIcon = () => wrapper.find('[name="question"]');
......
...@@ -49,7 +49,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => { ...@@ -49,7 +49,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
}); });
const findHiddenInputs = () => const findHiddenInputs = () =>
wrapper.findAll('input[type=hidden]').wrappers.map(x => ({ wrapper.findAll('input[type=hidden]').wrappers.map((x) => ({
name: x.attributes('name'), name: x.attributes('name'),
value: x.element.value, value: x.element.value,
})); }));
...@@ -137,7 +137,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => { ...@@ -137,7 +137,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
it('renders empty users input', () => { it('renders empty users input', () => {
factory(); factory();
expect(findHiddenInputs().filter(x => x.name === INPUT_USER_IDS)).toEqual([ expect(findHiddenInputs().filter((x) => x.name === INPUT_USER_IDS)).toEqual([
{ name: INPUT_USER_IDS, value: '' }, { name: INPUT_USER_IDS, value: '' },
]); ]);
}); });
...@@ -151,7 +151,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => { ...@@ -151,7 +151,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
it('renders empty groups input', () => { it('renders empty groups input', () => {
factory(); factory();
expect(findHiddenInputs().filter(x => x.name === INPUT_GROUP_IDS)).toEqual([ expect(findHiddenInputs().filter((x) => x.name === INPUT_GROUP_IDS)).toEqual([
{ name: INPUT_GROUP_IDS, value: '' }, { name: INPUT_GROUP_IDS, value: '' },
]); ]);
}); });
...@@ -165,7 +165,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => { ...@@ -165,7 +165,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
it('does render id input', () => { it('does render id input', () => {
factory(); factory();
expect(findHiddenInputs().map(x => x.name)).toContain(INPUT_ID); expect(findHiddenInputs().map((x) => x.name)).toContain(INPUT_ID);
}); });
describe('with source', () => { describe('with source', () => {
......
...@@ -31,12 +31,12 @@ describe('EE Approvals MRRules', () => { ...@@ -31,12 +31,12 @@ describe('EE Approvals MRRules', () => {
}); });
}; };
const findHeaders = () => wrapper.findAll('thead th').wrappers.map(x => x.text()); const findHeaders = () => wrapper.findAll('thead th').wrappers.map((x) => x.text());
const findRuleName = () => wrapper.find('.js-name'); const findRuleName = () => wrapper.find('.js-name');
const findRuleIndicator = () => wrapper.find({ ref: 'indicator' }); const findRuleIndicator = () => wrapper.find({ ref: 'indicator' });
const findRuleMembers = () => wrapper.find('td.js-members').find(UserAvatarList).props('items'); const findRuleMembers = () => wrapper.find('td.js-members').find(UserAvatarList).props('items');
const findRuleControls = () => wrapper.find('td.js-controls').find(RuleControls); const findRuleControls = () => wrapper.find('td.js-controls').find(RuleControls);
const callTargetBranchHandler = MutationObserverSpy => { const callTargetBranchHandler = (MutationObserverSpy) => {
const onTargetBranchMutationHandler = MutationObserverSpy.mock.calls[0][0]; const onTargetBranchMutationHandler = MutationObserverSpy.mock.calls[0][0];
return onTargetBranchMutationHandler(); return onTargetBranchMutationHandler();
}; };
...@@ -45,7 +45,7 @@ describe('EE Approvals MRRules', () => { ...@@ -45,7 +45,7 @@ describe('EE Approvals MRRules', () => {
OriginalMutationObserver = global.MutationObserver; OriginalMutationObserver = global.MutationObserver;
global.MutationObserver = jest global.MutationObserver = jest
.fn() .fn()
.mockImplementation(args => new OriginalMutationObserver(args)); .mockImplementation((args) => new OriginalMutationObserver(args));
store = createStoreOptions(MREditModule()); store = createStoreOptions(MREditModule());
store.modules.approvals.state = { store.modules.approvals.state = {
...@@ -157,7 +157,7 @@ describe('EE Approvals MRRules', () => { ...@@ -157,7 +157,7 @@ describe('EE Approvals MRRules', () => {
factory(); factory();
const anyApproverCount = store.modules.approvals.state.rules.filter( const anyApproverCount = store.modules.approvals.state.rules.filter(
rule => rule.ruleType === 'any_approver', (rule) => rule.ruleType === 'any_approver',
); );
expect(anyApproverCount).toHaveLength(1); expect(anyApproverCount).toHaveLength(1);
......
...@@ -16,7 +16,7 @@ localVue.use(Vuex); ...@@ -16,7 +16,7 @@ localVue.use(Vuex);
const findCell = (tr, name) => tr.find(`td.js-${name}`); const findCell = (tr, name) => tr.find(`td.js-${name}`);
const getRowData = tr => { const getRowData = (tr) => {
const name = findCell(tr, 'name'); const name = findCell(tr, 'name');
const members = findCell(tr, 'members'); const members = findCell(tr, 'members');
const approvalsRequired = findCell(tr, 'approvals-required'); const approvalsRequired = findCell(tr, 'approvals-required');
...@@ -61,7 +61,7 @@ describe('Approvals ProjectRules', () => { ...@@ -61,7 +61,7 @@ describe('Approvals ProjectRules', () => {
const data = rows.wrappers.map(getRowData); const data = rows.wrappers.map(getRowData);
expect(data).toEqual( expect(data).toEqual(
TEST_RULES.filter((rule, index) => index !== 0).map(rule => ({ TEST_RULES.filter((rule, index) => index !== 0).map((rule) => ({
name: rule.name, name: rule.name,
approvers: rule.approvers, approvers: rule.approvers,
approvalsRequired: rule.approvalsRequired, approvalsRequired: rule.approvalsRequired,
...@@ -74,7 +74,7 @@ describe('Approvals ProjectRules', () => { ...@@ -74,7 +74,7 @@ describe('Approvals ProjectRules', () => {
it('should always have any_approver rule', () => { it('should always have any_approver rule', () => {
factory(); factory();
const hasAnyApproverRule = store.modules.approvals.state.rules.some( const hasAnyApproverRule = store.modules.approvals.state.rules.some(
rule => rule.ruleType === 'any_approver', (rule) => rule.ruleType === 'any_approver',
); );
expect(hasAnyApproverRule).toBe(true); expect(hasAnyApproverRule).toBe(true);
...@@ -133,7 +133,7 @@ describe('Approvals ProjectRules', () => { ...@@ -133,7 +133,7 @@ describe('Approvals ProjectRules', () => {
describe.each([true, false])( describe.each([true, false])(
'when the approvalSuggestions feature flag is %p', 'when the approvalSuggestions feature flag is %p',
approvalSuggestions => { (approvalSuggestions) => {
beforeEach(() => { beforeEach(() => {
const rules = createProjectRules(); const rules = createProjectRules();
rules[0].name = 'Vulnerability-Check'; rules[0].name = 'Vulnerability-Check';
......
...@@ -41,7 +41,7 @@ const nameTakenError = { ...@@ -41,7 +41,7 @@ const nameTakenError = {
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
const addType = type => x => Object.assign(x, { type }); const addType = (type) => (x) => Object.assign(x, { type });
describe('EE Approvals RuleForm', () => { describe('EE Approvals RuleForm', () => {
let wrapper; let wrapper;
...@@ -88,7 +88,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -88,7 +88,7 @@ describe('EE Approvals RuleForm', () => {
beforeEach(() => { beforeEach(() => {
store = createStoreOptions(projectSettingsModule(), { projectId: TEST_PROJECT_ID }); store = createStoreOptions(projectSettingsModule(), { projectId: TEST_PROJECT_ID });
['postRule', 'putRule', 'deleteRule', 'putFallbackRule'].forEach(actionName => { ['postRule', 'putRule', 'deleteRule', 'putFallbackRule'].forEach((actionName) => {
jest.spyOn(store.modules.approvals.actions, actionName).mockImplementation(() => {}); jest.spyOn(store.modules.approvals.actions, actionName).mockImplementation(() => {});
}); });
...@@ -114,7 +114,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -114,7 +114,7 @@ describe('EE Approvals RuleForm', () => {
}); });
it('on load, it populates initial protected branch ids', () => { it('on load, it populates initial protected branch ids', () => {
expect(wrapper.vm.branches).toEqual(TEST_PROTECTED_BRANCHES.map(x => x.id)); expect(wrapper.vm.branches).toEqual(TEST_PROTECTED_BRANCHES.map((x) => x.id));
}); });
}); });
...@@ -128,14 +128,14 @@ describe('EE Approvals RuleForm', () => { ...@@ -128,14 +128,14 @@ describe('EE Approvals RuleForm', () => {
it('at first, shows no validation', () => { it('at first, shows no validation', () => {
const inputs = findValidationsWithBranch(); const inputs = findValidationsWithBranch();
const invalidInputs = inputs.filter(x => !x.isValid); const invalidInputs = inputs.filter((x) => !x.isValid);
const feedbacks = inputs.map(x => x.feedback); const feedbacks = inputs.map((x) => x.feedback);
expect(invalidInputs.length).toBe(0); expect(invalidInputs.length).toBe(0);
expect(feedbacks.every(str => !str.length)).toBe(true); expect(feedbacks.every((str) => !str.length)).toBe(true);
}); });
it('on submit, shows branches validation', done => { it('on submit, shows branches validation', (done) => {
wrapper.vm.branches = ['3']; wrapper.vm.branches = ['3'];
wrapper.vm.submit(); wrapper.vm.submit();
...@@ -154,9 +154,9 @@ describe('EE Approvals RuleForm', () => { ...@@ -154,9 +154,9 @@ describe('EE Approvals RuleForm', () => {
it('on submit with data, posts rule', () => { it('on submit with data, posts rule', () => {
const users = [1, 2]; const users = [1, 2];
const groups = [2, 3]; const groups = [2, 3];
const userRecords = users.map(id => ({ id, type: TYPE_USER })); const userRecords = users.map((id) => ({ id, type: TYPE_USER }));
const groupRecords = groups.map(id => ({ id, type: TYPE_GROUP })); const groupRecords = groups.map((id) => ({ id, type: TYPE_GROUP }));
const branches = TEST_PROTECTED_BRANCHES.map(x => x.id); const branches = TEST_PROTECTED_BRANCHES.map((x) => x.id);
const expected = { const expected = {
id: null, id: null,
name: 'Lorem', name: 'Lorem',
...@@ -188,11 +188,11 @@ describe('EE Approvals RuleForm', () => { ...@@ -188,11 +188,11 @@ describe('EE Approvals RuleForm', () => {
it('at first, shows no validation', () => { it('at first, shows no validation', () => {
const inputs = findValidations(); const inputs = findValidations();
const invalidInputs = inputs.filter(x => !x.isValid); const invalidInputs = inputs.filter((x) => !x.isValid);
const feedbacks = inputs.map(x => x.feedback); const feedbacks = inputs.map((x) => x.feedback);
expect(invalidInputs.length).toBe(0); expect(invalidInputs.length).toBe(0);
expect(feedbacks.every(str => !str.length)).toBe(true); expect(feedbacks.every((str) => !str.length)).toBe(true);
}); });
it('on submit, does not dispatch action', () => { it('on submit, does not dispatch action', () => {
...@@ -201,7 +201,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -201,7 +201,7 @@ describe('EE Approvals RuleForm', () => {
expect(actions.postRule).not.toHaveBeenCalled(); expect(actions.postRule).not.toHaveBeenCalled();
}); });
it('on submit, shows name validation', done => { it('on submit, shows name validation', (done) => {
findNameInput().setValue(''); findNameInput().setValue('');
wrapper.vm.submit(); wrapper.vm.submit();
...@@ -218,7 +218,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -218,7 +218,7 @@ describe('EE Approvals RuleForm', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('on submit, shows approvalsRequired validation', done => { it('on submit, shows approvalsRequired validation', (done) => {
findApprovalsRequiredInput().setValue(-1); findApprovalsRequiredInput().setValue(-1);
wrapper.vm.submit(); wrapper.vm.submit();
...@@ -235,7 +235,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -235,7 +235,7 @@ describe('EE Approvals RuleForm', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('on submit, shows approvers validation', done => { it('on submit, shows approvers validation', (done) => {
wrapper.vm.approvers = []; wrapper.vm.approvers = [];
wrapper.vm.submit(); wrapper.vm.submit();
...@@ -254,9 +254,9 @@ describe('EE Approvals RuleForm', () => { ...@@ -254,9 +254,9 @@ describe('EE Approvals RuleForm', () => {
describe('with valid data', () => { describe('with valid data', () => {
const users = [1, 2]; const users = [1, 2];
const groups = [2, 3]; const groups = [2, 3];
const userRecords = users.map(id => ({ id, type: TYPE_USER })); const userRecords = users.map((id) => ({ id, type: TYPE_USER }));
const groupRecords = groups.map(id => ({ id, type: TYPE_GROUP })); const groupRecords = groups.map((id) => ({ id, type: TYPE_GROUP }));
const branches = TEST_PROTECTED_BRANCHES.map(x => x.id); const branches = TEST_PROTECTED_BRANCHES.map((x) => x.id);
const expected = { const expected = {
id: null, id: null,
name: 'Lorem', name: 'Lorem',
...@@ -333,10 +333,10 @@ describe('EE Approvals RuleForm', () => { ...@@ -333,10 +333,10 @@ describe('EE Approvals RuleForm', () => {
}); });
describe('with valid data', () => { describe('with valid data', () => {
const userRecords = TEST_RULE.users.map(x => ({ ...x, type: TYPE_USER })); const userRecords = TEST_RULE.users.map((x) => ({ ...x, type: TYPE_USER }));
const groupRecords = TEST_RULE.groups.map(x => ({ ...x, type: TYPE_GROUP })); const groupRecords = TEST_RULE.groups.map((x) => ({ ...x, type: TYPE_GROUP }));
const users = userRecords.map(x => x.id); const users = userRecords.map((x) => x.id);
const groups = groupRecords.map(x => x.id); const groups = groupRecords.map((x) => x.id);
const expected = { const expected = {
...TEST_RULE, ...TEST_RULE,
...@@ -392,7 +392,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -392,7 +392,7 @@ describe('EE Approvals RuleForm', () => {
}); });
describe('with empty name and empty approvers', () => { describe('with empty name and empty approvers', () => {
beforeEach(done => { beforeEach((done) => {
wrapper.vm.submit(); wrapper.vm.submit();
localVue.nextTick(done); localVue.nextTick(done);
}); });
...@@ -408,12 +408,12 @@ describe('EE Approvals RuleForm', () => { ...@@ -408,12 +408,12 @@ describe('EE Approvals RuleForm', () => {
}); });
it('does not show any validation errors', () => { it('does not show any validation errors', () => {
expect(findValidations().every(x => x.isValid)).toBe(true); expect(findValidations().every((x) => x.isValid)).toBe(true);
}); });
}); });
describe('with name and empty approvers', () => { describe('with name and empty approvers', () => {
beforeEach(done => { beforeEach((done) => {
wrapper.vm.name = 'Lorem'; wrapper.vm.name = 'Lorem';
wrapper.vm.submit(); wrapper.vm.submit();
...@@ -430,7 +430,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -430,7 +430,7 @@ describe('EE Approvals RuleForm', () => {
}); });
describe('with empty name and approvers', () => { describe('with empty name and approvers', () => {
beforeEach(done => { beforeEach((done) => {
wrapper.vm.approvers = TEST_APPROVERS; wrapper.vm.approvers = TEST_APPROVERS;
wrapper.vm.submit(); wrapper.vm.submit();
...@@ -447,7 +447,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -447,7 +447,7 @@ describe('EE Approvals RuleForm', () => {
}); });
describe('with name and approvers', () => { describe('with name and approvers', () => {
beforeEach(done => { beforeEach((done) => {
wrapper.vm.approvers = [{ id: 7, type: TYPE_USER }]; wrapper.vm.approvers = [{ id: 7, type: TYPE_USER }];
wrapper.vm.name = 'Lorem'; wrapper.vm.name = 'Lorem';
wrapper.vm.submit(); wrapper.vm.submit();
...@@ -498,7 +498,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -498,7 +498,7 @@ describe('EE Approvals RuleForm', () => {
describe('and hidden groups removed', () => { describe('and hidden groups removed', () => {
beforeEach(() => { beforeEach(() => {
wrapper.vm.approvers = wrapper.vm.approvers.filter(x => x.type !== TYPE_HIDDEN_GROUPS); wrapper.vm.approvers = wrapper.vm.approvers.filter((x) => x.type !== TYPE_HIDDEN_GROUPS);
}); });
it('on submit, removes hidden groups', () => { it('on submit, removes hidden groups', () => {
...@@ -529,7 +529,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -529,7 +529,7 @@ describe('EE Approvals RuleForm', () => {
expect( expect(
findApproversList() findApproversList()
.props('value') .props('value')
.every(x => x.type !== TYPE_HIDDEN_GROUPS), .every((x) => x.type !== TYPE_HIDDEN_GROUPS),
).toBe(true); ).toBe(true);
}); });
}); });
...@@ -656,7 +656,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -656,7 +656,7 @@ describe('EE Approvals RuleForm', () => {
expect.objectContaining({ expect.objectContaining({
name: expectedNameSubmitted, name: expectedNameSubmitted,
approvalsRequired: TEST_APPROVALS_REQUIRED, approvalsRequired: TEST_APPROVALS_REQUIRED,
users: TEST_APPROVERS.map(x => x.id), users: TEST_APPROVERS.map((x) => x.id),
}), }),
); );
}); });
...@@ -712,7 +712,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -712,7 +712,7 @@ describe('EE Approvals RuleForm', () => {
}); });
describe('with name and approvers', () => { describe('with name and approvers', () => {
beforeEach(done => { beforeEach((done) => {
wrapper.vm.name = inputName; wrapper.vm.name = inputName;
wrapper.vm.approvers = TEST_APPROVERS; wrapper.vm.approvers = TEST_APPROVERS;
wrapper.vm.submit(); wrapper.vm.submit();
...@@ -727,7 +727,7 @@ describe('EE Approvals RuleForm', () => { ...@@ -727,7 +727,7 @@ describe('EE Approvals RuleForm', () => {
id: TEST_RULE.id, id: TEST_RULE.id,
name: expectedNameSubmitted, name: expectedNameSubmitted,
approvalsRequired: TEST_APPROVALS_REQUIRED, approvalsRequired: TEST_APPROVALS_REQUIRED,
users: TEST_APPROVERS.map(x => x.id), users: TEST_APPROVERS.map((x) => x.id),
}), }),
); );
}); });
......
...@@ -4,7 +4,7 @@ import testAction from 'helpers/vuex_action_helper'; ...@@ -4,7 +4,7 @@ import testAction from 'helpers/vuex_action_helper';
describe('Approval MR edit module actions', () => { describe('Approval MR edit module actions', () => {
describe('setTargetBranch', () => { describe('setTargetBranch', () => {
it('commits SET_TARGET_BRANCH', done => { it('commits SET_TARGET_BRANCH', (done) => {
testAction( testAction(
actions.setTargetBranch, actions.setTargetBranch,
'master', 'master',
...@@ -17,7 +17,7 @@ describe('Approval MR edit module actions', () => { ...@@ -17,7 +17,7 @@ describe('Approval MR edit module actions', () => {
}); });
describe('undoRulesChange', () => { describe('undoRulesChange', () => {
it('commits UNDO_RULES', done => { it('commits UNDO_RULES', (done) => {
testAction(actions.undoRulesChange, null, {}, [{ type: types.UNDO_RULES }], [], done); testAction(actions.undoRulesChange, null, {}, [{ type: types.UNDO_RULES }], [], done);
}); });
}); });
......
...@@ -101,7 +101,7 @@ describe('EE approvals project settings module actions', () => { ...@@ -101,7 +101,7 @@ describe('EE approvals project settings module actions', () => {
{ type: 'receiveRulesSuccess', payload: mapApprovalSettingsResponse(data) }, { type: 'receiveRulesSuccess', payload: mapApprovalSettingsResponse(data) },
], ],
() => { () => {
expect(mock.history.get.map(x => x.url)).toEqual([TEST_SETTINGS_PATH]); expect(mock.history.get.map((x) => x.url)).toEqual([TEST_SETTINGS_PATH]);
}, },
); );
}); });
......
...@@ -19,7 +19,7 @@ describe('AuditEventsApp', () => { ...@@ -19,7 +19,7 @@ describe('AuditEventsApp', () => {
let store; let store;
const events = [{ foo: 'bar' }]; const events = [{ foo: 'bar' }];
const filterTokenOptions = AVAILABLE_TOKEN_TYPES.map(type => ({ type })); const filterTokenOptions = AVAILABLE_TOKEN_TYPES.map((type) => ({ type }));
const exportUrl = 'http://example.com/audit_log_reports.csv'; const exportUrl = 'http://example.com/audit_log_reports.csv';
const initComponent = (props = {}) => { const initComponent = (props = {}) => {
......
...@@ -12,7 +12,7 @@ describe('SortingField component', () => { ...@@ -12,7 +12,7 @@ describe('SortingField component', () => {
}; };
const getCheckedOptions = () => const getCheckedOptions = () =>
wrapper.findAll(GlDropdownItem).filter(item => item.props().isChecked); wrapper.findAll(GlDropdownItem).filter((item) => item.props().isChecked);
beforeEach(() => { beforeEach(() => {
initComponent(); initComponent();
......
...@@ -19,7 +19,7 @@ describe('AuditFilterToken', () => { ...@@ -19,7 +19,7 @@ describe('AuditFilterToken', () => {
]; ];
const findFilteredSearchToken = () => wrapper.find('#filtered-search-token'); const findFilteredSearchToken = () => wrapper.find('#filtered-search-token');
const findLoadingIcon = type => wrapper.find(type).find(GlLoadingIcon); const findLoadingIcon = (type) => wrapper.find(type).find(GlLoadingIcon);
const tokenMethods = { const tokenMethods = {
fetchItem: jest.fn().mockResolvedValue(item), fetchItem: jest.fn().mockResolvedValue(item),
......
import subscriptionState from 'ee/billings/subscriptions/store/state'; import subscriptionState from 'ee/billings/subscriptions/store/state';
export const resetStore = store => { export const resetStore = (store) => {
const newState = { const newState = {
subscription: subscriptionState(), subscription: subscriptionState(),
}; };
......
...@@ -55,7 +55,7 @@ describe('Subscription Seats', () => { ...@@ -55,7 +55,7 @@ describe('Subscription Seats', () => {
const findPageHeading = () => wrapper.find('[data-testid="heading"]'); const findPageHeading = () => wrapper.find('[data-testid="heading"]');
const findPagination = () => wrapper.find(GlPagination); const findPagination = () => wrapper.find(GlPagination);
const serializeUser = rowWrapper => { const serializeUser = (rowWrapper) => {
const avatarLink = rowWrapper.find(GlAvatarLink); const avatarLink = rowWrapper.find(GlAvatarLink);
const avatarLabeled = rowWrapper.find(GlAvatarLabeled); const avatarLabeled = rowWrapper.find(GlAvatarLabeled);
...@@ -72,7 +72,7 @@ describe('Subscription Seats', () => { ...@@ -72,7 +72,7 @@ describe('Subscription Seats', () => {
}; };
}; };
const serializeTableRow = rowWrapper => { const serializeTableRow = (rowWrapper) => {
const emailWrapper = rowWrapper.find('[data-testid="email"]'); const emailWrapper = rowWrapper.find('[data-testid="email"]');
return { return {
...@@ -82,7 +82,7 @@ describe('Subscription Seats', () => { ...@@ -82,7 +82,7 @@ describe('Subscription Seats', () => {
}; };
}; };
const findSerializedTable = tableWrapper => { const findSerializedTable = (tableWrapper) => {
return tableWrapper.findAll('tbody tr').wrappers.map(serializeTableRow); return tableWrapper.findAll('tbody tr').wrappers.map(serializeTableRow);
}; };
...@@ -141,7 +141,7 @@ describe('Subscription Seats', () => { ...@@ -141,7 +141,7 @@ describe('Subscription Seats', () => {
describe('pagination', () => { describe('pagination', () => {
it.each([null, NaN, undefined, 'a string', false])( it.each([null, NaN, undefined, 'a string', false])(
'will not render given %s for currentPage', 'will not render given %s for currentPage',
value => { (value) => {
wrapper = createComponent({ wrapper = createComponent({
initialState: { initialState: {
page: value, page: value,
......
...@@ -100,7 +100,7 @@ describe('seats actions', () => { ...@@ -100,7 +100,7 @@ describe('seats actions', () => {
}); });
describe('receiveBillableMembersListError', () => { describe('receiveBillableMembersListError', () => {
it('should commit the error mutation', done => { it('should commit the error mutation', (done) => {
testAction( testAction(
actions.receiveBillableMembersListError, actions.receiveBillableMembersListError,
{}, {},
......
...@@ -76,7 +76,7 @@ describe('subscription table row', () => { ...@@ -76,7 +76,7 @@ describe('subscription table row', () => {
const findContentCells = () => wrapper.findAll('[data-testid="content-cell"]'); const findContentCells = () => wrapper.findAll('[data-testid="content-cell"]');
const findHeaderIcon = () => findHeaderCell().find(GlIcon); const findHeaderIcon = () => findHeaderCell().find(GlIcon);
const findColumnLabelAndTitle = columnWrapper => { const findColumnLabelAndTitle = (columnWrapper) => {
const label = columnWrapper.find('[data-testid="property-label"]'); const label = columnWrapper.find('[data-testid="property-label"]');
const value = columnWrapper.find('[data-testid="property-value"]'); const value = columnWrapper.find('[data-testid="property-value"]');
...@@ -111,7 +111,7 @@ describe('subscription table row', () => { ...@@ -111,7 +111,7 @@ describe('subscription table row', () => {
}); });
it(`should not render a hidden column`, () => { it(`should not render a hidden column`, () => {
const hiddenColIdx = COLUMNS.find(c => !c.display); const hiddenColIdx = COLUMNS.find((c) => !c.display);
const hiddenCol = findContentCells().at(hiddenColIdx); const hiddenCol = findContentCells().at(hiddenColIdx);
expect(hiddenCol).toBe(undefined); expect(hiddenCol).toBe(undefined);
......
...@@ -39,7 +39,7 @@ describe('EE billings subscription module mutations', () => { ...@@ -39,7 +39,7 @@ describe('EE billings subscription module mutations', () => {
}); });
describe(types.RECEIVE_SUBSCRIPTION_SUCCESS, () => { describe(types.RECEIVE_SUBSCRIPTION_SUCCESS, () => {
const getColumnValues = columns => const getColumnValues = (columns) =>
columns.reduce( columns.reduce(
(acc, { id, value }) => ({ (acc, { id, value }) => ({
...acc, ...acc,
...@@ -47,7 +47,7 @@ describe('EE billings subscription module mutations', () => { ...@@ -47,7 +47,7 @@ describe('EE billings subscription module mutations', () => {
}), }),
{}, {},
); );
const getStateTableValues = key => const getStateTableValues = (key) =>
state.tables[key].rows.map(({ columns }) => getColumnValues(columns)); state.tables[key].rows.map(({ columns }) => getColumnValues(columns));
describe.each` describe.each`
......
...@@ -31,7 +31,7 @@ const assignee2 = { ...@@ -31,7 +31,7 @@ const assignee2 = {
}; };
describe('Assignee select component', () => { describe('Assignee select component', () => {
beforeEach(done => { beforeEach((done) => {
setFixtures('<div class="test-container"></div>'); setFixtures('<div class="test-container"></div>');
boardsStore.create(); boardsStore.create();
...@@ -55,7 +55,7 @@ describe('Assignee select component', () => { ...@@ -55,7 +55,7 @@ describe('Assignee select component', () => {
}); });
describe('canEdit', () => { describe('canEdit', () => {
it('hides Edit button', done => { it('hides Edit button', (done) => {
vm.canEdit = false; vm.canEdit = false;
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.$el.querySelector('.edit-link')).toBeFalsy(); expect(vm.$el.querySelector('.edit-link')).toBeFalsy();
...@@ -63,7 +63,7 @@ describe('Assignee select component', () => { ...@@ -63,7 +63,7 @@ describe('Assignee select component', () => {
}); });
}); });
it('shows Edit button if true', done => { it('shows Edit button if true', (done) => {
vm.canEdit = true; vm.canEdit = true;
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.$el.querySelector('.edit-link')).toBeTruthy(); expect(vm.$el.querySelector('.edit-link')).toBeTruthy();
...@@ -77,7 +77,7 @@ describe('Assignee select component', () => { ...@@ -77,7 +77,7 @@ describe('Assignee select component', () => {
expect(selectedText()).toContain('Any assignee'); expect(selectedText()).toContain('Any assignee');
}); });
it('shows selected assignee', done => { it('shows selected assignee', (done) => {
vm.selected = assignee; vm.selected = assignee;
Vue.nextTick(() => { Vue.nextTick(() => {
expect(selectedText()).toContain('first assignee'); expect(selectedText()).toContain('first assignee');
...@@ -97,7 +97,7 @@ describe('Assignee select component', () => { ...@@ -97,7 +97,7 @@ describe('Assignee select component', () => {
mock.restore(); mock.restore();
}); });
it('sets assignee', done => { it('sets assignee', (done) => {
vm.$el.querySelector('.edit-link').click(); vm.$el.querySelector('.edit-link').click();
jest.runOnlyPendingTimers(); jest.runOnlyPendingTimers();
......
...@@ -75,13 +75,13 @@ describe('Board List Header Component', () => { ...@@ -75,13 +75,13 @@ describe('Board List Header Component', () => {
const hasSettings = [ListType.assignee, ListType.milestone, ListType.label]; const hasSettings = [ListType.assignee, ListType.milestone, ListType.label];
const hasNoSettings = [ListType.backlog, ListType.closed]; const hasNoSettings = [ListType.backlog, ListType.closed];
it.each(hasSettings)('does render for List Type `%s`', listType => { it.each(hasSettings)('does render for List Type `%s`', (listType) => {
createComponent({ listType }); createComponent({ listType });
expect(findSettingsButton().exists()).toBe(true); expect(findSettingsButton().exists()).toBe(true);
}); });
it.each(hasNoSettings)('does not render for List Type `%s`', listType => { it.each(hasNoSettings)('does not render for List Type `%s`', (listType) => {
createComponent({ listType }); createComponent({ listType });
expect(findSettingsButton().exists()).toBe(false); expect(findSettingsButton().exists()).toBe(false);
...@@ -90,7 +90,7 @@ describe('Board List Header Component', () => { ...@@ -90,7 +90,7 @@ describe('Board List Header Component', () => {
it('has a test for each list type', () => { it('has a test for each list type', () => {
createComponent(); createComponent();
Object.values(ListType).forEach(value => { Object.values(ListType).forEach((value) => {
expect([...hasSettings, ...hasNoSettings]).toContain(value); expect([...hasSettings, ...hasNoSettings]).toContain(value);
}); });
}); });
......
...@@ -84,20 +84,20 @@ describe('Board List Header Component', () => { ...@@ -84,20 +84,20 @@ describe('Board List Header Component', () => {
const hasSettings = [ListType.assignee, ListType.milestone, ListType.label]; const hasSettings = [ListType.assignee, ListType.milestone, ListType.label];
const hasNoSettings = [ListType.backlog, ListType.closed]; const hasNoSettings = [ListType.backlog, ListType.closed];
it.each(hasSettings)('does render for List Type `%s`', listType => { it.each(hasSettings)('does render for List Type `%s`', (listType) => {
createComponent({ listType }); createComponent({ listType });
expect(findSettingsButton().exists()).toBe(true); expect(findSettingsButton().exists()).toBe(true);
}); });
it.each(hasNoSettings)('does not render for List Type `%s`', listType => { it.each(hasNoSettings)('does not render for List Type `%s`', (listType) => {
createComponent({ listType }); createComponent({ listType });
expect(findSettingsButton().exists()).toBe(false); expect(findSettingsButton().exists()).toBe(false);
}); });
it('has a test for each list type', () => { it('has a test for each list type', () => {
Object.values(ListType).forEach(value => { Object.values(ListType).forEach((value) => {
expect([...hasSettings, ...hasNoSettings]).toContain(value); expect([...hasSettings, ...hasNoSettings]).toContain(value);
}); });
}); });
......
...@@ -51,7 +51,7 @@ describe('BoardListSelector', () => { ...@@ -51,7 +51,7 @@ describe('BoardListSelector', () => {
describe('methods', () => { describe('methods', () => {
describe('loadList', () => { describe('loadList', () => {
it('calls axios.get and sets response to store.state.assignees', done => { it('calls axios.get and sets response to store.state.assignees', (done) => {
mock.onGet(dummyEndpoint).reply(200, mockAssigneesList); mock.onGet(dummyEndpoint).reply(200, mockAssigneesList);
boardsStore.state.assignees = []; boardsStore.state.assignees = [];
...@@ -64,7 +64,7 @@ describe('BoardListSelector', () => { ...@@ -64,7 +64,7 @@ describe('BoardListSelector', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('does not call axios.get when store.state.assignees is not empty', done => { it('does not call axios.get when store.state.assignees is not empty', (done) => {
jest.spyOn(axios, 'get').mockReturnValue(Promise.resolve()); jest.spyOn(axios, 'get').mockReturnValue(Promise.resolve());
boardsStore.state.assignees = mockAssigneesList; boardsStore.state.assignees = mockAssigneesList;
...@@ -76,7 +76,7 @@ describe('BoardListSelector', () => { ...@@ -76,7 +76,7 @@ describe('BoardListSelector', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('calls axios.get and shows Flash error when request fails', done => { it('calls axios.get and shows Flash error when request fails', (done) => {
mock.onGet(dummyEndpoint).replyOnce(500, {}); mock.onGet(dummyEndpoint).replyOnce(500, {});
boardsStore.state.assignees = []; boardsStore.state.assignees = [];
......
...@@ -4,7 +4,7 @@ describe('BoardList Component', () => { ...@@ -4,7 +4,7 @@ describe('BoardList Component', () => {
let mock; let mock;
let component; let component;
beforeEach(done => { beforeEach((done) => {
const listIssueProps = { const listIssueProps = {
project: { project: {
path: '/test', path: '/test',
......
...@@ -11,7 +11,7 @@ describe('BoardSettingsListType', () => { ...@@ -11,7 +11,7 @@ describe('BoardSettingsListType', () => {
}, },
assignee: { webUrl: 'https://gitlab.com/root', name: 'root', username: 'root' }, assignee: { webUrl: 'https://gitlab.com/root', name: 'root', username: 'root' },
}; };
const createComponent = props => { const createComponent = (props) => {
wrapper = shallowMount(BoardSettingsListTypes, { wrapper = shallowMount(BoardSettingsListTypes, {
propsData: { ...props, activeList }, propsData: { ...props, activeList },
}); });
......
...@@ -62,7 +62,7 @@ describe('BoardSettingsWipLimit', () => { ...@@ -62,7 +62,7 @@ describe('BoardSettingsWipLimit', () => {
}); });
}; };
const triggerBlur = type => { const triggerBlur = (type) => {
if (type === 'blur') { if (type === 'blur') {
findInput().vm.$emit('blur'); findInput().vm.$emit('blur');
} }
......
...@@ -12,7 +12,7 @@ localVue.use(Vuex); ...@@ -12,7 +12,7 @@ localVue.use(Vuex);
describe('EpicLane', () => { describe('EpicLane', () => {
let wrapper; let wrapper;
const findByTestId = testId => wrapper.find(`[data-testid="${testId}"]`); const findByTestId = (testId) => wrapper.find(`[data-testid="${testId}"]`);
const updateBoardEpicUserPreferencesSpy = jest.fn(); const updateBoardEpicUserPreferencesSpy = jest.fn();
......
...@@ -8,7 +8,7 @@ const TEST_EPIC_ID = 8; ...@@ -8,7 +8,7 @@ const TEST_EPIC_ID = 8;
const TEST_EPIC = { id: 'gid://gitlab/Epic/1', title: 'Test epic' }; const TEST_EPIC = { id: 'gid://gitlab/Epic/1', title: 'Test epic' };
const TEST_ISSUE = { id: 'gid://gitlab/Issue/1', iid: 9, epic: null, referencePath: 'h/b#2' }; const TEST_ISSUE = { id: 'gid://gitlab/Issue/1', iid: 9, epic: null, referencePath: 'h/b#2' };
jest.mock('~/lib/utils/common_utils', () => ({ debounceByAnimationFrame: callback => callback })); jest.mock('~/lib/utils/common_utils', () => ({ debounceByAnimationFrame: (callback) => callback }));
describe('ee/boards/components/sidebar/board_sidebar_epic_select.vue', () => { describe('ee/boards/components/sidebar/board_sidebar_epic_select.vue', () => {
let wrapper; let wrapper;
......
...@@ -15,7 +15,7 @@ describe('BoardSidebarTimeTracker', () => { ...@@ -15,7 +15,7 @@ describe('BoardSidebarTimeTracker', () => {
let wrapper; let wrapper;
let store; let store;
const createComponent = options => { const createComponent = (options) => {
wrapper = shallowMount(BoardSidebarTimeTracker, { wrapper = shallowMount(BoardSidebarTimeTracker, {
store, store,
...options, ...options,
...@@ -42,7 +42,7 @@ describe('BoardSidebarTimeTracker', () => { ...@@ -42,7 +42,7 @@ describe('BoardSidebarTimeTracker', () => {
it.each([[true], [false]])( it.each([[true], [false]])(
'renders IssuableTimeTracker with correct spent and estimated time (timeTrackingLimitToHours=%s)', 'renders IssuableTimeTracker with correct spent and estimated time (timeTrackingLimitToHours=%s)',
timeTrackingLimitToHours => { (timeTrackingLimitToHours) => {
createComponent({ provide: { timeTrackingLimitToHours } }); createComponent({ provide: { timeTrackingLimitToHours } });
expect(wrapper.find(IssuableTimeTracker).props()).toEqual({ expect(wrapper.find(IssuableTimeTracker).props()).toEqual({
......
...@@ -8,7 +8,7 @@ describe('WeightSelect', () => { ...@@ -8,7 +8,7 @@ describe('WeightSelect', () => {
const editButton = () => wrapper.find(GlButton); const editButton = () => wrapper.find(GlButton);
const valueContainer = () => wrapper.find('.value'); const valueContainer = () => wrapper.find('.value');
const weightDropdown = () => wrapper.find(GlDropdown); const weightDropdown = () => wrapper.find(GlDropdown);
const getWeightItemAtIndex = index => weightDropdown().findAll(GlDropdownItem).at(index); const getWeightItemAtIndex = (index) => weightDropdown().findAll(GlDropdownItem).at(index);
const defaultProps = { const defaultProps = {
weights: ['Any', 'None', 0, 1, 2, 3], weights: ['Any', 'None', 0, 1, 2, 3],
board: { board: {
......
...@@ -33,7 +33,7 @@ const milestone2 = { ...@@ -33,7 +33,7 @@ const milestone2 = {
}; };
describe('Milestone select component', () => { describe('Milestone select component', () => {
beforeEach(done => { beforeEach((done) => {
setFixtures('<div class="test-container"></div>'); setFixtures('<div class="test-container"></div>');
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
...@@ -53,7 +53,7 @@ describe('Milestone select component', () => { ...@@ -53,7 +53,7 @@ describe('Milestone select component', () => {
}); });
describe('canEdit', () => { describe('canEdit', () => {
it('hides Edit button', done => { it('hides Edit button', (done) => {
vm.canEdit = false; vm.canEdit = false;
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.$el.querySelector('.edit-link')).toBeFalsy(); expect(vm.$el.querySelector('.edit-link')).toBeFalsy();
...@@ -61,7 +61,7 @@ describe('Milestone select component', () => { ...@@ -61,7 +61,7 @@ describe('Milestone select component', () => {
}); });
}); });
it('shows Edit button if true', done => { it('shows Edit button if true', (done) => {
vm.canEdit = true; vm.canEdit = true;
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.$el.querySelector('.edit-link')).toBeTruthy(); expect(vm.$el.querySelector('.edit-link')).toBeTruthy();
...@@ -75,7 +75,7 @@ describe('Milestone select component', () => { ...@@ -75,7 +75,7 @@ describe('Milestone select component', () => {
expect(selectedText()).toContain('Any milestone'); expect(selectedText()).toContain('Any milestone');
}); });
it('shows No milestone', done => { it('shows No milestone', (done) => {
vm.board.milestone_id = 0; vm.board.milestone_id = 0;
Vue.nextTick(() => { Vue.nextTick(() => {
expect(selectedText()).toContain('No milestone'); expect(selectedText()).toContain('No milestone');
...@@ -83,7 +83,7 @@ describe('Milestone select component', () => { ...@@ -83,7 +83,7 @@ describe('Milestone select component', () => {
}); });
}); });
it('shows selected milestone title', done => { it('shows selected milestone title', (done) => {
vm.board.milestone_id = 20; vm.board.milestone_id = 20;
vm.board.milestone = { vm.board.milestone = {
id: 20, id: 20,
...@@ -100,7 +100,7 @@ describe('Milestone select component', () => { ...@@ -100,7 +100,7 @@ describe('Milestone select component', () => {
jest.spyOn(Api, 'projectMilestones').mockResolvedValue({ data: [milestone, milestone2] }); jest.spyOn(Api, 'projectMilestones').mockResolvedValue({ data: [milestone, milestone2] });
}); });
it('sets Any milestone', async done => { it('sets Any milestone', async (done) => {
vm.board.milestone_id = 0; vm.board.milestone_id = 0;
vm.$el.querySelector('.edit-link').click(); vm.$el.querySelector('.edit-link').click();
...@@ -118,7 +118,7 @@ describe('Milestone select component', () => { ...@@ -118,7 +118,7 @@ describe('Milestone select component', () => {
}); });
}); });
it('sets No milestone', done => { it('sets No milestone', (done) => {
vm.$el.querySelector('.edit-link').click(); vm.$el.querySelector('.edit-link').click();
jest.runOnlyPendingTimers(); jest.runOnlyPendingTimers();
...@@ -134,7 +134,7 @@ describe('Milestone select component', () => { ...@@ -134,7 +134,7 @@ describe('Milestone select component', () => {
}); });
}); });
it('sets milestone', done => { it('sets milestone', (done) => {
vm.$el.querySelector('.edit-link').click(); vm.$el.querySelector('.edit-link').click();
jest.runOnlyPendingTimers(); jest.runOnlyPendingTimers();
......
...@@ -36,7 +36,7 @@ export const mockLists = [ ...@@ -36,7 +36,7 @@ export const mockLists = [
}, },
]; ];
export const mockListsWithModel = mockLists.map(listMock => export const mockListsWithModel = mockLists.map((listMock) =>
Vue.observable(new List({ ...listMock, doNotFetchIssues: true })), Vue.observable(new List({ ...listMock, doNotFetchIssues: true })),
); );
......
...@@ -12,7 +12,7 @@ import * as commonUtils from '~/lib/utils/common_utils'; ...@@ -12,7 +12,7 @@ import * as commonUtils from '~/lib/utils/common_utils';
import { mergeUrlParams, removeParams } from '~/lib/utils/url_utility'; import { mergeUrlParams, removeParams } from '~/lib/utils/url_utility';
import { mockLists, mockIssue, mockIssue2, mockEpic, rawIssue } from '../mock_data'; import { mockLists, mockIssue, mockIssue2, mockEpic, rawIssue } from '../mock_data';
const expectNotImplemented = action => { const expectNotImplemented = (action) => {
it('is not implemented', () => { it('is not implemented', () => {
expect(action).toThrow(new Error('Not implemented!')); expect(action).toThrow(new Error('Not implemented!'));
}); });
...@@ -101,7 +101,7 @@ describe('setFilters', () => { ...@@ -101,7 +101,7 @@ describe('setFilters', () => {
}); });
describe('performSearch', () => { describe('performSearch', () => {
it('should dispatch setFilters action', done => { it('should dispatch setFilters action', (done) => {
testAction(actions.performSearch, {}, {}, [], [{ type: 'setFilters', payload: {} }], done); testAction(actions.performSearch, {}, {}, [], [{ type: 'setFilters', payload: {} }], done);
}); });
...@@ -156,7 +156,7 @@ describe('fetchEpicsSwimlanes', () => { ...@@ -156,7 +156,7 @@ describe('fetchEpicsSwimlanes', () => {
}, },
}; };
it('should commit mutation RECEIVE_EPICS_SUCCESS on success without lists', done => { it('should commit mutation RECEIVE_EPICS_SUCCESS on success without lists', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(queryResponse); jest.spyOn(gqlClient, 'query').mockResolvedValue(queryResponse);
testAction( testAction(
...@@ -174,7 +174,7 @@ describe('fetchEpicsSwimlanes', () => { ...@@ -174,7 +174,7 @@ describe('fetchEpicsSwimlanes', () => {
); );
}); });
it('should commit mutation RECEIVE_SWIMLANES_FAILURE on failure', done => { it('should commit mutation RECEIVE_SWIMLANES_FAILURE on failure', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(Promise.reject()); jest.spyOn(gqlClient, 'query').mockResolvedValue(Promise.reject());
testAction( testAction(
...@@ -187,7 +187,7 @@ describe('fetchEpicsSwimlanes', () => { ...@@ -187,7 +187,7 @@ describe('fetchEpicsSwimlanes', () => {
); );
}); });
it('should dispatch fetchEpicsSwimlanes when page info hasNextPage', done => { it('should dispatch fetchEpicsSwimlanes when page info hasNextPage', (done) => {
const queryResponseWithNextPage = { const queryResponseWithNextPage = {
data: { data: {
group: { group: {
...@@ -240,7 +240,7 @@ describe('updateBoardEpicUserPreferences', () => { ...@@ -240,7 +240,7 @@ describe('updateBoardEpicUserPreferences', () => {
}, },
}); });
it('should send mutation', done => { it('should send mutation', (done) => {
const collapsed = true; const collapsed = true;
jest.spyOn(gqlClient, 'mutate').mockResolvedValue(queryResponse(collapsed)); jest.spyOn(gqlClient, 'mutate').mockResolvedValue(queryResponse(collapsed));
...@@ -266,7 +266,7 @@ describe('updateBoardEpicUserPreferences', () => { ...@@ -266,7 +266,7 @@ describe('updateBoardEpicUserPreferences', () => {
}); });
describe('setShowLabels', () => { describe('setShowLabels', () => {
it('should commit mutation SET_SHOW_LABELS', done => { it('should commit mutation SET_SHOW_LABELS', (done) => {
const state = { const state = {
isShowingLabels: true, isShowingLabels: true,
}; };
...@@ -417,7 +417,7 @@ describe('fetchIssuesForEpic', () => { ...@@ -417,7 +417,7 @@ describe('fetchIssuesForEpic', () => {
const formattedIssues = formatListIssues(queryResponse.data.group.board.lists); const formattedIssues = formatListIssues(queryResponse.data.group.board.lists);
it('should commit mutations REQUEST_ISSUES_FOR_EPIC and RECEIVE_ISSUES_FOR_LIST_SUCCESS on success', done => { it('should commit mutations REQUEST_ISSUES_FOR_EPIC and RECEIVE_ISSUES_FOR_LIST_SUCCESS on success', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(queryResponse); jest.spyOn(gqlClient, 'query').mockResolvedValue(queryResponse);
testAction( testAction(
...@@ -433,7 +433,7 @@ describe('fetchIssuesForEpic', () => { ...@@ -433,7 +433,7 @@ describe('fetchIssuesForEpic', () => {
); );
}); });
it('should commit mutations REQUEST_ISSUES_FOR_EPIC and RECEIVE_ISSUES_FOR_LIST_FAILURE on failure', done => { it('should commit mutations REQUEST_ISSUES_FOR_EPIC and RECEIVE_ISSUES_FOR_LIST_FAILURE on failure', (done) => {
jest.spyOn(gqlClient, 'query').mockResolvedValue(Promise.reject()); jest.spyOn(gqlClient, 'query').mockResolvedValue(Promise.reject());
testAction( testAction(
...@@ -571,7 +571,7 @@ describe('setActiveIssueWeight', () => { ...@@ -571,7 +571,7 @@ describe('setActiveIssueWeight', () => {
projectPath: 'h/b', projectPath: 'h/b',
}; };
it('should commit weight after setting the issue', done => { it('should commit weight after setting the issue', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({ jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: { data: {
issueSetWeight: { issueSetWeight: {
...@@ -636,7 +636,7 @@ describe('moveIssue', () => { ...@@ -636,7 +636,7 @@ describe('moveIssue', () => {
issues, issues,
}; };
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_SUCCESS mutation when successful', done => { it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_SUCCESS mutation when successful', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({ jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: { data: {
issueMoveList: { issueMoveList: {
...@@ -677,7 +677,7 @@ describe('moveIssue', () => { ...@@ -677,7 +677,7 @@ describe('moveIssue', () => {
); );
}); });
it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_FAILURE mutation when unsuccessful', done => { it('should commit MOVE_ISSUE mutation and MOVE_ISSUE_FAILURE mutation when unsuccessful', (done) => {
jest.spyOn(gqlClient, 'mutate').mockResolvedValue({ jest.spyOn(gqlClient, 'mutate').mockResolvedValue({
data: { data: {
issueMoveList: { issueMoveList: {
......
...@@ -99,7 +99,7 @@ describe('BoardsStoreEE', () => { ...@@ -99,7 +99,7 @@ describe('BoardsStoreEE', () => {
beforeEach(() => { beforeEach(() => {
requestSpy = jest.fn(); requestSpy = jest.fn();
axiosMock.onPut(dummyEndpoint).replyOnce(config => requestSpy(config)); axiosMock.onPut(dummyEndpoint).replyOnce((config) => requestSpy(config));
}); });
it('makes a request to update the weight', () => { it('makes a request to update the weight', () => {
......
import mutations from 'ee/boards/stores/mutations'; import mutations from 'ee/boards/stores/mutations';
import { mockIssue, mockIssue2, mockEpics, mockEpic, mockLists } from '../mock_data'; import { mockIssue, mockIssue2, mockEpics, mockEpic, mockLists } from '../mock_data';
const expectNotImplemented = action => { const expectNotImplemented = (action) => {
it('is not implemented', () => { it('is not implemented', () => {
expect(action).toThrow(new Error('Not implemented!')); expect(action).toThrow(new Error('Not implemented!'));
}); });
......
...@@ -24,7 +24,7 @@ describe('burndown_chart', () => { ...@@ -24,7 +24,7 @@ describe('burndown_chart', () => {
const findIssuesButton = () => wrapper.find({ ref: 'totalIssuesButton' }); const findIssuesButton = () => wrapper.find({ ref: 'totalIssuesButton' });
const findWeightButton = () => wrapper.find({ ref: 'totalWeightButton' }); const findWeightButton = () => wrapper.find({ ref: 'totalWeightButton' });
const findActiveButtons = () => const findActiveButtons = () =>
wrapper.findAll(GlButton).filter(button => button.attributes().category === 'primary'); wrapper.findAll(GlButton).filter((button) => button.attributes().category === 'primary');
const findBurndownChart = () => wrapper.find(BurndownChart); const findBurndownChart = () => wrapper.find(BurndownChart);
const findBurnupChart = () => wrapper.find(BurnupChart); const findBurnupChart = () => wrapper.find(BurnupChart);
const findOldBurndownChartButton = () => wrapper.find({ ref: 'oldBurndown' }); const findOldBurndownChartButton = () => wrapper.find({ ref: 'oldBurndown' });
......
...@@ -28,19 +28,19 @@ describe('Codequality report actions', () => { ...@@ -28,19 +28,19 @@ describe('Codequality report actions', () => {
}); });
describe('setPage', () => { describe('setPage', () => {
it('sets the page number', done => { it('sets the page number', (done) => {
testAction(actions.setPage, 12, state, [{ type: types.SET_PAGE, payload: 12 }], [], done); testAction(actions.setPage, 12, state, [{ type: types.SET_PAGE, payload: 12 }], [], done);
}); });
}); });
describe('requestReport', () => { describe('requestReport', () => {
it('sets the loading flag', done => { it('sets the loading flag', (done) => {
testAction(actions.requestReport, null, state, [{ type: types.REQUEST_REPORT }], [], done); testAction(actions.requestReport, null, state, [{ type: types.REQUEST_REPORT }], [], done);
}); });
}); });
describe('receiveReportSuccess', () => { describe('receiveReportSuccess', () => {
it('parses the list of issues from the report', done => { it('parses the list of issues from the report', (done) => {
testAction( testAction(
actions.receiveReportSuccess, actions.receiveReportSuccess,
unparsedIssues, unparsedIssues,
...@@ -53,7 +53,7 @@ describe('Codequality report actions', () => { ...@@ -53,7 +53,7 @@ describe('Codequality report actions', () => {
}); });
describe('receiveReportError', () => { describe('receiveReportError', () => {
it('accepts a report error', done => { it('accepts a report error', (done) => {
testAction( testAction(
actions.receiveReportError, actions.receiveReportError,
'error', 'error',
...@@ -70,7 +70,7 @@ describe('Codequality report actions', () => { ...@@ -70,7 +70,7 @@ describe('Codequality report actions', () => {
mock.onGet(endpoint).replyOnce(200, unparsedIssues); mock.onGet(endpoint).replyOnce(200, unparsedIssues);
}); });
it('fetches the report', done => { it('fetches the report', (done) => {
testAction( testAction(
actions.fetchReport, actions.fetchReport,
null, null,
...@@ -81,7 +81,7 @@ describe('Codequality report actions', () => { ...@@ -81,7 +81,7 @@ describe('Codequality report actions', () => {
); );
}); });
it('shows a flash message when there is an error', done => { it('shows a flash message when there is an error', (done) => {
testAction( testAction(
actions.fetchReport, actions.fetchReport,
'error', 'error',
...@@ -97,7 +97,7 @@ describe('Codequality report actions', () => { ...@@ -97,7 +97,7 @@ describe('Codequality report actions', () => {
); );
}); });
it('shows an error when blob path is missing', done => { it('shows an error when blob path is missing', (done) => {
testAction( testAction(
actions.fetchReport, actions.fetchReport,
null, null,
......
...@@ -8,7 +8,7 @@ const IMAGE_PATH = 'empty.svg'; ...@@ -8,7 +8,7 @@ const IMAGE_PATH = 'empty.svg';
describe('EmptyState component', () => { describe('EmptyState component', () => {
let wrapper; let wrapper;
const emptyStateProp = prop => wrapper.find(GlEmptyState).props(prop); const emptyStateProp = (prop) => wrapper.find(GlEmptyState).props(prop);
const createComponent = (props = {}) => { const createComponent = (props = {}) => {
return shallowMount(EmptyState, { return shallowMount(EmptyState, {
......
...@@ -8,7 +8,7 @@ describe('BranchDetails component', () => { ...@@ -8,7 +8,7 @@ describe('BranchDetails component', () => {
// The truncate component adds left-to-right marks into the text that we have to remove // The truncate component adds left-to-right marks into the text that we have to remove
const getText = () => wrapper.text().replace(/\u200E/gi, ''); const getText = () => wrapper.text().replace(/\u200E/gi, '');
const linkExists = testId => wrapper.find(`[data-testid="${testId}"]`).exists(); const linkExists = (testId) => wrapper.find(`[data-testid="${testId}"]`).exists();
const createComponent = ({ sourceUri = '', targetUri = '' } = {}) => { const createComponent = ({ sourceUri = '', targetUri = '' } = {}) => {
return mount(BranchDetails, { return mount(BranchDetails, {
......
...@@ -53,7 +53,7 @@ describe('MergeRequestsGrid component', () => { ...@@ -53,7 +53,7 @@ describe('MergeRequestsGrid component', () => {
const mergeRequest = createMergeRequests({ count: 1 }); const mergeRequest = createMergeRequests({ count: 1 });
wrapper = createComponent(mergeRequest); wrapper = createComponent(mergeRequest);
findStatuses().wrappers.forEach(status => { findStatuses().wrappers.forEach((status) => {
const { type, data } = status.props('status'); const { type, data } = status.props('status');
switch (type) { switch (type) {
......
...@@ -9,7 +9,7 @@ describe('MergeRequest component', () => { ...@@ -9,7 +9,7 @@ describe('MergeRequest component', () => {
const findAuthorAvatarLink = () => wrapper.find('.issuable-authored').find(GlAvatarLink); const findAuthorAvatarLink = () => wrapper.find('.issuable-authored').find(GlAvatarLink);
const createComponent = mergeRequest => { const createComponent = (mergeRequest) => {
return shallowMount(MergeRequest, { return shallowMount(MergeRequest, {
propsData: { propsData: {
mergeRequest, mergeRequest,
......
...@@ -7,7 +7,7 @@ import Pipeline from 'ee/compliance_dashboard/components/merge_requests/statuses ...@@ -7,7 +7,7 @@ import Pipeline from 'ee/compliance_dashboard/components/merge_requests/statuses
describe('Status component', () => { describe('Status component', () => {
let wrapper; let wrapper;
const createComponent = status => { const createComponent = (status) => {
return shallowMount(Status, { return shallowMount(Status, {
propsData: { status }, propsData: { status },
}); });
...@@ -34,7 +34,7 @@ describe('Status component', () => { ...@@ -34,7 +34,7 @@ describe('Status component', () => {
${'approval'} | ${null} ${'approval'} | ${null}
${'approval'} | ${''} ${'approval'} | ${''}
${'pipeline'} | ${{}} ${'pipeline'} | ${{}}
`('does not render if given the status $value', status => { `('does not render if given the status $value', (status) => {
wrapper = createComponent(status); wrapper = createComponent(status);
checkStatusComponentExists(status, false); checkStatusComponentExists(status, false);
...@@ -44,7 +44,7 @@ describe('Status component', () => { ...@@ -44,7 +44,7 @@ describe('Status component', () => {
type | data type | data
${'approval'} | ${'success'} ${'approval'} | ${'success'}
${'pipeline'} | ${{ group: 'warning' }} ${'pipeline'} | ${{ group: 'warning' }}
`('renders if given the status $value', status => { `('renders if given the status $value', (status) => {
wrapper = createComponent(status); wrapper = createComponent(status);
checkStatusComponentExists(status, true); checkStatusComponentExists(status, true);
......
...@@ -9,7 +9,7 @@ describe('ApprovalStatus component', () => { ...@@ -9,7 +9,7 @@ describe('ApprovalStatus component', () => {
const findIcon = () => wrapper.find('.ci-icon'); const findIcon = () => wrapper.find('.ci-icon');
const findLink = () => wrapper.find(GlLink); const findLink = () => wrapper.find(GlLink);
const createComponent = status => { const createComponent = (status) => {
return shallowMount(Approval, { return shallowMount(Approval, {
propsData: { status }, propsData: { status },
stubs: { stubs: {
......
...@@ -10,7 +10,7 @@ describe('Pipeline component', () => { ...@@ -10,7 +10,7 @@ describe('Pipeline component', () => {
const findCiIcon = () => wrapper.find('.ci-icon'); const findCiIcon = () => wrapper.find('.ci-icon');
const findCiLink = () => wrapper.find(GlLink); const findCiLink = () => wrapper.find(GlLink);
const createComponent = status => { const createComponent = (status) => {
return shallowMount(Pipeline, { return shallowMount(Pipeline, {
propsData: { status }, propsData: { status },
stubs: { stubs: {
......
...@@ -5,7 +5,7 @@ import GridColumnHeading from 'ee/compliance_dashboard/components/shared/grid_co ...@@ -5,7 +5,7 @@ import GridColumnHeading from 'ee/compliance_dashboard/components/shared/grid_co
describe('GridColumnHeading component', () => { describe('GridColumnHeading component', () => {
let wrapper; let wrapper;
const createComponent = heading => { const createComponent = (heading) => {
return shallowMount(GridColumnHeading, { return shallowMount(GridColumnHeading, {
propsData: { heading }, propsData: { heading },
}); });
......
...@@ -7,7 +7,7 @@ describe('Pagination component', () => { ...@@ -7,7 +7,7 @@ describe('Pagination component', () => {
let wrapper; let wrapper;
const findGlPagination = () => wrapper.find(GlPagination); const findGlPagination = () => wrapper.find(GlPagination);
const getLink = query => wrapper.find(query).element.getAttribute('href'); const getLink = (query) => wrapper.find(query).element.getAttribute('href');
const findPrevPageLink = () => getLink('a.prev-page-item'); const findPrevPageLink = () => getLink('a.prev-page-item');
const findNextPageLink = () => getLink('a.next-page-item'); const findNextPageLink = () => getLink('a.next-page-item');
......
const createUser = id => ({ const createUser = (id) => ({
id, id,
avatar_url: `https://${id}`, avatar_url: `https://${id}`,
name: `User ${id}`, name: `User ${id}`,
...@@ -16,7 +16,7 @@ export const mergedAt = () => { ...@@ -16,7 +16,7 @@ export const mergedAt = () => {
return date.toISOString(); return date.toISOString();
}; };
export const createPipelineStatus = status => ({ export const createPipelineStatus = (status) => ({
details_path: '/h5bp/html5-boilerplate/pipelines/58', details_path: '/h5bp/html5-boilerplate/pipelines/58',
favicon: '', favicon: '',
group: status, group: status,
...@@ -45,7 +45,7 @@ export const createMergeRequest = ({ id = 1, props } = {}) => { ...@@ -45,7 +45,7 @@ export const createMergeRequest = ({ id = 1, props } = {}) => {
return { ...mergeRequest, ...props }; return { ...mergeRequest, ...props };
}; };
export const createApprovers = count => { export const createApprovers = (count) => {
return Array(count) return Array(count)
.fill(null) .fill(null)
.map((_, id) => createUser(id)); .map((_, id) => createUser(id));
......
...@@ -27,7 +27,7 @@ describe('DependenciesApp component', () => { ...@@ -27,7 +27,7 @@ describe('DependenciesApp component', () => {
store = createStore(); store = createStore();
jest.spyOn(store, 'dispatch').mockImplementation(); jest.spyOn(store, 'dispatch').mockImplementation();
const stubs = Object.keys(DependenciesApp.components).filter(name => name !== 'GlSprintf'); const stubs = Object.keys(DependenciesApp.components).filter((name) => name !== 'GlSprintf');
wrapper = mount(DependenciesApp, { wrapper = mount(DependenciesApp, {
store, store,
...@@ -107,7 +107,7 @@ describe('DependenciesApp component', () => { ...@@ -107,7 +107,7 @@ describe('DependenciesApp component', () => {
expect(componentWrapper.props()).toEqual(expect.objectContaining(props)); expect(componentWrapper.props()).toEqual(expect.objectContaining(props));
}; };
const expectComponentPropsToMatchSnapshot = Component => { const expectComponentPropsToMatchSnapshot = (Component) => {
const componentWrapper = wrapper.find(Component); const componentWrapper = wrapper.find(Component);
expect(componentWrapper.props()).toMatchSnapshot(); expect(componentWrapper.props()).toMatchSnapshot();
}; };
......
...@@ -41,7 +41,7 @@ describe('DependenciesActions component', () => { ...@@ -41,7 +41,7 @@ describe('DependenciesActions component', () => {
it('dispatches the right setSortField action on clicking each item in the dropdown', () => { it('dispatches the right setSortField action on clicking each item in the dropdown', () => {
const dropdownItems = wrapper.findAll(GlDropdownItem).wrappers; const dropdownItems = wrapper.findAll(GlDropdownItem).wrappers;
dropdownItems.forEach(item => { dropdownItems.forEach((item) => {
// trigger() does not work on stubbed/shallow mounted components // trigger() does not work on stubbed/shallow mounted components
// https://github.com/vuejs/vue-test-utils/issues/919 // https://github.com/vuejs/vue-test-utils/issues/919
item.vm.$emit('click'); item.vm.$emit('click');
...@@ -49,7 +49,7 @@ describe('DependenciesActions component', () => { ...@@ -49,7 +49,7 @@ describe('DependenciesActions component', () => {
expect(store.dispatch.mock.calls).toEqual( expect(store.dispatch.mock.calls).toEqual(
expect.arrayContaining( expect.arrayContaining(
Object.keys(SORT_FIELDS).map(field => [`${namespace}/setSortField`, field]), Object.keys(SORT_FIELDS).map((field) => [`${namespace}/setSortField`, field]),
), ),
); );
}); });
......
...@@ -5,7 +5,7 @@ import DependenciesLicenseLinks from 'ee/dependencies/components/dependency_lice ...@@ -5,7 +5,7 @@ import DependenciesLicenseLinks from 'ee/dependencies/components/dependency_lice
describe('DependencyLicenseLinks component', () => { describe('DependencyLicenseLinks component', () => {
// data helpers // data helpers
const createLicenses = n => [...Array(n).keys()].map(i => ({ name: `license ${i + 1}` })); const createLicenses = (n) => [...Array(n).keys()].map((i) => ({ name: `license ${i + 1}` }));
const addUrls = (licenses, numLicensesWithUrls = Infinity) => const addUrls = (licenses, numLicensesWithUrls = Infinity) =>
licenses.map((ls, i) => ({ licenses.map((ls, i) => ({
...ls, ...ls,
...@@ -26,7 +26,7 @@ describe('DependencyLicenseLinks component', () => { ...@@ -26,7 +26,7 @@ describe('DependencyLicenseLinks component', () => {
}; };
// query helpers // query helpers
const jsTestClassSelector = name => `.js-license-links-${name}`; const jsTestClassSelector = (name) => `.js-license-links-${name}`;
const findLicensesList = () => wrapper.find(jsTestClassSelector('license-list')); const findLicensesList = () => wrapper.find(jsTestClassSelector('license-list'));
const findLicenseListItems = () => wrapper.findAll(jsTestClassSelector('license-list-item')); const findLicenseListItems = () => wrapper.findAll(jsTestClassSelector('license-list-item'));
const findModal = () => wrapper.find(jsTestClassSelector('modal')); const findModal = () => wrapper.find(jsTestClassSelector('modal'));
...@@ -46,7 +46,7 @@ describe('DependencyLicenseLinks component', () => { ...@@ -46,7 +46,7 @@ describe('DependencyLicenseLinks component', () => {
expect(intersperseInstance.attributes('lastseparator')).toBe(' and '); expect(intersperseInstance.attributes('lastseparator')).toBe(' and ');
}); });
it.each([3, 5, 8, 13])('limits the number of visible licenses to 2', numLicenses => { it.each([3, 5, 8, 13])('limits the number of visible licenses to 2', (numLicenses) => {
factory({ numLicenses }); factory({ numLicenses });
expect(findLicenseListItems()).toHaveLength(2); expect(findLicenseListItems()).toHaveLength(2);
...@@ -76,7 +76,7 @@ describe('DependencyLicenseLinks component', () => { ...@@ -76,7 +76,7 @@ describe('DependencyLicenseLinks component', () => {
const links = wrapper.findAll(GlLink); const links = wrapper.findAll(GlLink);
links.wrappers.forEach(link => { links.wrappers.forEach((link) => {
expect(link.attributes('target')).toBe('_blank'); expect(link.attributes('target')).toBe('_blank');
}); });
}); });
......
...@@ -43,7 +43,7 @@ describe('DependencyListJobFailedAlert component', () => { ...@@ -43,7 +43,7 @@ describe('DependencyListJobFailedAlert component', () => {
it.each([undefined, null, ''])( it.each([undefined, null, ''])(
'does not include a button if "jobPath" is given but empty', 'does not include a button if "jobPath" is given but empty',
jobPath => { (jobPath) => {
factory({ propsData: { jobPath } }); factory({ propsData: { jobPath } });
expect(wrapper.find(GlAlert).props()).toMatchObject(NO_BUTTON_PROPS); expect(wrapper.find(GlAlert).props()).toMatchObject(NO_BUTTON_PROPS);
......
...@@ -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(() => {
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment