Commit 6e183d50 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 29 spec files: 1 of 10

Mandatory not to break master. Automatically created with prettier.
parent 281fda79
...@@ -11,15 +11,6 @@ doc/api/graphql/reference/gitlab_schema.graphql ...@@ -11,15 +11,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.md *.md
# temporarly ignored in order to migrate to prettier@2 more efficiently and iteratively: # temporarly ignored in order to migrate to prettier@2 more efficiently and iteratively:
ee/spec/frontend/api_spec.js
ee/spec/frontend/admin/dev_ops_report
ee/spec/frontend/analytics/code_review_analytics/components
ee/spec/frontend/analytics/contribution_analytics/components
ee/spec/frontend/analytics/cycle_analytics
ee/spec/frontend/analytics/merge_request_analytics
ee/spec/frontend/analytics/productivity_analytics
ee/spec/frontend/analytics/repository_analytics/components
ee/spec/frontend/analytics/shared/components
ee/spec/frontend/approvals/components ee/spec/frontend/approvals/components
ee/spec/frontend/audit_events/components ee/spec/frontend/audit_events/components
ee/spec/frontend/billings/subscriptions/components ee/spec/frontend/billings/subscriptions/components
......
...@@ -34,10 +34,7 @@ describe('DevopsAdoptionTable', () => { ...@@ -34,10 +34,7 @@ describe('DevopsAdoptionTable', () => {
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() findTable().findAll(`[data-testid="${col}"]`).at(row).find(child);
.findAll(`[data-testid="${col}"]`)
.at(row)
.find(child);
const findColSubComponent = (colTestId, childComponent) => const findColSubComponent = (colTestId, childComponent) =>
findCol(colTestId).find(childComponent); findCol(colTestId).find(childComponent);
......
export const groupData = [{ id: '1', full_name: 'Foo' }, { id: '2', full_name: 'Bar' }]; export const groupData = [
{ id: '1', full_name: 'Foo' },
{ id: '2', full_name: 'Bar' },
];
export const pageData = { export const pageData = {
'x-next-page': 2, 'x-next-page': 2,
...@@ -17,7 +20,10 @@ export const groupNodes = [ ...@@ -17,7 +20,10 @@ export const groupNodes = [
}, },
]; ];
export const groupNodeLabelValues = [{ label: 'Foo', value: '1' }, { label: 'Bar', value: '2' }]; export const groupNodeLabelValues = [
{ label: 'Foo', value: '1' },
{ label: 'Bar', value: '2' },
];
export const groupIds = ['1', '2']; export const groupIds = ['1', '2'];
......
...@@ -41,14 +41,8 @@ describe('MergeRequestTable component', () => { ...@@ -41,14 +41,8 @@ describe('MergeRequestTable component', () => {
}); });
const findTable = () => wrapper.find(GlTable); const findTable = () => wrapper.find(GlTable);
const findTableRow = index => const findTableRow = index => findTable().findAll('tbody tr').at(index);
findTable() const findReviewTimeCol = rowIndex => findTableRow(rowIndex).findAll('td').at(1);
.findAll('tbody tr')
.at(index);
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) => {
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Component from 'ee/analytics/contribution_analytics/components/column_chart.vue'; import Component from 'ee/analytics/contribution_analytics/components/column_chart.vue';
const mockChartData = [['root', 100], ['desiree', 30], ['katlyn', 70], ['myrtis', 0]]; const mockChartData = [
['root', 100],
['desiree', 30],
['katlyn', 70],
['myrtis', 0],
];
describe('Contribution Analytics Column Chart', () => { describe('Contribution Analytics Column Chart', () => {
let wrapper; let wrapper;
......
...@@ -153,10 +153,7 @@ describe('Value Stream Analytics component', () => { ...@@ -153,10 +153,7 @@ describe('Value Stream Analytics component', () => {
} }
const findStageNavItemAtIndex = index => const findStageNavItemAtIndex = index =>
wrapper wrapper.find(StageTableNav).findAll(StageNavItem).at(index);
.find(StageTableNav)
.findAll(StageNavItem)
.at(index);
const findAddStageButton = () => wrapper.find(AddStageButton); const findAddStageButton = () => wrapper.find(AddStageButton);
......
...@@ -415,9 +415,7 @@ describe('CustomStageForm', () => { ...@@ -415,9 +415,7 @@ describe('CustomStageForm', () => {
}); });
it(`emits the ${STAGE_ACTIONS.UPDATE} action when clicking on a stage to recover`, async () => { it(`emits the ${STAGE_ACTIONS.UPDATE} action when clicking on a stage to recover`, async () => {
findRecoverStageDropdown() findRecoverStageDropdown().find(GlDropdownItem).vm.$emit('click');
.find(GlDropdownItem)
.vm.$emit('click');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.emitted()).toEqual({ expect(wrapper.emitted()).toEqual({
......
...@@ -65,10 +65,7 @@ describe('DurationChart', () => { ...@@ -65,10 +65,7 @@ describe('DurationChart', () => {
const findLoader = _wrapper => _wrapper.find(ChartSkeletonLoader); const findLoader = _wrapper => _wrapper.find(ChartSkeletonLoader);
const selectStage = (_wrapper, index = 0) => { const selectStage = (_wrapper, index = 0) => {
findStageDropdown(_wrapper) findStageDropdown(_wrapper).findAll(GlDropdownItem).at(index).vm.$emit('click');
.findAll(GlDropdownItem)
.at(index)
.vm.$emit('click');
}; };
beforeEach(() => { beforeEach(() => {
......
...@@ -186,13 +186,19 @@ describe('Filter bar', () => { ...@@ -186,13 +186,19 @@ describe('Filter bar', () => {
[ [
'selectedLabelList', 'selectedLabelList',
'label_name', 'label_name',
[{ value: 'Afternix', operator: '=' }, { value: 'Brouceforge', operator: '=' }], [
{ value: 'Afternix', operator: '=' },
{ value: 'Brouceforge', operator: '=' },
],
['Afternix', 'Brouceforge'], ['Afternix', 'Brouceforge'],
], ],
[ [
'selectedAssigneeList', 'selectedAssigneeList',
'assignee_username', 'assignee_username',
[{ value: 'rootUser', operator: '=' }, { value: 'secondaryUser', operator: '=' }], [
{ value: 'rootUser', operator: '=' },
{ value: 'secondaryUser', operator: '=' },
],
['rootUser', 'secondaryUser'], ['rootUser', 'secondaryUser'],
], ],
])('with a %s updates the %s url parameter', (stateKey, paramKey, payload, result) => { ])('with a %s updates the %s url parameter', (stateKey, paramKey, payload, result) => {
......
...@@ -22,9 +22,7 @@ describe('PathNavigation', () => { ...@@ -22,9 +22,7 @@ describe('PathNavigation', () => {
}; };
const clickItemAt = index => { const clickItemAt = index => {
pathNavigationItems() pathNavigationItems().at(index).trigger('click');
.at(index)
.trigger('click');
}; };
beforeEach(() => { beforeEach(() => {
......
...@@ -39,10 +39,7 @@ describe('StageDropdownFilter component', () => { ...@@ -39,10 +39,7 @@ describe('StageDropdownFilter component', () => {
const findDropdown = () => wrapper.find(GlDropdown); const findDropdown = () => wrapper.find(GlDropdown);
const selectDropdownItemAtIndex = index => const selectDropdownItemAtIndex = index =>
findDropdown() findDropdown().findAll(GlDropdownItem).at(index).vm.$emit('click');
.findAll(GlDropdownItem)
.at(index)
.vm.$emit('click');
describe('on stage click', () => { describe('on stage click', () => {
describe('clicking a selected stage', () => { describe('clicking a selected stage', () => {
......
...@@ -27,10 +27,7 @@ describe('StageTableNav', () => { ...@@ -27,10 +27,7 @@ describe('StageTableNav', () => {
}); });
function selectStage(index) { function selectStage(index) {
wrapper wrapper.findAll(StageNavItem).at(index).trigger('click');
.findAll(StageNavItem)
.at(index)
.trigger('click');
} }
describe('when a stage is clicked', () => { describe('when a stage is clicked', () => {
......
...@@ -23,9 +23,7 @@ const findSelectedSubjectFilters = ctx => findSubjectFilters(ctx).attributes('ch ...@@ -23,9 +23,7 @@ const findSelectedSubjectFilters = ctx => findSubjectFilters(ctx).attributes('ch
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) findDropdownLabels(ctx).at(index).trigger('click');
.at(index)
.trigger('click');
return waitForPromises(); return waitForPromises();
}; };
...@@ -189,10 +187,7 @@ describe('TasksByTypeFilters', () => { ...@@ -189,10 +187,7 @@ describe('TasksByTypeFilters', () => {
wrapper = createComponent({ mountFn: mount }); wrapper = createComponent({ mountFn: mount });
expect(wrapper.emitted('updateFilter')).toBeUndefined(); expect(wrapper.emitted('updateFilter')).toBeUndefined();
findSubjectFilters(wrapper) findSubjectFilters(wrapper).findAll('label:not(.active)').at(0).trigger('click');
.findAll('label:not(.active)')
.at(0)
.trigger('click');
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(wrapper.emitted('updateFilter')).toBeDefined(); expect(wrapper.emitted('updateFilter')).toBeDefined();
......
...@@ -38,7 +38,10 @@ export const endpoints = { ...@@ -38,7 +38,10 @@ export const endpoints = {
valueStreamData: /analytics\/value_stream_analytics\/value_streams/, valueStreamData: /analytics\/value_stream_analytics\/value_streams/,
}; };
export const valueStreams = [{ id: 1, name: 'Value stream 1' }, { id: 2, name: 'Value stream 2' }]; export const valueStreams = [
{ id: 1, name: 'Value stream 1' },
{ id: 2, name: 'Value stream 2' },
];
export const groupLabels = getJSONFixture(fixtureEndpoints.groupLabels).map( export const groupLabels = getJSONFixture(fixtureEndpoints.groupLabels).map(
convertObjectPropsToCamelCase, convertObjectPropsToCamelCase,
...@@ -184,7 +187,11 @@ export const transformedStagePathData = transformStagesForPathNavigation({ ...@@ -184,7 +187,11 @@ export const transformedStagePathData = transformStagesForPathNavigation({
export const tasksByTypeData = { export const tasksByTypeData = {
seriesNames: ['Cool label', 'Normal label'], seriesNames: ['Cool label', 'Normal label'],
data: [[0, 1, 2], [5, 2, 3], [2, 4, 1]], data: [
[0, 1, 2],
[5, 2, 3],
[2, 4, 1],
],
groupBy: ['Group 1', 'Group 2', 'Group 3'], groupBy: ['Group 1', 'Group 2', 'Group 3'],
}; };
......
...@@ -160,8 +160,8 @@ describe('Value Stream Analytics mutations', () => { ...@@ -160,8 +160,8 @@ describe('Value Stream Analytics mutations', () => {
]); ]);
expect(stateWithData.medians).toEqual({ expect(stateWithData.medians).toEqual({
'1': { value: 20, error: null }, 1: { value: 20, error: null },
'2': { value: 10, error: null }, 2: { value: 10, error: null },
}); });
}); });
}); });
......
...@@ -206,7 +206,10 @@ describe('ThroughputChart', () => { ...@@ -206,7 +206,10 @@ describe('ThroughputChart', () => {
selectedAssignee: { value: assigneeUsername, operator }, selectedAssignee: { value: assigneeUsername, operator },
selectedAuthor: { value: authorUsername, operator }, selectedAuthor: { value: authorUsername, operator },
selectedMilestone: { value: milestoneTitle, operator }, selectedMilestone: { value: milestoneTitle, operator },
selectedLabelList: [{ value: labels[0], operator }, { value: labels[1], operator }], selectedLabelList: [
{ value: labels[0], operator },
{ value: labels[1], operator },
],
}); });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect( expect(
......
...@@ -78,15 +78,9 @@ describe('ThroughputTable', () => { ...@@ -78,15 +78,9 @@ describe('ThroughputTable', () => {
const findPagination = () => wrapper.find(GlPagination); const findPagination = () => wrapper.find(GlPagination);
const findPrevious = () => const findPrevious = () => findPagination().findAll('.page-item').at(0);
findPagination()
.findAll('.page-item')
.at(0);
const findNext = () => const findNext = () => findPagination().findAll('.page-item').at(1);
findPagination()
.findAll('.page-item')
.at(1);
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
...@@ -472,7 +466,10 @@ describe('ThroughputTable', () => { ...@@ -472,7 +466,10 @@ describe('ThroughputTable', () => {
selectedAssignee: { value: assigneeUsername, operator }, selectedAssignee: { value: assigneeUsername, operator },
selectedAuthor: { value: authorUsername, operator }, selectedAuthor: { value: authorUsername, operator },
selectedMilestone: { value: milestoneTitle, operator }, selectedMilestone: { value: milestoneTitle, operator },
selectedLabelList: [{ value: labels[0], operator }, { value: labels[1], operator }], selectedLabelList: [
{ value: labels[0], operator },
{ value: labels[1], operator },
],
}); });
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect( expect(
......
...@@ -23,7 +23,11 @@ export const throughputChartNoData = { ...@@ -23,7 +23,11 @@ export const throughputChartNoData = {
export const formattedThroughputChartData = [ export const formattedThroughputChartData = [
{ {
data: [['May 2020', 2], ['Jun 2020', 4], ['Jul 2020', 3]], data: [
['May 2020', 2],
['Jun 2020', 4],
['Jul 2020', 3],
],
name: THROUGHPUT_CHART_STRINGS.Y_AXIS_TITLE, name: THROUGHPUT_CHART_STRINGS.Y_AXIS_TITLE,
}, },
]; ];
......
...@@ -218,9 +218,7 @@ describe('ProductivityApp component', () => { ...@@ -218,9 +218,7 @@ describe('ProductivityApp component', () => {
}, },
}; };
findMainMetricChart() findMainMetricChart().find(GlColumnChart).vm.$emit('chartItemClicked', data);
.find(GlColumnChart)
.vm.$emit('chartItemClicked', data);
}); });
it('dispatches updateSelectedItems action', () => { it('dispatches updateSelectedItems action', () => {
...@@ -410,11 +408,7 @@ describe('ProductivityApp component', () => { ...@@ -410,11 +408,7 @@ describe('ProductivityApp component', () => {
}); });
it('renders a loading indicator', () => { it('renders a loading indicator', () => {
expect( expect(findMrTableSection().find(GlLoadingIcon).exists()).toBe(true);
findMrTableSection()
.find(GlLoadingIcon)
.exists(),
).toBe(true);
}); });
}); });
...@@ -432,11 +426,7 @@ describe('ProductivityApp component', () => { ...@@ -432,11 +426,7 @@ describe('ProductivityApp component', () => {
}); });
it('doesn’t render a "no data" message', () => { it('doesn’t render a "no data" message', () => {
expect( expect(findMrTableSection().find(GlAlert).exists()).toBe(false);
findMrTableSection()
.find(GlAlert)
.exists(),
).toBe(false);
}); });
it('should change the column metric', async () => { it('should change the column metric', async () => {
...@@ -459,10 +449,7 @@ describe('ProductivityApp component', () => { ...@@ -459,10 +449,7 @@ describe('ProductivityApp component', () => {
}); });
it('should change the sort field', () => { it('should change the sort field', () => {
findSortFieldDropdown() findSortFieldDropdown().findAll(GlDropdownItem).at(0).vm.$emit('click');
.findAll(GlDropdownItem)
.at(0)
.vm.$emit('click');
expect(tableActionSpies.setSortField).toHaveBeenCalled(); expect(tableActionSpies.setSortField).toHaveBeenCalled();
}); });
...@@ -483,11 +470,7 @@ describe('ProductivityApp component', () => { ...@@ -483,11 +470,7 @@ describe('ProductivityApp component', () => {
}); });
it('renders a "no data" message', () => { it('renders a "no data" message', () => {
expect( expect(findMrTableSection().find(GlAlert).exists()).toBe(true);
findMrTableSection()
.find(GlAlert)
.exists(),
).toBe(true);
}); });
it('doesn`t render the MR table', () => { it('doesn`t render the MR table', () => {
......
...@@ -140,9 +140,7 @@ describe('MetricChart component', () => { ...@@ -140,9 +140,7 @@ describe('MetricChart component', () => {
it('should emit `metricTypeChange` event when dropdown item gets clicked', () => { it('should emit `metricTypeChange` event when dropdown item gets clicked', () => {
jest.spyOn(wrapper.vm, '$emit'); jest.spyOn(wrapper.vm, '$emit');
findMetricDropdownItems() findMetricDropdownItems().at(0).vm.$emit('click');
.at(0)
.vm.$emit('click');
expect(wrapper.vm.$emit).toHaveBeenCalledWith('metricTypeChange', 'time_to_merge'); expect(wrapper.vm.$emit).toHaveBeenCalledWith('metricTypeChange', 'time_to_merge');
}); });
...@@ -151,12 +149,7 @@ describe('MetricChart component', () => { ...@@ -151,12 +149,7 @@ describe('MetricChart component', () => {
wrapper.setProps({ selectedMetric: 'time_to_last_commit' }); wrapper.setProps({ selectedMetric: 'time_to_last_commit' });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect( expect(findMetricDropdownItems().at(0).find(GlIcon).classes()).toContain('invisible');
findMetricDropdownItems()
.at(0)
.find(GlIcon)
.classes(),
).toContain('invisible');
}); });
}); });
}); });
......
...@@ -82,11 +82,9 @@ describe('MergeRequestTableRow component', () => { ...@@ -82,11 +82,9 @@ describe('MergeRequestTableRow component', () => {
}); });
it('renders the "Time to merge" metric column with the "days_to_merge" metric', () => { it('renders the "Time to merge" metric column with the "days_to_merge" metric', () => {
expect( expect(findMetricColumns().at(0).props('value')).toBe(
findMetricColumns() defaultProps.mergeRequest.days_to_merge,
.at(0) );
.props('value'),
).toBe(defaultProps.mergeRequest.days_to_merge);
}); });
}); });
}); });
......
...@@ -33,127 +33,127 @@ export const mockMergeRequests = [ ...@@ -33,127 +33,127 @@ export const mockMergeRequests = [
]; ];
export const mockHistogramData = { export const mockHistogramData = {
'1': 1, 1: 1,
'2': 2, 2: 2,
'3': 3, 3: 3,
'4': 4, 4: 4,
'5': 5, 5: 5,
'6': 6, 6: 6,
'7': 7, 7: 7,
'8': 8, 8: 8,
'9': 9, 9: 9,
'10': 10, 10: 10,
'11': 11, 11: 11,
'12': 12, 12: 12,
'13': 13, 13: 13,
'14': 14, 14: 14,
'15': 15, 15: 15,
'16': 16, 16: 16,
'17': 17, 17: 17,
'18': 18, 18: 18,
'19': 19, 19: 19,
'20': 20, 20: 20,
'21': 21, 21: 21,
'22': 22, 22: 22,
'23': 23, 23: 23,
'24': 24, 24: 24,
'25': 25, 25: 25,
'26': 26, 26: 26,
'27': 27, 27: 27,
'28': 28, 28: 28,
'29': 29, 29: 29,
'30': 30, 30: 30,
'31': 31, 31: 31,
'32': 32, 32: 32,
'33': 33, 33: 33,
'34': 34, 34: 34,
'35': 35, 35: 35,
'36': 36, 36: 36,
'37': 37, 37: 37,
'38': 38, 38: 38,
'39': 39, 39: 39,
'40': 40, 40: 40,
'41': 41, 41: 41,
}; };
export const mockScatterplotData = { export const mockScatterplotData = {
'1': { 1: {
metric: 139, metric: 139,
merged_at: '2019-08-18T22:00:00.000Z', merged_at: '2019-08-18T22:00:00.000Z',
}, },
'2': { 2: {
metric: 138, metric: 138,
merged_at: '2019-08-17T22:00:00.000Z', merged_at: '2019-08-17T22:00:00.000Z',
}, },
'3': { 3: {
metric: 24, metric: 24,
merged_at: '2019-08-16T22:00:00.000Z', merged_at: '2019-08-16T22:00:00.000Z',
}, },
'4': { 4: {
metric: 56, metric: 56,
merged_at: '2019-08-15T22:00:00.000Z', merged_at: '2019-08-15T22:00:00.000Z',
}, },
'5': { 5: {
metric: 46, metric: 46,
merged_at: '2019-08-14T22:00:00.000Z', merged_at: '2019-08-14T22:00:00.000Z',
}, },
'6': { 6: {
metric: 43, metric: 43,
merged_at: '2019-08-13T22:00:00.000Z', merged_at: '2019-08-13T22:00:00.000Z',
}, },
'7': { 7: {
metric: 60, metric: 60,
merged_at: '2019-08-12T22:00:00.000Z', merged_at: '2019-08-12T22:00:00.000Z',
}, },
'8': { 8: {
metric: 62, metric: 62,
merged_at: '2019-08-11T22:00:00.000Z', merged_at: '2019-08-11T22:00:00.000Z',
}, },
'9': { 9: {
metric: 46, metric: 46,
merged_at: '2019-08-10T22:00:00.000Z', merged_at: '2019-08-10T22:00:00.000Z',
}, },
'10': { 10: {
metric: 44, metric: 44,
merged_at: '2019-08-09T22:00:00.000Z', merged_at: '2019-08-09T22:00:00.000Z',
}, },
'11': { 11: {
metric: 57, metric: 57,
merged_at: '2019-08-08T22:00:00.000Z', merged_at: '2019-08-08T22:00:00.000Z',
}, },
'12': { 12: {
metric: 51, metric: 51,
merged_at: '2019-08-07T22:00:00.000Z', merged_at: '2019-08-07T22:00:00.000Z',
}, },
'13': { 13: {
metric: 54, metric: 54,
merged_at: '2019-08-06T22:00:00.000Z', merged_at: '2019-08-06T22:00:00.000Z',
}, },
'14': { 14: {
metric: 64, metric: 64,
merged_at: '2019-08-05T22:00:00.000Z', merged_at: '2019-08-05T22:00:00.000Z',
}, },
'15': { 15: {
metric: 52, metric: 52,
merged_at: '2019-08-04T22:00:00.000Z', merged_at: '2019-08-04T22:00:00.000Z',
}, },
'16': { 16: {
metric: 56, metric: 56,
merged_at: '2019-08-03T22:00:00.000Z', merged_at: '2019-08-03T22:00:00.000Z',
}, },
'17': { 17: {
metric: 47, metric: 47,
merged_at: '2019-08-02T22:00:00.000Z', merged_at: '2019-08-02T22:00:00.000Z',
}, },
'18': { 18: {
metric: 49, metric: 49,
merged_at: '2019-08-01T22:00:00.000Z', merged_at: '2019-08-01T22:00:00.000Z',
}, },
'19': { 19: {
metric: 46, metric: 46,
merged_at: '2019-07-31T22:00:00.000Z', merged_at: '2019-07-31T22:00:00.000Z',
}, },
'20': { 20: {
metric: 57, metric: 57,
merged_at: '2019-07-30T22:00:00.000Z', merged_at: '2019-07-30T22:00:00.000Z',
}, },
......
...@@ -41,8 +41,8 @@ describe('Productivity analytics chart getters', () => { ...@@ -41,8 +41,8 @@ describe('Productivity analytics chart getters', () => {
const chartKey = chartKeys.main; const chartKey = chartKeys.main;
state.charts[chartKey] = { state.charts[chartKey] = {
data: { data: {
'1': 32, 1: 32,
'5': 17, 5: 17,
}, },
selected: ['5'], selected: ['5'],
}; };
...@@ -221,7 +221,7 @@ describe('Productivity analytics chart getters', () => { ...@@ -221,7 +221,7 @@ describe('Productivity analytics chart getters', () => {
describe(`does not exceed threshold of ${maxColumnChartItemsPerPage[chartKey]} items`, () => { describe(`does not exceed threshold of ${maxColumnChartItemsPerPage[chartKey]} items`, () => {
it('returns an empty dataZoom property', () => { it('returns an empty dataZoom property', () => {
state.charts[chartKey].data = { '1': 1, '2': 2, '3': 3 }; state.charts[chartKey].data = { 1: 1, 2: 2, 3: 3 };
expect(getters.getColumnChartDatazoomOption(state)(chartKeys.main)).toEqual({}); expect(getters.getColumnChartDatazoomOption(state)(chartKeys.main)).toEqual({});
}); });
......
...@@ -137,7 +137,11 @@ describe('Productivity Analytics utils', () => { ...@@ -137,7 +137,11 @@ describe('Productivity Analytics utils', () => {
[{ merged_at: '2019-08-06T18:00:00.000Z', metric: 80 }], [{ merged_at: '2019-08-06T18:00:00.000Z', metric: 80 }],
]; ];
const result = getMedianLineData(data, startDate, endDate, daysOffset); const result = getMedianLineData(data, startDate, endDate, daysOffset);
const expected = [['2019-08-04', 45], ['2019-08-05', 55], ['2019-08-06', 65]]; const expected = [
['2019-08-04', 45],
['2019-08-05', 55],
['2019-08-06', 65],
];
expect(result).toEqual(expected); expect(result).toEqual(expected);
}); });
}); });
......
...@@ -69,11 +69,9 @@ describe('Select projects dropdown component', () => { ...@@ -69,11 +69,9 @@ describe('Select projects dropdown component', () => {
selectAllProjects(); selectAllProjects();
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect( expect(findProjectById(initialData.groupProjects[0].id).find(GlIcon).classes()).toContain(
findProjectById(initialData.groupProjects[0].id) 'gl-visibility-hidden',
.find(GlIcon) );
.classes(),
).toContain('gl-visibility-hidden');
}); });
}); });
...@@ -104,11 +102,9 @@ describe('Select projects dropdown component', () => { ...@@ -104,11 +102,9 @@ describe('Select projects dropdown component', () => {
selectProjectById(project.id); selectProjectById(project.id);
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect( expect(findProjectById(project.id).find(GlIcon).classes()).not.toContain(
findProjectById(project.id) 'gl-visibility-hidden',
.find(GlIcon) );
.classes(),
).not.toContain('gl-visibility-hidden');
}); });
}); });
...@@ -116,11 +112,7 @@ describe('Select projects dropdown component', () => { ...@@ -116,11 +112,7 @@ describe('Select projects dropdown component', () => {
selectProjectById(initialData.groupProjects[0].id); selectProjectById(initialData.groupProjects[0].id);
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect( expect(findSelectAllProjects().find(GlIcon).classes()).toContain('gl-visibility-hidden');
findSelectAllProjects()
.find(GlIcon)
.classes(),
).toContain('gl-visibility-hidden');
}); });
}); });
......
...@@ -180,16 +180,8 @@ describe('Test coverage table component', () => { ...@@ -180,16 +180,8 @@ describe('Test coverage table component', () => {
}); });
expect(findTable().exists()).toBe(true); expect(findTable().exists()).toBe(true);
expect( expect(findTableRows().at(0).text()).toContain('should be first');
findTableRows() expect(findTableRows().at(1).text()).toContain('should be last');
.at(0)
.text(),
).toContain('should be first');
expect(
findTableRows()
.at(1)
.text(),
).toContain('should be last');
}); });
it('renders the correct link', async () => { it('renders the correct link', async () => {
......
...@@ -75,11 +75,7 @@ describe('Daterange component', () => { ...@@ -75,11 +75,7 @@ describe('Daterange component', () => {
}); });
it('displays the correct number of selected days in the indicator', () => { it('displays the correct number of selected days in the indicator', () => {
expect( expect(findDateRangeIndicator().find('span').text()).toBe('10 days');
findDateRangeIndicator()
.find('span')
.text(),
).toBe('10 days');
}); });
}); });
}); });
......
...@@ -58,10 +58,7 @@ describe('GroupsDropdownFilter component', () => { ...@@ -58,10 +58,7 @@ describe('GroupsDropdownFilter component', () => {
expect(dropdown.find('div.gl-avatar-identicon').exists()).toBe(hasIdenticon); expect(dropdown.find('div.gl-avatar-identicon').exists()).toBe(hasIdenticon);
}; };
const selectDropdownAtIndex = index => const selectDropdownAtIndex = index => findDropdownAtIndex(index).find('button').trigger('click');
findDropdownAtIndex(index)
.find('button')
.trigger('click');
describe('when passed a defaultGroup as prop', () => { describe('when passed a defaultGroup as prop', () => {
beforeEach(() => { beforeEach(() => {
...@@ -130,16 +127,8 @@ describe('GroupsDropdownFilter component', () => { ...@@ -130,16 +127,8 @@ describe('GroupsDropdownFilter component', () => {
selectDropdownAtIndex(1); selectDropdownAtIndex(1);
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect( expect(findDropdownButton().find('img.gl-avatar').exists()).toBe(false);
findDropdownButton() expect(findDropdownButton().find('.gl-avatar-identicon').exists()).toBe(true);
.find('img.gl-avatar')
.exists(),
).toBe(false);
expect(
findDropdownButton()
.find('.gl-avatar-identicon')
.exists(),
).toBe(true);
}); });
}); });
}); });
......
...@@ -75,9 +75,7 @@ describe('ProjectsDropdownFilter component', () => { ...@@ -75,9 +75,7 @@ describe('ProjectsDropdownFilter component', () => {
findDropdownAtIndex(index).find('[data-testid="project-full-path"]'); findDropdownAtIndex(index).find('[data-testid="project-full-path"]');
const selectDropdownItemAtIndex = index => const selectDropdownItemAtIndex = index =>
findDropdownAtIndex(index) findDropdownAtIndex(index).find('button').trigger('click');
.find('button')
.trigger('click');
describe('queryParams are applied when fetching data', () => { describe('queryParams are applied when fetching data', () => {
beforeEach(() => { beforeEach(() => {
......
...@@ -292,7 +292,10 @@ describe('Api', () => { ...@@ -292,7 +292,10 @@ describe('Api', () => {
describe('cycleAnalyticsSummaryData', () => { describe('cycleAnalyticsSummaryData', () => {
it('fetches value stream analytics summary data', done => { it('fetches value stream analytics summary data', done => {
const response = [{ value: 0, title: 'New Issues' }, { value: 0, title: 'Deploys' }]; const response = [
{ value: 0, title: 'New Issues' },
{ value: 0, title: 'Deploys' },
];
const params = { ...defaultParams }; const params = { ...defaultParams };
const expectedUrl = `${dummyValueStreamAnalyticsUrlRoot}/summary`; const expectedUrl = `${dummyValueStreamAnalyticsUrlRoot}/summary`;
mock.onGet(expectedUrl).reply(httpStatus.OK, response); mock.onGet(expectedUrl).reply(httpStatus.OK, response);
...@@ -631,7 +634,10 @@ describe('Api', () => { ...@@ -631,7 +634,10 @@ describe('Api', () => {
describe('getGeoReplicableItems', () => { describe('getGeoReplicableItems', () => {
it('fetches replicableItems based on replicableType', () => { it('fetches replicableItems based on replicableType', () => {
apiResponse = [{ id: 1, name: 'foo' }, { id: 2, name: 'bar' }]; apiResponse = [
{ id: 1, name: 'foo' },
{ id: 2, name: 'bar' },
];
mockParams = { page: 1 }; mockParams = { page: 1 };
jest.spyOn(Api, 'buildUrl').mockReturnValue(expectedUrl); jest.spyOn(Api, 'buildUrl').mockReturnValue(expectedUrl);
......
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