Commit 4ab9b3ea authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera

Merge branch 'leipert-upgrade-prettier-spec' into 'master'

Upgrade spec folders to prettier v2

See merge request gitlab-org/gitlab!50470
parents 5b89a956 ed94bf25
......@@ -9,137 +9,3 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.css
*.scss
*.md
# 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/audit_events/components
ee/spec/frontend/billings/subscriptions/components
ee/spec/frontend/boards/components
ee/spec/frontend/boards/stores
ee/spec/frontend/burndown_chart
ee/spec/frontend/compliance_dashboard/components/merge_requests
ee/spec/frontend/dependencies/components
ee/spec/frontend/epic/store
ee/spec/frontend/geo_nodes/components
ee/spec/frontend/geo_replicable/components
ee/spec/frontend/groups/components
ee/spec/frontend/groups/settings/
ee/spec/frontend/incidents/components
ee/spec/frontend/insights
ee/spec/frontend/issuable/related_issues/components
ee/spec/frontend/issues_analytics/components
ee/spec/frontend/iterations/components
ee/spec/frontend/license_compliance/components
ee/spec/frontend/members/components/ldap
ee/spec/frontend/on_demand_scans/components/profile_selector
ee/spec/frontend/oncall_schedule
ee/spec/frontend/pages/admin/users
ee/spec/frontend/related_items_tree/components
ee/spec/frontend/related_items_tree/store
ee/spec/frontend/roadmap/components
ee/spec/frontend/security_configuration/components
ee/spec/frontend/security_configuration/dast_scanner_profiles_form/components
ee/spec/frontend/security_configuration/sast/components
ee/spec/frontend/security_dashboard/components
ee/spec/frontend/security_dashboard/store/modules/project_selector
ee/spec/frontend/sidebar/components
ee/spec/frontend/storage_counter/components
ee/spec/frontend/subscriptions/new/components
ee/spec/frontend/threat_monitoring
ee/spec/frontend/vue_mr_widget
ee/spec/frontend/vue_shared/components/sidebar/epics_select
ee/spec/frontend/vue_shared/license_compliance/components
ee/spec/frontend/vue_shared/license_compliance/store
ee/spec/frontend/vue_shared/security_reports/components
ee/spec/frontend/vulnerabilities
spec/frontend/alert_management/components
spec/frontend/alerts_settings
spec/frontend/authentication/u2f
spec/frontend/badges/components
spec/frontend/badges/store
spec/frontend/batch_comments/components
spec/frontend/behaviors
spec/frontend/blob/components
spec/frontend/boards
spec/frontend/ci_settings_pipeline_triggers/components
spec/frontend/ci_variable_list/ci_variable_list
spec/frontend/create_cluster/components
spec/frontend/create_cluster/eks_cluster/services
spec/frontend/deploy_freeze/components
spec/frontend/deploy_keys/components
spec/frontend/design_management/components/design_notes
spec/frontend/design_management/pages
spec/frontend/diffs/components
spec/frontend/diffs/store
spec/frontend/error_tracking/components
spec/frontend/error_tracking/store/list
spec/frontend/error_tracking_settings/components
spec/frontend/feature_flags/components
spec/frontend/filtered_search/components
spec/frontend/groups/components
spec/frontend/helpers
spec/frontend/ide/components
spec/frontend/ide/lib
spec/frontend/ide/stores
spec/frontend/incidents/components
spec/frontend/incidents_settings/components
spec/frontend/integrations/edit/components
spec/frontend/issuable/related_issues/components
spec/frontend/issuable_list/components
spec/frontend/issuable_show/components
spec/frontend/issuable_suggestions/components
spec/frontend/issue_show/components
spec/frontend/issues_list/components
spec/frontend/jobs/components
spec/frontend/lib/utils
spec/frontend/logs/components
spec/frontend/members/components/action_buttons
spec/frontend/members/components/filter_sort
spec/frontend/members/components/table
spec/frontend/milestones
spec/frontend/monitoring
spec/frontend/notes
spec/frontend/packages/details/components
spec/frontend/packages/details/store
spec/frontend/packages/list/stores
spec/frontend/packages/shared/components
spec/frontend/pages/projects/forks/new/components
spec/frontend/pages/projects/pipeline_schedules/shared/components
spec/frontend/pages/projects/shared/permissions/components
spec/frontend/pages/search/show
spec/frontend/pages/sessions/new
spec/frontend/pipeline_editor
spec/frontend/pipeline_editor/components/lint
spec/frontend/pipeline_new/components
spec/frontend/pipelines
spec/frontend/profile/account/components
spec/frontend/projects
spec/frontend/prometheus_metrics
spec/frontend/ref/components
spec/frontend/registry/explorer/components
spec/frontend/registry/settings
spec/frontend/related_merge_requests/components
spec/frontend/releases/components
spec/frontend/reports/codequality_report
spec/frontend/reports/components
spec/frontend/repository/components
spec/frontend/self_monitor/components
spec/frontend/serverless
spec/frontend/sidebar
spec/frontend/snippets/components
spec/frontend/vue_mr_widget
spec/frontend/vue_shared/components
spec/frontend/vue_shared/directives
spec/frontend_integration/ide/helpers
spec/frontend_integration/test_helpers/factories
spec/frontend_integration/test_helpers/utils
spec/javascripts
......@@ -34,10 +34,7 @@ describe('DevopsAdoptionTable', () => {
const findCol = testId => findTable().find(`[data-testid="${testId}"]`);
const findColRowChild = (col, row, child) =>
findTable()
.findAll(`[data-testid="${col}"]`)
.at(row)
.find(child);
findTable().findAll(`[data-testid="${col}"]`).at(row).find(child);
const findColSubComponent = (colTestId, 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 = {
'x-next-page': 2,
......@@ -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'];
......
......@@ -41,14 +41,8 @@ describe('MergeRequestTable component', () => {
});
const findTable = () => wrapper.find(GlTable);
const findTableRow = index =>
findTable()
.findAll('tbody tr')
.at(index);
const findReviewTimeCol = rowIndex =>
findTableRow(rowIndex)
.findAll('td')
.at(1);
const findTableRow = index => findTable().findAll('tbody tr').at(index);
const findReviewTimeCol = rowIndex => findTableRow(rowIndex).findAll('td').at(1);
const updateMergeRequests = (index, attrs) =>
mockMergeRequests.map((item, idx) => {
......
import { mount } from '@vue/test-utils';
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', () => {
let wrapper;
......
......@@ -153,10 +153,7 @@ describe('Value Stream Analytics component', () => {
}
const findStageNavItemAtIndex = index =>
wrapper
.find(StageTableNav)
.findAll(StageNavItem)
.at(index);
wrapper.find(StageTableNav).findAll(StageNavItem).at(index);
const findAddStageButton = () => wrapper.find(AddStageButton);
......
......@@ -415,9 +415,7 @@ describe('CustomStageForm', () => {
});
it(`emits the ${STAGE_ACTIONS.UPDATE} action when clicking on a stage to recover`, async () => {
findRecoverStageDropdown()
.find(GlDropdownItem)
.vm.$emit('click');
findRecoverStageDropdown().find(GlDropdownItem).vm.$emit('click');
await wrapper.vm.$nextTick();
expect(wrapper.emitted()).toEqual({
......
......@@ -65,10 +65,7 @@ describe('DurationChart', () => {
const findLoader = _wrapper => _wrapper.find(ChartSkeletonLoader);
const selectStage = (_wrapper, index = 0) => {
findStageDropdown(_wrapper)
.findAll(GlDropdownItem)
.at(index)
.vm.$emit('click');
findStageDropdown(_wrapper).findAll(GlDropdownItem).at(index).vm.$emit('click');
};
beforeEach(() => {
......
......@@ -186,13 +186,19 @@ describe('Filter bar', () => {
[
'selectedLabelList',
'label_name',
[{ value: 'Afternix', operator: '=' }, { value: 'Brouceforge', operator: '=' }],
[
{ value: 'Afternix', operator: '=' },
{ value: 'Brouceforge', operator: '=' },
],
['Afternix', 'Brouceforge'],
],
[
'selectedAssigneeList',
'assignee_username',
[{ value: 'rootUser', operator: '=' }, { value: 'secondaryUser', operator: '=' }],
[
{ value: 'rootUser', operator: '=' },
{ value: 'secondaryUser', operator: '=' },
],
['rootUser', 'secondaryUser'],
],
])('with a %s updates the %s url parameter', (stateKey, paramKey, payload, result) => {
......
......@@ -22,9 +22,7 @@ describe('PathNavigation', () => {
};
const clickItemAt = index => {
pathNavigationItems()
.at(index)
.trigger('click');
pathNavigationItems().at(index).trigger('click');
};
beforeEach(() => {
......
......@@ -39,10 +39,7 @@ describe('StageDropdownFilter component', () => {
const findDropdown = () => wrapper.find(GlDropdown);
const selectDropdownItemAtIndex = index =>
findDropdown()
.findAll(GlDropdownItem)
.at(index)
.vm.$emit('click');
findDropdown().findAll(GlDropdownItem).at(index).vm.$emit('click');
describe('on stage click', () => {
describe('clicking a selected stage', () => {
......
......@@ -27,10 +27,7 @@ describe('StageTableNav', () => {
});
function selectStage(index) {
wrapper
.findAll(StageNavItem)
.at(index)
.trigger('click');
wrapper.findAll(StageNavItem).at(index).trigger('click');
}
describe('when a stage is clicked', () => {
......
......@@ -23,9 +23,7 @@ const findSelectedSubjectFilters = ctx => findSubjectFilters(ctx).attributes('ch
const findDropdownLabels = ctx => ctx.find(LabelsSelector).findAll(GlDropdownItem);
const selectLabelAtIndex = (ctx, index) => {
findDropdownLabels(ctx)
.at(index)
.trigger('click');
findDropdownLabels(ctx).at(index).trigger('click');
return waitForPromises();
};
......@@ -189,10 +187,7 @@ describe('TasksByTypeFilters', () => {
wrapper = createComponent({ mountFn: mount });
expect(wrapper.emitted('updateFilter')).toBeUndefined();
findSubjectFilters(wrapper)
.findAll('label:not(.active)')
.at(0)
.trigger('click');
findSubjectFilters(wrapper).findAll('label:not(.active)').at(0).trigger('click');
return wrapper.vm.$nextTick(() => {
expect(wrapper.emitted('updateFilter')).toBeDefined();
......
......@@ -38,7 +38,10 @@ export const endpoints = {
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(
convertObjectPropsToCamelCase,
......@@ -184,7 +187,11 @@ export const transformedStagePathData = transformStagesForPathNavigation({
export const tasksByTypeData = {
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'],
};
......
......@@ -160,8 +160,8 @@ describe('Value Stream Analytics mutations', () => {
]);
expect(stateWithData.medians).toEqual({
'1': { value: 20, error: null },
'2': { value: 10, error: null },
1: { value: 20, error: null },
2: { value: 10, error: null },
});
});
});
......
......@@ -206,7 +206,10 @@ describe('ThroughputChart', () => {
selectedAssignee: { value: assigneeUsername, operator },
selectedAuthor: { value: authorUsername, 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();
expect(
......
......@@ -78,15 +78,9 @@ describe('ThroughputTable', () => {
const findPagination = () => wrapper.find(GlPagination);
const findPrevious = () =>
findPagination()
.findAll('.page-item')
.at(0);
const findPrevious = () => findPagination().findAll('.page-item').at(0);
const findNext = () =>
findPagination()
.findAll('.page-item')
.at(1);
const findNext = () => findPagination().findAll('.page-item').at(1);
afterEach(() => {
wrapper.destroy();
......@@ -472,7 +466,10 @@ describe('ThroughputTable', () => {
selectedAssignee: { value: assigneeUsername, operator },
selectedAuthor: { value: authorUsername, 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();
expect(
......
......@@ -23,7 +23,11 @@ export const throughputChartNoData = {
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,
},
];
......
......@@ -218,9 +218,7 @@ describe('ProductivityApp component', () => {
},
};
findMainMetricChart()
.find(GlColumnChart)
.vm.$emit('chartItemClicked', data);
findMainMetricChart().find(GlColumnChart).vm.$emit('chartItemClicked', data);
});
it('dispatches updateSelectedItems action', () => {
......@@ -410,11 +408,7 @@ describe('ProductivityApp component', () => {
});
it('renders a loading indicator', () => {
expect(
findMrTableSection()
.find(GlLoadingIcon)
.exists(),
).toBe(true);
expect(findMrTableSection().find(GlLoadingIcon).exists()).toBe(true);
});
});
......@@ -432,11 +426,7 @@ describe('ProductivityApp component', () => {
});
it('doesn’t render a "no data" message', () => {
expect(
findMrTableSection()
.find(GlAlert)
.exists(),
).toBe(false);
expect(findMrTableSection().find(GlAlert).exists()).toBe(false);
});
it('should change the column metric', async () => {
......@@ -459,10 +449,7 @@ describe('ProductivityApp component', () => {
});
it('should change the sort field', () => {
findSortFieldDropdown()
.findAll(GlDropdownItem)
.at(0)
.vm.$emit('click');
findSortFieldDropdown().findAll(GlDropdownItem).at(0).vm.$emit('click');
expect(tableActionSpies.setSortField).toHaveBeenCalled();
});
......@@ -483,11 +470,7 @@ describe('ProductivityApp component', () => {
});
it('renders a "no data" message', () => {
expect(
findMrTableSection()
.find(GlAlert)
.exists(),
).toBe(true);
expect(findMrTableSection().find(GlAlert).exists()).toBe(true);
});
it('doesn`t render the MR table', () => {
......
......@@ -140,9 +140,7 @@ describe('MetricChart component', () => {
it('should emit `metricTypeChange` event when dropdown item gets clicked', () => {
jest.spyOn(wrapper.vm, '$emit');
findMetricDropdownItems()
.at(0)
.vm.$emit('click');
findMetricDropdownItems().at(0).vm.$emit('click');
expect(wrapper.vm.$emit).toHaveBeenCalledWith('metricTypeChange', 'time_to_merge');
});
......@@ -151,12 +149,7 @@ describe('MetricChart component', () => {
wrapper.setProps({ selectedMetric: 'time_to_last_commit' });
return wrapper.vm.$nextTick().then(() => {
expect(
findMetricDropdownItems()
.at(0)
.find(GlIcon)
.classes(),
).toContain('invisible');
expect(findMetricDropdownItems().at(0).find(GlIcon).classes()).toContain('invisible');
});
});
});
......
......@@ -82,11 +82,9 @@ describe('MergeRequestTableRow component', () => {
});
it('renders the "Time to merge" metric column with the "days_to_merge" metric', () => {
expect(
findMetricColumns()
.at(0)
.props('value'),
).toBe(defaultProps.mergeRequest.days_to_merge);
expect(findMetricColumns().at(0).props('value')).toBe(
defaultProps.mergeRequest.days_to_merge,
);
});
});
});
......
......@@ -33,127 +33,127 @@ export const mockMergeRequests = [
];
export const mockHistogramData = {
'1': 1,
'2': 2,
'3': 3,
'4': 4,
'5': 5,
'6': 6,
'7': 7,
'8': 8,
'9': 9,
'10': 10,
'11': 11,
'12': 12,
'13': 13,
'14': 14,
'15': 15,
'16': 16,
'17': 17,
'18': 18,
'19': 19,
'20': 20,
'21': 21,
'22': 22,
'23': 23,
'24': 24,
'25': 25,
'26': 26,
'27': 27,
'28': 28,
'29': 29,
'30': 30,
'31': 31,
'32': 32,
'33': 33,
'34': 34,
'35': 35,
'36': 36,
'37': 37,
'38': 38,
'39': 39,
'40': 40,
'41': 41,
1: 1,
2: 2,
3: 3,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 9,
10: 10,
11: 11,
12: 12,
13: 13,
14: 14,
15: 15,
16: 16,
17: 17,
18: 18,
19: 19,
20: 20,
21: 21,
22: 22,
23: 23,
24: 24,
25: 25,
26: 26,
27: 27,
28: 28,
29: 29,
30: 30,
31: 31,
32: 32,
33: 33,
34: 34,
35: 35,
36: 36,
37: 37,
38: 38,
39: 39,
40: 40,
41: 41,
};
export const mockScatterplotData = {
'1': {
1: {
metric: 139,
merged_at: '2019-08-18T22:00:00.000Z',
},
'2': {
2: {
metric: 138,
merged_at: '2019-08-17T22:00:00.000Z',
},
'3': {
3: {
metric: 24,
merged_at: '2019-08-16T22:00:00.000Z',
},
'4': {
4: {
metric: 56,
merged_at: '2019-08-15T22:00:00.000Z',
},
'5': {
5: {
metric: 46,
merged_at: '2019-08-14T22:00:00.000Z',
},
'6': {
6: {
metric: 43,
merged_at: '2019-08-13T22:00:00.000Z',
},
'7': {
7: {
metric: 60,
merged_at: '2019-08-12T22:00:00.000Z',
},
'8': {
8: {
metric: 62,
merged_at: '2019-08-11T22:00:00.000Z',
},
'9': {
9: {
metric: 46,
merged_at: '2019-08-10T22:00:00.000Z',
},
'10': {
10: {
metric: 44,
merged_at: '2019-08-09T22:00:00.000Z',
},
'11': {
11: {
metric: 57,
merged_at: '2019-08-08T22:00:00.000Z',
},
'12': {
12: {
metric: 51,
merged_at: '2019-08-07T22:00:00.000Z',
},
'13': {
13: {
metric: 54,
merged_at: '2019-08-06T22:00:00.000Z',
},
'14': {
14: {
metric: 64,
merged_at: '2019-08-05T22:00:00.000Z',
},
'15': {
15: {
metric: 52,
merged_at: '2019-08-04T22:00:00.000Z',
},
'16': {
16: {
metric: 56,
merged_at: '2019-08-03T22:00:00.000Z',
},
'17': {
17: {
metric: 47,
merged_at: '2019-08-02T22:00:00.000Z',
},
'18': {
18: {
metric: 49,
merged_at: '2019-08-01T22:00:00.000Z',
},
'19': {
19: {
metric: 46,
merged_at: '2019-07-31T22:00:00.000Z',
},
'20': {
20: {
metric: 57,
merged_at: '2019-07-30T22:00:00.000Z',
},
......
......@@ -41,8 +41,8 @@ describe('Productivity analytics chart getters', () => {
const chartKey = chartKeys.main;
state.charts[chartKey] = {
data: {
'1': 32,
'5': 17,
1: 32,
5: 17,
},
selected: ['5'],
};
......@@ -221,7 +221,7 @@ describe('Productivity analytics chart getters', () => {
describe(`does not exceed threshold of ${maxColumnChartItemsPerPage[chartKey]} items`, () => {
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({});
});
......
......@@ -137,7 +137,11 @@ describe('Productivity Analytics utils', () => {
[{ merged_at: '2019-08-06T18:00:00.000Z', metric: 80 }],
];
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);
});
});
......
......@@ -69,11 +69,9 @@ describe('Select projects dropdown component', () => {
selectAllProjects();
return wrapper.vm.$nextTick().then(() => {
expect(
findProjectById(initialData.groupProjects[0].id)
.find(GlIcon)
.classes(),
).toContain('gl-visibility-hidden');
expect(findProjectById(initialData.groupProjects[0].id).find(GlIcon).classes()).toContain(
'gl-visibility-hidden',
);
});
});
......@@ -104,11 +102,9 @@ describe('Select projects dropdown component', () => {
selectProjectById(project.id);
return wrapper.vm.$nextTick().then(() => {
expect(
findProjectById(project.id)
.find(GlIcon)
.classes(),
).not.toContain('gl-visibility-hidden');
expect(findProjectById(project.id).find(GlIcon).classes()).not.toContain(
'gl-visibility-hidden',
);
});
});
......@@ -116,11 +112,7 @@ describe('Select projects dropdown component', () => {
selectProjectById(initialData.groupProjects[0].id);
return wrapper.vm.$nextTick().then(() => {
expect(
findSelectAllProjects()
.find(GlIcon)
.classes(),
).toContain('gl-visibility-hidden');
expect(findSelectAllProjects().find(GlIcon).classes()).toContain('gl-visibility-hidden');
});
});
......
......@@ -180,16 +180,8 @@ describe('Test coverage table component', () => {
});
expect(findTable().exists()).toBe(true);
expect(
findTableRows()
.at(0)
.text(),
).toContain('should be first');
expect(
findTableRows()
.at(1)
.text(),
).toContain('should be last');
expect(findTableRows().at(0).text()).toContain('should be first');
expect(findTableRows().at(1).text()).toContain('should be last');
});
it('renders the correct link', async () => {
......
......@@ -75,11 +75,7 @@ describe('Daterange component', () => {
});
it('displays the correct number of selected days in the indicator', () => {
expect(
findDateRangeIndicator()
.find('span')
.text(),
).toBe('10 days');
expect(findDateRangeIndicator().find('span').text()).toBe('10 days');
});
});
});
......
......@@ -58,10 +58,7 @@ describe('GroupsDropdownFilter component', () => {
expect(dropdown.find('div.gl-avatar-identicon').exists()).toBe(hasIdenticon);
};
const selectDropdownAtIndex = index =>
findDropdownAtIndex(index)
.find('button')
.trigger('click');
const selectDropdownAtIndex = index => findDropdownAtIndex(index).find('button').trigger('click');
describe('when passed a defaultGroup as prop', () => {
beforeEach(() => {
......@@ -130,16 +127,8 @@ describe('GroupsDropdownFilter component', () => {
selectDropdownAtIndex(1);
return wrapper.vm.$nextTick().then(() => {
expect(
findDropdownButton()
.find('img.gl-avatar')
.exists(),
).toBe(false);
expect(
findDropdownButton()
.find('.gl-avatar-identicon')
.exists(),
).toBe(true);
expect(findDropdownButton().find('img.gl-avatar').exists()).toBe(false);
expect(findDropdownButton().find('.gl-avatar-identicon').exists()).toBe(true);
});
});
});
......
......@@ -75,9 +75,7 @@ describe('ProjectsDropdownFilter component', () => {
findDropdownAtIndex(index).find('[data-testid="project-full-path"]');
const selectDropdownItemAtIndex = index =>
findDropdownAtIndex(index)
.find('button')
.trigger('click');
findDropdownAtIndex(index).find('button').trigger('click');
describe('queryParams are applied when fetching data', () => {
beforeEach(() => {
......
......@@ -292,7 +292,10 @@ describe('Api', () => {
describe('cycleAnalyticsSummaryData', () => {
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 expectedUrl = `${dummyValueStreamAnalyticsUrlRoot}/summary`;
mock.onGet(expectedUrl).reply(httpStatus.OK, response);
......@@ -631,7 +634,10 @@ describe('Api', () => {
describe('getGeoReplicableItems', () => {
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 };
jest.spyOn(Api, 'buildUrl').mockReturnValue(expectedUrl);
......
......@@ -216,10 +216,9 @@ describe('EE Approvals App', () => {
findResetButton().vm.$emit('click');
return wrapper.vm.$nextTick().then(() => {
expect(store.modules.approvals.actions.fetchRules).toHaveBeenLastCalledWith(
expect.anything(),
{ targetBranch, resetToDefault: true },
);
expect(
store.modules.approvals.actions.fetchRules,
).toHaveBeenLastCalledWith(expect.anything(), { targetBranch, resetToDefault: true });
expect(showToast).toHaveBeenCalledWith('Approval rules reset to project defaults', {
action: {
text: 'Undo',
......
......@@ -25,23 +25,13 @@ describe('Approval Check Popover', () => {
});
it('should render the documentation link', () => {
expect(
wrapper
.find(GlPopover)
.find(GlLink)
.attributes('href'),
).toBe(documentationLink);
expect(wrapper.find(GlPopover).find(GlLink).attributes('href')).toBe(documentationLink);
});
});
describe('without a documentation link', () => {
it('should not render the documentation link', () => {
expect(
wrapper
.find(GlPopover)
.find(GlLink)
.exists(),
).toBeFalsy();
expect(wrapper.find(GlPopover).find(GlLink).exists()).toBeFalsy();
});
});
});
......@@ -7,7 +7,10 @@ import BranchesSelect from 'ee/approvals/components/branches_select.vue';
const TEST_DEFAULT_BRANCH = { name: 'Any branch' };
const TEST_PROJECT_ID = '1';
const TEST_PROTECTED_BRANCHES = [{ id: 1, name: 'master' }, { id: 2, name: 'development' }];
const TEST_PROTECTED_BRANCHES = [
{ id: 1, name: 'master' },
{ id: 2, name: 'development' },
];
const TEST_BRANCHES_SELECTIONS = [TEST_DEFAULT_BRANCH, ...TEST_PROTECTED_BRANCHES];
const waitForEvent = ($input, event) => new Promise(resolve => $input.one(event, resolve));
const select2Container = () => document.querySelector('.select2-container');
......
......@@ -89,11 +89,7 @@ describe('EE Approvals LicenseCompliance Modal', () => {
createWrapper();
expect(
findModal()
.attributes('title')
.startsWith(expectTitleStartsWith),
).toBe(true);
expect(findModal().attributes('title').startsWith(expectTitleStartsWith)).toBe(true);
});
});
......
......@@ -53,12 +53,7 @@ describe('EE Approvals MREditApp', () => {
});
it('renders hidden inputs', () => {
expect(
wrapper
.find('.js-approval-rules')
.find(MRRulesHiddenInputs)
.exists(),
).toBe(true);
expect(wrapper.find('.js-approval-rules').find(MRRulesHiddenInputs).exists()).toBe(true);
});
});
......@@ -76,12 +71,7 @@ describe('EE Approvals MREditApp', () => {
store.modules.approvals.state.rules = [{ id: 7, approvers: [] }];
factory();
expect(
wrapper
.find('.js-approval-rules')
.find(MRRulesHiddenInputs)
.exists(),
).toBe(true);
expect(wrapper.find('.js-approval-rules').find(MRRulesHiddenInputs).exists()).toBe(true);
});
describe('summary text', () => {
......
......@@ -34,11 +34,7 @@ describe('EE Approvals MRRules', () => {
const findHeaders = () => wrapper.findAll('thead th').wrappers.map(x => x.text());
const findRuleName = () => wrapper.find('.js-name');
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 callTargetBranchHandler = MutationObserverSpy => {
const onTargetBranchMutationHandler = MutationObserverSpy.mock.calls[0][0];
......
......@@ -20,13 +20,7 @@ describe('AuditEventsTable component', () => {
};
const getCell = (trIdx, tdIdx) => {
return wrapper
.find(GlTable)
.find('tbody')
.findAll('tr')
.at(trIdx)
.findAll('td')
.at(tdIdx);
return wrapper.find(GlTable).find('tbody').findAll('tr').at(trIdx).findAll('td').at(tdIdx);
};
beforeEach(() => {
......
......@@ -24,12 +24,7 @@ describe('DateRangeButtons component', () => {
dateRange: { startDate: getDateInPast(CURRENT_DATE, 7), endDate: CURRENT_DATE },
});
expect(
wrapper
.find(GlButtonGroup)
.find('[selected="true"]')
.text(),
).toBe('Last 7 days');
expect(wrapper.find(GlButtonGroup).find('[selected="true"]').text()).toBe('Last 7 days');
});
it('shows no date range as selected when the dateRange property does not match any option', () => {
......@@ -40,22 +35,14 @@ describe('DateRangeButtons component', () => {
},
});
expect(
wrapper
.find(GlButtonGroup)
.find('[selected="true"]')
.exists(),
).toBe(false);
expect(wrapper.find(GlButtonGroup).find('[selected="true"]').exists()).toBe(false);
});
it('emits an "input" event with the dateRange when a new date range is selected', async () => {
createComponent({
dateRange: { startDate: getDateInPast(CURRENT_DATE, 1), endDate: CURRENT_DATE },
});
wrapper
.find(GlButtonGroup)
.find(GlButton)
.vm.$emit('click');
wrapper.find(GlButtonGroup).find(GlButton).vm.$emit('click');
await wrapper.vm.$nextTick();
expect(wrapper.emitted().input[0]).toEqual([
......
......@@ -40,31 +40,25 @@ describe('DateRangeField component', () => {
it("sets the max selectable date to today's date on the date picker", () => {
createComponent();
expect(
findDatePicker()
.props('defaultMaxDate')
.toDateString(),
).toBe(CURRENT_DATE.toDateString());
expect(findDatePicker().props('defaultMaxDate').toDateString()).toBe(
CURRENT_DATE.toDateString(),
);
});
it('sets the default start date to the start of the month', () => {
createComponent();
expect(
findDatePicker()
.props('defaultStartDate')
.toDateString(),
).toBe(dateAtFirstDayOfMonth(CURRENT_DATE).toDateString());
expect(findDatePicker().props('defaultStartDate').toDateString()).toBe(
dateAtFirstDayOfMonth(CURRENT_DATE).toDateString(),
);
});
it("sets the default end date to today's date", () => {
createComponent();
expect(
findDatePicker()
.props('defaultEndDate')
.toDateString(),
).toBe(CURRENT_DATE.toDateString());
expect(findDatePicker().props('defaultEndDate').toDateString()).toBe(
CURRENT_DATE.toDateString(),
);
});
it('passes both startDate and endDate to the date picker as default dates', () => {
......
......@@ -41,11 +41,7 @@ describe('SortingField component', () => {
it('should set the sorting option accordingly', () => {
expect(getCheckedOptions()).toHaveLength(1);
expect(
getCheckedOptions()
.at(0)
.text(),
).toEqual('Oldest created');
expect(getCheckedOptions().at(0).text()).toEqual('Oldest created');
});
});
});
......@@ -53,10 +49,7 @@ describe('SortingField component', () => {
describe('when the user clicks on a option', () => {
beforeEach(() => {
initComponent();
wrapper
.findAll(GlDropdownItem)
.at(1)
.vm.$emit('click');
wrapper.findAll(GlDropdownItem).at(1).vm.$emit('click');
});
it('should emit the "selected" event with clicked option', () => {
......
......@@ -86,10 +86,7 @@ describe('subscription table row', () => {
});
};
const findUsageButton = () =>
findContentCells()
.at(0)
.find('[data-testid="seats-usage-button"]');
const findUsageButton = () => findContentCells().at(0).find('[data-testid="seats-usage-button"]');
describe('dispatched actions', () => {
it('dispatches action when created if namespace is group', () => {
......
......@@ -42,7 +42,7 @@ describe('ee/BoardContentSidebar', () => {
beforeEach(() => {
store = createStore();
store.state.sidebarType = ISSUABLE;
store.state.issues = { '1': { title: 'One', referencePath: 'path', assignees: [] } };
store.state.issues = { 1: { title: 'One', referencePath: 'path', assignees: [] } };
store.state.activeId = '1';
createComponent();
......
......@@ -103,20 +103,14 @@ describe('EpicsSwimlanes', () => {
});
it('makes non preset lists draggable', () => {
expect(
wrapper
.findAll('[data-testid="board-header-container"]')
.at(1)
.classes(),
).toContain('is-draggable');
expect(wrapper.findAll('[data-testid="board-header-container"]').at(1).classes()).toContain(
'is-draggable',
);
});
it('does not make preset lists draggable', () => {
expect(
wrapper
.findAll('[data-testid="board-header-container"]')
.at(0)
.classes(),
wrapper.findAll('[data-testid="board-header-container"]').at(0).classes(),
).not.toContain('is-draggable');
});
});
......
......@@ -25,7 +25,7 @@ describe('BoardSidebarTimeTracker', () => {
beforeEach(() => {
store = createStore();
store.state.issues = {
'1': {
1: {
timeEstimate: 3600,
totalTimeSpent: 1800,
humanTimeEstimate: '1h',
......
......@@ -8,10 +8,7 @@ describe('WeightSelect', () => {
const editButton = () => wrapper.find(GlButton);
const valueContainer = () => wrapper.find('.value');
const weightDropdown = () => wrapper.find(GlDropdown);
const getWeightItemAtIndex = index =>
weightDropdown()
.findAll(GlDropdownItem)
.at(index);
const getWeightItemAtIndex = index => weightDropdown().findAll(GlDropdownItem).at(index);
const defaultProps = {
weights: ['Any', 'None', 0, 1, 2, 3],
board: {
......
......@@ -312,7 +312,9 @@ describe('updateListWipLimit', () => {
.then(() => {
expect(axios.put).toHaveBeenCalledWith(
`${boardsStoreEE.store.state.endpoints.listsEndpoint}/${activeId}`,
{ list: { max_issue_count: maxIssueCount } },
{
list: { max_issue_count: maxIssueCount },
},
);
});
});
......@@ -620,8 +622,8 @@ describe('moveIssue', () => {
};
const issues = {
'436': mockIssue,
'437': mockIssue2,
436: mockIssue,
437: mockIssue2,
};
const state = {
......
......@@ -98,8 +98,8 @@ describe('RECEIVE_ISSUES_FOR_EPIC_SUCCESS', () => {
'gid://gitlab/List/2': [mockIssue2.id],
};
const issues = {
'436': mockIssue,
'437': mockIssue2,
436: mockIssue,
437: mockIssue2,
};
mutations.RECEIVE_ISSUES_FOR_EPIC_SUCCESS(state, {
......@@ -265,8 +265,8 @@ describe('MOVE_ISSUE', () => {
};
const issues = {
'436': mockIssue,
'437': mockIssue2,
436: mockIssue,
437: mockIssue2,
};
state = {
......
......@@ -232,7 +232,11 @@ describe('BurndownChartData', () => {
it('generates an array of arrays with date and issue count', () => {
const { burnupScope } = burndownChartData().generateBurnupTimeseries({ milestoneId });
expect(burnupScope).toEqual([['2017-03-01', 2], ['2017-03-02', 1], ['2017-03-03', 0]]);
expect(burnupScope).toEqual([
['2017-03-01', 2],
['2017-03-02', 1],
['2017-03-03', 0],
]);
});
it('starts from 0', () => {
......@@ -265,7 +269,11 @@ describe('BurndownChartData', () => {
milestoneId,
});
expect(burnupScope).toEqual([['2017-03-01', 0], ['2017-03-02', 0], ['2017-03-03', 0]]);
expect(burnupScope).toEqual([
['2017-03-01', 0],
['2017-03-02', 0],
['2017-03-03', 0],
]);
});
it('ignores removed from other milestones', () => {
......@@ -289,7 +297,11 @@ describe('BurndownChartData', () => {
const { burnupScope } = burndownChartData(events).generateBurnupTimeseries({ milestoneId });
expect(burnupScope).toEqual([['2017-03-01', 1], ['2017-03-02', 1], ['2017-03-03', 1]]);
expect(burnupScope).toEqual([
['2017-03-01', 1],
['2017-03-02', 1],
['2017-03-03', 1],
]);
});
it('only adds milestone event_type', () => {
......@@ -314,7 +326,11 @@ describe('BurndownChartData', () => {
const { burnupScope } = burndownChartData(events).generateBurnupTimeseries({ milestoneId });
expect(burnupScope).toEqual([['2017-03-01', 0], ['2017-03-02', 1], ['2017-03-03', 1]]);
expect(burnupScope).toEqual([
['2017-03-01', 0],
['2017-03-02', 1],
['2017-03-03', 1],
]);
});
it('only removes milestone event_type', () => {
......@@ -345,7 +361,11 @@ describe('BurndownChartData', () => {
const { burnupScope } = burndownChartData(events).generateBurnupTimeseries({ milestoneId });
expect(burnupScope).toEqual([['2017-03-01', 1], ['2017-03-02', 1], ['2017-03-03', 0]]);
expect(burnupScope).toEqual([
['2017-03-01', 1],
['2017-03-02', 1],
['2017-03-03', 0],
]);
});
});
});
......@@ -80,11 +80,7 @@ describe('burndown_chart', () => {
createComponent();
expect(findActiveButtons()).toHaveLength(1);
expect(
findActiveButtons()
.at(0)
.text(),
).toBe('Issues');
expect(findActiveButtons().at(0).text()).toBe('Issues');
expect(findBurndownChart().props('issuesSelected')).toBe(true);
});
......@@ -96,11 +92,7 @@ describe('burndown_chart', () => {
await wrapper.vm.$nextTick();
expect(findActiveButtons()).toHaveLength(1);
expect(
findActiveButtons()
.at(0)
.text(),
).toBe('Issue weight');
expect(findActiveButtons().at(0).text()).toBe('Issue weight');
expect(findBurndownChart().props('issuesSelected')).toBe(false);
});
......
......@@ -34,21 +34,9 @@ describe('Iterations report summary cards', () => {
wrapper = null;
});
const findCompleteCard = () =>
wrapper
.findAll(GlCard)
.at(0)
.text();
const findIncompleteCard = () =>
wrapper
.findAll(GlCard)
.at(1)
.text();
const findUnstartedCard = () =>
wrapper
.findAll(GlCard)
.at(2)
.text();
const findCompleteCard = () => wrapper.findAll(GlCard).at(0).text();
const findIncompleteCard = () => wrapper.findAll(GlCard).at(1).text();
const findUnstartedCard = () => wrapper.findAll(GlCard).at(2).text();
describe('with valid totals', () => {
beforeEach(() => {
......
......@@ -47,11 +47,7 @@ describe('MergeRequest component', () => {
});
it('renders the author avatar', () => {
expect(
findAuthorAvatarLink()
.find(GlAvatar)
.exists(),
).toEqual(true);
expect(findAuthorAvatarLink().find(GlAvatar).exists()).toEqual(true);
});
it('renders the author name', () => {
......
......@@ -204,9 +204,7 @@ describe('DependenciesTable component', () => {
});
it('can be displayed by clicking on the vulnerabilities badge', () => {
const badge = findTableRows()
.at(rowIndexWithVulnerabilities)
.find(GlBadge);
const badge = findTableRows().at(rowIndexWithVulnerabilities).find(GlBadge);
badge.trigger('click');
return nextTick().then(() => {
......
......@@ -816,7 +816,10 @@ describe('Epic Store Actions', () => {
describe('receiveEpicLabelsSelectSuccess', () => {
it('should set provided labels param to `state.labels`', done => {
const labels = [{ id: 1, set: false }, { id: 2, set: true }];
const labels = [
{ id: 1, set: false },
{ id: 2, set: true },
];
testAction(
actions.receiveEpicLabelsSelectSuccess,
......@@ -865,7 +868,10 @@ describe('Epic Store Actions', () => {
});
describe('updateEpicLabels', () => {
const labels = [{ id: 1, set: false }, { id: 2, set: true }];
const labels = [
{ id: 1, set: false },
{ id: 2, set: true },
];
it('dispatches `requestEpicLabelsSelect` and `receiveEpicLabelsSelectSuccess` actions when request succeeds', done => {
jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue(
......
......@@ -371,7 +371,10 @@ describe('Epic Store Mutations', () => {
describe('RECEIVE_EPIC_LABELS_SELECT_SUCCESS', () => {
it('Should update `labels` array on state when new labels are added', () => {
const addedLabels = [{ id: 1, set: true }, { id: 2, set: true }];
const addedLabels = [
{ id: 1, set: true },
{ id: 2, set: true },
];
const state = {
labels: [],
};
......@@ -384,7 +387,10 @@ describe('Epic Store Mutations', () => {
it('Should update `labels` array on state when existing labels are removed', () => {
const removedLabels = [{ id: 1, set: false }];
const state = {
labels: [{ id: 1, set: true }, { id: 2, set: true }],
labels: [
{ id: 1, set: true },
{ id: 2, set: true },
],
};
mutations[types.RECEIVE_EPIC_LABELS_SELECT_SUCCESS](state, removedLabels);
......@@ -396,7 +402,10 @@ describe('Epic Store Mutations', () => {
const removedLabels = [{ id: 1, set: false }];
const addedLabels = [{ id: 3, set: true }];
const state = {
labels: [{ id: 1, set: true }, { id: 2, set: true }],
labels: [
{ id: 1, set: true },
{ id: 2, set: true },
],
};
mutations[types.RECEIVE_EPIC_LABELS_SELECT_SUCCESS](state, [
......@@ -405,7 +414,10 @@ describe('Epic Store Mutations', () => {
]);
expect(state.labels).toEqual(
expect.arrayContaining([{ id: 2, set: true }, { id: 3, set: true }]),
expect.arrayContaining([
{ id: 2, set: true },
{ id: 3, set: true },
]),
);
});
});
......
......@@ -122,11 +122,7 @@ describe('GeoNodeActionsComponent', () => {
describe(`when nodeRemovalAllowed is ${nodeRemovalAllowed}`, () => {
it('has the correct button text', () => {
expect(
findRemoveButton()
.text()
.trim(),
).toBe('Remove');
expect(findRemoveButton().text().trim()).toBe('Remove');
});
it(`the button's disabled attribute should be ${buttonDisabled}`, () => {
......
......@@ -44,23 +44,13 @@ describe('GeoNodeDetailItemComponent', () => {
it('renders container elements correctly', () => {
expect(wrapper.find('.node-detail-item').exists()).toBeTruthy();
expect(wrapper.findAll('.node-detail-title')).not.toHaveLength(0);
expect(
wrapper
.find('.node-detail-title')
.text()
.trim(),
).toBe('GitLab version');
expect(wrapper.find('.node-detail-title').text().trim()).toBe('GitLab version');
});
describe('when plain text value', () => {
it('renders plain item value', () => {
expect(wrapper.findAll('.node-detail-value')).not.toHaveLength(0);
expect(
wrapper
.find('.node-detail-value')
.text()
.trim(),
).toBe('10.4.0-pre');
expect(wrapper.find('.node-detail-value').text().trim()).toBe('10.4.0-pre');
});
it('does not render graph item', () => {
......@@ -140,12 +130,9 @@ describe('GeoNodeDetailItemComponent', () => {
});
it('renders synchronization disabled text', () => {
expect(
wrapper
.find({ ref: 'disabledText' })
.text()
.trim(),
).toBe('Synchronization disabled');
expect(wrapper.find({ ref: 'disabledText' }).text().trim()).toBe(
'Synchronization disabled',
);
});
it('renders GlPopover', () => {
......
......@@ -42,11 +42,7 @@ describe('GeoNodeHealthStatusComponent', () => {
});
it(`sets background of StatusPill to ${healthCssClass} when status is ${status}`, () => {
expect(
findStatusPill()
.classes()
.join(' '),
).toContain(healthCssClass);
expect(findStatusPill().classes().join(' ')).toContain(healthCssClass);
});
it('renders StatusPill correctly', () => {
......
......@@ -56,11 +56,7 @@ describe('GeoNodeReplicationStatusComponent', () => {
});
it(`sets background of StatusPill to ${replicationStatusCssClass} when enabled is ${enabled}`, () => {
expect(
findStatusPill()
.classes()
.join(' '),
).toContain(replicationStatusCssClass);
expect(findStatusPill().classes().join(' ')).toContain(replicationStatusCssClass);
});
it('renders StatusPill correctly', () => {
......
......@@ -134,11 +134,9 @@ describe('NodeDetailsSectionVerification', () => {
});
it('contains text about Replicated data', () => {
expect(
findGlPopover()
.find(GlSprintf)
.attributes('message'),
).toContain('Replicated data is verified');
expect(findGlPopover().find(GlSprintf).attributes('message')).toContain(
'Replicated data is verified',
);
});
});
......
......@@ -69,9 +69,7 @@ describe('GeoReplicableFilterBar', () => {
it('clicking a dropdown item calls setFilter with its index', () => {
const index = 1;
findGlDropdownItems()
.at(index)
.vm.$emit('click');
findGlDropdownItems().at(index).vm.$emit('click');
expect(actionSpies.setFilter).toHaveBeenCalledWith(expect.any(Object), index);
});
......
......@@ -29,11 +29,7 @@ describe('User invites', () => {
});
it('does not set a value', () => {
expect(
inputs()
.at(0)
.attributes('value'),
).toBe(undefined);
expect(inputs().at(0).attributes('value')).toBe(undefined);
});
});
......@@ -49,11 +45,7 @@ describe('User invites', () => {
});
it.each([0, 1, 2])('restores the value of the passed emails', index => {
expect(
inputs()
.at(index)
.attributes('value'),
).toBe(emails[index]);
expect(inputs().at(index).attributes('value')).toBe(emails[index]);
});
});
......@@ -72,11 +64,7 @@ describe('User invites', () => {
});
it.each([0, 1])('does not set a value', index => {
expect(
inputs()
.at(index)
.attributes('value'),
).toBe(undefined);
expect(inputs().at(index).attributes('value')).toBe(undefined);
});
it('sets the focus to the new input field', () => {
......
......@@ -141,11 +141,7 @@ describe('List', () => {
});
it('shows the all tab', () => {
expect(
findTabs()
.at(0)
.attributes('title'),
).toBe('All');
expect(findTabs().at(0).attributes('title')).toBe('All');
});
it('shows the disabled regulated tab', () => {
......
......@@ -37,9 +37,7 @@ describe('CommaSeparatedListTokenSelector', () => {
const findTokenSelectorDropdown = () => findTokenSelector().find('[role="menu"]');
const findErrorMessageText = () =>
findTokenSelector()
.find('[role="menuitem"][disabled="disabled"]')
.text();
findTokenSelector().find('[role="menuitem"][disabled="disabled"]').text();
const setTokenSelectorInputValue = value => {
const tokenSelectorInput = findTokenSelectorInput();
......
......@@ -33,11 +33,7 @@ describe('Incidents Published Cell', () => {
});
it('render a cell with unpublished by default', () => {
expect(
findCell()
.find(GlIcon)
.exists(),
).toBe(false);
expect(findCell().find(GlIcon).exists()).toBe(false);
expect(findCell().text()).toBe('Unpublished');
});
......@@ -45,11 +41,7 @@ describe('Incidents Published Cell', () => {
wrapper.setProps({ statusPagePublishedIncident: true });
return wrapper.vm.$nextTick().then(() => {
expect(
findCell()
.find(GlIcon)
.exists(),
).toBe(true);
expect(findCell().find(GlIcon).exists()).toBe(true);
});
});
});
......
......@@ -87,12 +87,7 @@ describe('Insights component', () => {
it('has the correct nav tabs', async () => {
await wrapper.vm.$nextTick();
expect(wrapper.find(GlDropdown).exists()).toBe(true);
expect(
wrapper
.find(GlDropdown)
.find(GlDropdownItem)
.text(),
).toBe(title);
expect(wrapper.find(GlDropdown).find(GlDropdownItem).text()).toBe(title);
});
it('should not disable the tab selector', async () => {
......@@ -118,12 +113,7 @@ describe('Insights component', () => {
it('has the correct nav tabs', async () => {
await wrapper.vm.$nextTick();
expect(wrapper.find(GlDropdown).exists()).toBe(true);
expect(
wrapper
.find(GlDropdown)
.find(GlDropdownItem)
.text(),
).toBe(title);
expect(wrapper.find(GlDropdown).find(GlDropdownItem).text()).toBe(title);
});
it('disables the tab selector', async () => {
......
......@@ -15,7 +15,10 @@ export const barChartData = {
datasets: [
{
name: 'all',
data: [['January', 1], ['February', 2]],
data: [
['January', 1],
['February', 2],
],
},
],
xAxisTitle: 'Months',
......@@ -26,11 +29,17 @@ export const lineChartData = {
labels: ['January', 'February'],
datasets: [
{
data: [['January', 1], ['February', 2]],
data: [
['January', 1],
['February', 2],
],
name: 'Alpha',
},
{
data: [['January', 1], ['February', 2]],
data: [
['January', 1],
['February', 2],
],
name: 'Beta',
},
],
......
......@@ -266,7 +266,10 @@ describe('Insights store actions', () => {
actions.setActiveTab,
key,
state,
[{ type: 'SET_ACTIVE_TAB', payload: key }, { type: 'SET_ACTIVE_PAGE', payload: page }],
[
{ type: 'SET_ACTIVE_TAB', payload: key },
{ type: 'SET_ACTIVE_PAGE', payload: page },
],
[],
);
});
......
......@@ -10,7 +10,10 @@ describe('Insights helpers', () => {
};
const data = {
labels: ['January', 'February'],
datasets: [{ label: 'Dataset 1', data: [1] }, { label: 'Dataset 2', data: [2] }],
datasets: [
{ label: 'Dataset 1', data: [1] },
{ label: 'Dataset 2', data: [2] },
],
};
expect(transformChartDataForGlCharts(chart, data).xAxisTitle).toEqual('Months');
......@@ -23,7 +26,10 @@ describe('Insights helpers', () => {
};
const data = {
labels: ['January', 'February'],
datasets: [{ label: 'Dataset 1', data: [1] }, { label: 'Dataset 2', data: [2] }],
datasets: [
{ label: 'Dataset 1', data: [1] },
{ label: 'Dataset 2', data: [2] },
],
};
expect(transformChartDataForGlCharts(chart, data).yAxisTitle).toEqual('Issues');
......@@ -36,7 +42,10 @@ describe('Insights helpers', () => {
};
const data = {
labels: ['January', 'February'],
datasets: [{ label: 'Dataset 1', data: [1] }, { label: 'Dataset 2', data: [2] }],
datasets: [
{ label: 'Dataset 1', data: [1] },
{ label: 'Dataset 2', data: [2] },
],
};
expect(transformChartDataForGlCharts(chart, data).datasets).toEqual([
......@@ -52,12 +61,27 @@ describe('Insights helpers', () => {
};
const data = {
labels: ['January', 'February'],
datasets: [{ label: 'Dataset 1', data: [1, 2] }, { label: 'Dataset 2', data: [2, 3] }],
datasets: [
{ label: 'Dataset 1', data: [1, 2] },
{ label: 'Dataset 2', data: [2, 3] },
],
};
expect(transformChartDataForGlCharts(chart, data).datasets).toStrictEqual([
{ name: 'Dataset 1', data: [['January', 1], ['February', 2]] },
{ name: 'Dataset 2', data: [['January', 2], ['February', 3]] },
{
name: 'Dataset 1',
data: [
['January', 1],
['February', 2],
],
},
{
name: 'Dataset 2',
data: [
['January', 2],
['February', 3],
],
},
]);
});
......@@ -72,7 +96,13 @@ describe('Insights helpers', () => {
};
expect(transformChartDataForGlCharts(chart, data).datasets).toEqual([
{ name: 'all', data: [['January', 1], ['February', 2]] },
{
name: 'all',
data: [
['January', 1],
['February', 2],
],
},
]);
});
......@@ -87,7 +117,10 @@ describe('Insights helpers', () => {
};
expect(transformChartDataForGlCharts(chart, data).datasets).toEqual({
all: [['January', 1], ['February', 2]],
all: [
['January', 1],
['February', 2],
],
});
});
});
......
......@@ -107,7 +107,10 @@ describe('Insights mutations', () => {
};
const transformedData = {
datasets: [{ name: 'Dataset 1', data: [1] }, { name: 'Dataset 2', data: [2] }],
datasets: [
{ name: 'Dataset 1', data: [1] },
{ name: 'Dataset 2', data: [2] },
],
labels: ['January', 'February'],
xAxisTitle: 'Months',
yAxisTitle: 'Issues',
......
......@@ -29,12 +29,9 @@ describe('RelatedIssuesList', () => {
});
it('shows weight', () => {
expect(
wrapper
.find(IssueWeight)
.find('.board-card-info-text')
.text(),
).toBe(issuable1.weight.toString());
expect(wrapper.find(IssueWeight).find('.board-card-info-text').text()).toBe(
issuable1.weight.toString(),
);
});
});
});
......@@ -25,19 +25,11 @@ describe('IssuesAnalyticsTable', () => {
const findTable = () => wrapper.find(GlTable);
const findIssueDetailsCol = rowIndex =>
findTable()
.findAll('[data-testid="detailsCol"]')
.at(rowIndex);
const findAgeCol = rowIndex =>
findTable()
.findAll('[data-testid="ageCol"]')
.at(rowIndex);
const findStatusCol = rowIndex =>
findTable()
.findAll('[data-testid="statusCol"]')
.at(rowIndex);
findTable().findAll('[data-testid="detailsCol"]').at(rowIndex);
const findAgeCol = rowIndex => findTable().findAll('[data-testid="ageCol"]').at(rowIndex);
const findStatusCol = rowIndex => findTable().findAll('[data-testid="statusCol"]').at(rowIndex);
beforeEach(() => {
jest.spyOn(Date, 'now').mockImplementation(() => new Date('2020-01-08'));
......
......@@ -91,10 +91,7 @@ describe('Iterations report tabs', () => {
}));
const findIssues = () => wrapper.findAll('table tbody tr');
const findAssigneesForIssue = index =>
findIssues()
.at(index)
.findAll(GlAvatar);
const findAssigneesForIssue = index => findIssues().at(index).findAll(GlAvatar);
beforeEach(() => {
mountComponent();
......
......@@ -279,21 +279,11 @@ describe('Project Licenses', () => {
);
it('it renders the correct count in "Detected in project" tab', () => {
expect(
wrapper
.findAll(GlBadge)
.at(0)
.text(),
).toBe(pageInfo.total.toString());
expect(wrapper.findAll(GlBadge).at(0).text()).toBe(pageInfo.total.toString());
});
it('it renders the correct count in "Policies" tab', () => {
expect(
wrapper
.findAll(GlBadge)
.at(1)
.text(),
).toBe(managedLicenses.length.toString());
expect(wrapper.findAll(GlBadge).at(1).text()).toBe(managedLicenses.length.toString());
});
});
......
......@@ -44,10 +44,7 @@ describe('LdapDropdownItem', () => {
beforeEach(() => {
createComponent();
wrapper
.find(GlDropdownItem)
.find('[role="menuitem"]')
.trigger('click');
wrapper.find(GlDropdownItem).find('[role="menuitem"]').trigger('click');
});
it('calls `updateLdapOverride` action', () => {
......
......@@ -27,9 +27,7 @@ describe('OnDemandScansProfileSelector', () => {
}));
const selectFirstProfile = () => {
return findProfilesDropdown()
.find(GlDropdownItem)
.vm.$emit('click');
return findProfilesDropdown().find(GlDropdownItem).vm.$emit('click');
};
const createFullComponent = (options = {}) => {
......
......@@ -114,9 +114,7 @@ describe('AddEditScheduleForm', () => {
});
it("doesn't have a red border when there is selected option", async () => {
findDropdownOptions()
.at(1)
.vm.$emit('click');
findDropdownOptions().at(1).vm.$emit('click');
await wrapper.vm.$nextTick();
expect(findTimezoneDropdown().classes()).not.toContain('invalid-dropdown');
});
......
......@@ -62,20 +62,14 @@ describe('WeeksHeaderSubItemComponent', () => {
it('sublabel has `label-dark` class when it is for the day greater than current week day', () => {
// Timeframe starts at Jan 1, 2018, faked today is Jan 3, 2018 (3rd item in a week timeframe)
// labels for dates after current have 'label-dark' class
expect(
findSublabelValues()
.at(3)
.classes(),
).toContain('label-dark');
expect(findSublabelValues().at(3).classes()).toContain('label-dark');
});
it("sublabel has `label-dark label-bold` classes when it is for today's date", () => {
// Timeframe starts at Jan 1, 2018, faked today is Jan 3, 2018 (3rd item in a week timeframe)
expect(
findSublabelValues()
.at(2)
.classes(),
).toEqual(expect.arrayContaining(['label-dark', 'label-bold']));
expect(findSublabelValues().at(2).classes()).toEqual(
expect.arrayContaining(['label-dark', 'label-bold']),
);
});
});
});
......@@ -51,20 +51,13 @@ describe('RotationsListSectionComponent', () => {
});
it('renders current day indicator in the first timeline cell', () => {
expect(
findTimelineCells()
.at(0)
.find(CurrentDayIndicator)
.exists(),
).toBe(true);
expect(findTimelineCells().at(0).find(CurrentDayIndicator).exists()).toBe(true);
});
it('render the correct amount of rotation assignees with their name, avatar and color', () => {
expect(findRotationAssignees()).toHaveLength(2);
expect(
findRotationAssignees()
.at(0)
.props().assignee.user,
).toEqual(mockRotations[0].participants.nodes[0].user);
expect(findRotationAssignees().at(0).props().assignee.user).toEqual(
mockRotations[0].participants.nodes[0].user,
);
});
});
......@@ -87,7 +87,9 @@ describe('Reset pipeline minutes button', () => {
expect(axiosSpy).toHaveBeenCalled();
expect($toast.show).toHaveBeenCalledWith(
'There was an error resetting user pipeline minutes.',
{ type: 'error' },
{
type: 'error',
},
);
});
});
......
......@@ -181,12 +181,7 @@ describe('CreateIssueForm', () => {
expect(dropdownItems).toHaveLength(mockProjects.length);
expect(dropdownItems.at(0).text()).toContain(mockProjects[0].name);
expect(dropdownItems.at(0).text()).toContain(mockProjects[0].namespace.name);
expect(
dropdownItems
.at(0)
.find(ProjectAvatar)
.exists(),
).toBe(true);
expect(dropdownItems.at(0).find(ProjectAvatar).exists()).toBe(true);
});
});
......
......@@ -6,11 +6,13 @@ import StateTooltip from 'ee/related_items_tree/components/state_tooltip.vue';
// Ensure that mock dates dynamically computed from today
// so that test doesn't fail at any point in time.
const currentDate = new Date();
const mockCreatedAt = `${currentDate.getFullYear() - 2}-${currentDate.getMonth() +
1}-${currentDate.getDate()}`;
const mockCreatedAt = `${currentDate.getFullYear() - 2}-${
currentDate.getMonth() + 1
}-${currentDate.getDate()}`;
const mockCreatedAtYear = currentDate.getFullYear() - 2;
const mockClosedAt = `${currentDate.getFullYear() - 1}-${currentDate.getMonth() +
1}-${currentDate.getDate()}`;
const mockClosedAt = `${currentDate.getFullYear() - 1}-${
currentDate.getMonth() + 1
}-${currentDate.getDate()}`;
const mockClosedAtYear = currentDate.getFullYear() - 1;
const createComponent = ({
......@@ -156,21 +158,11 @@ describe('RelatedItemsTree', () => {
});
it('renders path in bold', () => {
expect(
wrapper
.find({ ref: 'statePath' })
.text()
.trim(),
).toBe('/foo/bar#1');
expect(wrapper.find({ ref: 'statePath' }).text().trim()).toBe('/foo/bar#1');
});
it('renders stateText in bold', () => {
expect(
wrapper
.find({ ref: 'stateText' })
.text()
.trim(),
).toBe('Closed');
expect(wrapper.find({ ref: 'stateText' }).text().trim()).toBe('Closed');
});
it('renders stateTimeInWords', () => {
......@@ -178,12 +170,7 @@ describe('RelatedItemsTree', () => {
});
it('renders stateTimestamp in muted', () => {
expect(
wrapper
.find({ ref: 'stateTimestamp' })
.text()
.trim(),
).toContain(mockClosedAtYear);
expect(wrapper.find({ ref: 'stateTimestamp' }).text().trim()).toContain(mockClosedAtYear);
});
});
});
......
......@@ -681,7 +681,10 @@ describe('RelatedItemsTree', () => {
describe(types.RECIEVE_PROJECTS_SUCCESS, () => {
it('should set `projectsFetchInProgress` to false and provided `projects` param as it is within the state', () => {
const projects = [{ id: 1, name: 'foo' }, { id: 2, name: 'bar' }];
const projects = [
{ id: 1, name: 'foo' },
{ id: 2, name: 'bar' },
];
mutations[types.RECIEVE_PROJECTS_SUCCESS](state, projects);
......
......@@ -24,7 +24,7 @@ const createComponent = ({
children = [],
childLevel = 0,
childrenEpics = {},
childrenFlags = { '1': { itemExpanded: false } },
childrenFlags = { 1: { itemExpanded: false } },
hasFiltersApplied = false,
} = {}) => {
return mount(EpicItemContainer, {
......@@ -66,8 +66,8 @@ describe('EpicItemContainer', () => {
wrapper = createComponent({
children: [mockFormattedChildEpic1],
childrenFlags: {
'1': { itemExpanded: true },
'50': { itemExpanded: false },
1: { itemExpanded: true },
50: { itemExpanded: false },
},
});
expect(wrapper.find(EpicItem).exists()).toBe(true);
......
......@@ -31,7 +31,7 @@ describe('EpicItemDetails', () => {
currentGroupId: mockGroupId,
timeframeString: 'Jul 10, 2017 – Jun 2, 2018',
childLevel: 0,
childrenFlags: { '41': { itemExpanded: false } },
childrenFlags: { 41: { itemExpanded: false } },
hasFiltersApplied: false,
isChildrenEmpty: false,
...props,
......@@ -203,7 +203,7 @@ describe('EpicItemDetails', () => {
describe('when child epics are expanded', () => {
const childrenFlags = {
'41': { itemExpanded: true },
41: { itemExpanded: true },
};
beforeEach(() => {
......@@ -241,7 +241,7 @@ describe('EpicItemDetails', () => {
describe('when child epics are not expanded', () => {
beforeEach(() => {
const childrenFlags = {
'41': { itemExpanded: false },
41: { itemExpanded: false },
};
createWrapper({
epic,
......
......@@ -35,7 +35,7 @@ const createComponent = ({
currentGroupId = mockGroupId,
childLevel = 0,
childrenEpics = {},
childrenFlags = { '1': { itemExpanded: false } },
childrenFlags = { 1: { itemExpanded: false } },
hasFiltersApplied = false,
}) => {
return mount(EpicItemComponent, {
......@@ -170,11 +170,11 @@ describe('EpicItemComponent', () => {
it('renders Epic item container element with class `epic-list-item-container` if epic has children and is expanded', () => {
wrapper = createComponent({
childrenEpics: {
'1': [mockFormattedChildEpic1],
1: [mockFormattedChildEpic1],
},
childrenFlags: {
'1': { itemExpanded: true },
'50': { itemExpanded: false },
1: { itemExpanded: true },
50: { itemExpanded: false },
},
});
expect(wrapper.find('.epic-list-item-container').exists()).toBe(true);
......
......@@ -172,9 +172,7 @@ describe('MilestonesListSectionComponent', () => {
describe('when the milestone list is expanded', () => {
beforeEach(() => {
findExpandButtonContainer()
.find(GlButton)
.vm.$emit('click');
findExpandButtonContainer().find(GlButton).vm.$emit('click');
return wrapper.vm.$nextTick();
});
......
......@@ -27,7 +27,7 @@ describe('RoadmapShell', () => {
store = createStore();
store.dispatch('setInitialData', {
defaultInnerHeight,
childrenFlags: { '1': { itemExpanded: false } },
childrenFlags: { 1: { itemExpanded: false } },
});
};
......
......@@ -55,10 +55,7 @@ describe('Auto-fix Settings', () => {
const findCheckbox = () => wrapper.find('input[type="checkbox"]');
const findFooter = () => wrapper.find('footer');
const findFooterLinks = () => findFooter().findAll('a');
const getFooterTextContent = () =>
findFooter()
.text()
.trim();
const getFooterTextContent = () => findFooter().text().trim();
const expectCheckboxDisabled = () => expect(findCheckbox().attributes().disabled).toBeTruthy();
......
......@@ -121,27 +121,19 @@ describe('DAST Scanner Profile', () => {
});
it.each(invalidValues)('is marked as invalid provided an invalid value', async value => {
await finder()
.find('input')
.setValue(value);
await finder().find('input').setValue(value);
expect(wrapper.text()).toContain(errorMessage);
});
it('is marked as valid provided a valid value', async () => {
await finder()
.find('input')
.setValue(validValue);
await finder().find('input').setValue(validValue);
expect(wrapper.text()).not.toContain(errorMessage);
});
it('should allow only numbers', async () => {
expect(
finder()
.find('input')
.props('type'),
).toBe('number');
expect(finder().find('input').props('type')).toBe('number');
});
});
......
......@@ -53,11 +53,7 @@ describe('DynamicFields component', () => {
it('passes the disabled prop to child fields', () => {
entities.forEach((entity, i) => {
expect(
findFields()
.at(i)
.props('disabled'),
).toBe(disabled);
expect(findFields().at(i).props('disabled')).toBe(disabled);
});
});
});
......
......@@ -60,11 +60,7 @@ describe('Project List component', () => {
it('renders a project-item with an avatar', () => {
factory({ projects: generateMockProjects(1) });
expect(
getFirstProjectItem()
.find(ProjectAvatar)
.exists(),
).toBe(true);
expect(getFirstProjectItem().find(ProjectAvatar).exists()).toBe(true);
});
it('renders a project-item with a project name', () => {
......
......@@ -9,7 +9,10 @@ localVue.use(Vuex);
describe('Filter component', () => {
const projectId = 1;
const jobs = [{ ref: 'master', name: 'fuzz' }, { ref: 'master', name: 'fuzz 2' }];
const jobs = [
{ ref: 'master', name: 'fuzz' },
{ ref: 'master', name: 'fuzz 2' },
];
let wrapper;
let store;
......
......@@ -76,11 +76,7 @@ describe('Security Dashboard Table Row', () => {
});
it('should render the severity', () => {
expect(
findContent(0)
.text()
.toLowerCase(),
).toContain(vulnerability.severity);
expect(findContent(0).text().toLowerCase()).toContain(vulnerability.severity);
});
it('should render the identifier cell', () => {
......@@ -90,11 +86,9 @@ describe('Security Dashboard Table Row', () => {
});
it('should render the report type', () => {
expect(
findContent(3)
.text()
.toLowerCase(),
).toContain(vulnerability.report_type.toLowerCase());
expect(findContent(3).text().toLowerCase()).toContain(
vulnerability.report_type.toLowerCase(),
);
});
it('should render the scanner vendor if the scanner does exist', () => {
......
......@@ -63,9 +63,7 @@ describe('Selection Summary component', () => {
expect(wrapper.vm.dismissalReason).toBe(null);
expect(wrapper.findAll('option')).toHaveLength(4);
const option = formSelect()
.findAll('option')
.at(1);
const option = formSelect().findAll('option').at(1);
option.setSelected();
formSelect().trigger('change');
......
......@@ -90,9 +90,7 @@ describe('Selection Summary', () => {
selectByIndex(0);
const option = formSelect()
.findAll('option')
.at(1);
const option = formSelect().findAll('option').at(1);
option.setSelected();
formSelect().trigger('change');
......@@ -108,9 +106,7 @@ describe('Selection Summary', () => {
selectByIndex(0);
selectByIndex(1);
const option = formSelect()
.findAll('option')
.at(1);
const option = formSelect().findAll('option').at(1);
option.setSelected();
formSelect().trigger('change');
......
......@@ -86,7 +86,10 @@ describe('EE projectSelector actions', () => {
it(`posts the selected project's ids to the add-endpoint`, () => {
const projectIds = ['1', '2'];
state.selectedProjects = [{ id: projectIds[0], name: '1' }, { id: projectIds[1], name: '2' }];
state.selectedProjects = [
{ id: projectIds[0], name: '1' },
{ id: projectIds[1], name: '2' },
];
state.projectEndpoints.add = mockAddEndpoint;
mockAxios.onPost(mockAddEndpoint).replyOnce(200, mockResponse);
......
......@@ -200,7 +200,10 @@ describe('IterationSelect', () => {
beforeEach(() => {
createComponent({
data: {
iterations: [{ id: 'id', title: 'title' }, { id: '123', title: '123' }],
iterations: [
{ id: 'id', title: 'title' },
{ id: '123', title: '123' },
],
currentIteration: '123',
},
});
......@@ -229,7 +232,10 @@ describe('IterationSelect', () => {
const bootstrapComponent = mutationResp => {
createComponent({
data: {
iterations: [{ id: '123', title: '123' }, { id: 'id', title: 'title' }],
iterations: [
{ id: '123', title: '123' },
{ id: 'id', title: 'title' },
],
currentIteration: '123',
},
mutationPromise: mutationResp,
......
......@@ -222,11 +222,7 @@ describe('Status', () => {
it('shows text to ask the user to pick an option', () => {
const message = 'Assign health status';
expect(
getDropdownElement(wrapper)
.find('.health-title')
.text(),
).toContain(message);
expect(getDropdownElement(wrapper).find('.health-title').text()).toContain(message);
});
it('hides form when the `edit` button is clicked', async () => {
......
......@@ -45,9 +45,7 @@ describe('Usage Statistics component', () => {
it('renders text in total usage card footer', () => {
expect(
getStatisticsCard('totalUsage')
.find('[data-testid="statisticsCardFooter"]')
.text(),
getStatisticsCard('totalUsage').find('[data-testid="statisticsCardFooter"]').text(),
).toMatchInterpolatedText(
'This is the total amount of storage used across your projects within this namespace.',
);
......@@ -55,20 +53,14 @@ describe('Usage Statistics component', () => {
it('renders text in excess usage card footer', () => {
expect(
getStatisticsCard('excessUsage')
.find('[data-testid="statisticsCardFooter"]')
.text(),
getStatisticsCard('excessUsage').find('[data-testid="statisticsCardFooter"]').text(),
).toMatchInterpolatedText(
'This is the total amount of storage used by projects above the free 978.8KiB storage limit.',
);
});
it('renders button in purchased usage card footer', () => {
expect(
getStatisticsCard('purchasedUsage')
.find(GlButton)
.exists(),
).toBe(true);
expect(getStatisticsCard('purchasedUsage').find(GlButton).exists()).toBe(true);
});
});
......
......@@ -56,12 +56,9 @@ describe('Payment Method', () => {
describe('showing the summary', () => {
it('should show the entered credit card details', () => {
expect(
wrapper
.find('.js-summary-line-1')
.html()
.replace(/\s+/g, ' '),
).toContain('Visa ending in <strong>4242</strong>');
expect(wrapper.find('.js-summary-line-1').html().replace(/\s+/g, ' ')).toContain(
'Visa ending in <strong>4242</strong>',
);
});
it('should show the entered credit card expiration date', () => {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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