Commit 21fa9ca4 authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 32 spec files: 7 of 10

Mandatory not to break master. Automatically created with prettier.
parent 8b24c8d6
...@@ -11,23 +11,6 @@ doc/api/graphql/reference/gitlab_schema.graphql ...@@ -11,23 +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:
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/notes
spec/frontend/packages/details/components spec/frontend/packages/details/components
spec/frontend/packages/details/store spec/frontend/packages/details/store
......
...@@ -158,17 +158,11 @@ describe('Incidents List', () => { ...@@ -158,17 +158,11 @@ describe('Incidents List', () => {
describe('Assignees', () => { describe('Assignees', () => {
it('shows Unassigned when there are no assignees', () => { it('shows Unassigned when there are no assignees', () => {
expect( expect(findAssignees().at(0).text()).toBe(I18N.unassigned);
findAssignees()
.at(0)
.text(),
).toBe(I18N.unassigned);
}); });
it('renders an avatar component when there is an assignee', () => { it('renders an avatar component when there is an assignee', () => {
const avatar = findAssignees() const avatar = findAssignees().at(1).find(GlAvatar);
.at(1)
.find(GlAvatar);
const { src, label } = avatar.attributes(); const { src, label } = avatar.attributes();
const { name, avatarUrl } = mockIncidents[1].assignees.nodes[0]; const { name, avatarUrl } = mockIncidents[1].assignees.nodes[0];
...@@ -189,9 +183,7 @@ describe('Incidents List', () => { ...@@ -189,9 +183,7 @@ describe('Incidents List', () => {
}); });
it('contains a link to the incident details page', async () => { it('contains a link to the incident details page', async () => {
findTableRows() findTableRows().at(0).trigger('click');
.at(0)
.trigger('click');
expect(visitUrl).toHaveBeenCalledWith( expect(visitUrl).toHaveBeenCalledWith(
joinPaths(`/project/issues/incident`, mockIncidents[0].iid), joinPaths(`/project/issues/incident`, mockIncidents[0].iid),
); );
......
...@@ -42,16 +42,9 @@ describe('IncidentsSettingTabs', () => { ...@@ -42,16 +42,9 @@ describe('IncidentsSettingTabs', () => {
const activeTabs = wrapper.vm.$options.tabs.filter(tab => tab.active); const activeTabs = wrapper.vm.$options.tabs.filter(tab => tab.active);
expect(findIntegrationTabs().length).toBe(activeTabs.length); expect(findIntegrationTabs().length).toBe(activeTabs.length);
activeTabs.forEach((tab, index) => { activeTabs.forEach((tab, index) => {
expect(findIntegrationTabs().at(index).attributes('title')).toBe(tab.title);
expect( expect(
findIntegrationTabs() findIntegrationTabs().at(index).find(`[data-testid="${tab.component}-tab"]`).exists(),
.at(index)
.attributes('title'),
).toBe(tab.title);
expect(
findIntegrationTabs()
.at(index)
.find(`[data-testid="${tab.component}-tab"]`)
.exists(),
).toBe(true); ).toBe(true);
}); });
}); });
......
...@@ -57,9 +57,7 @@ describe('JiraTriggerFields', () => { ...@@ -57,9 +57,7 @@ describe('JiraTriggerFields', () => {
// browsers don't include unchecked boxes in form submissions. // browsers don't include unchecked boxes in form submissions.
it('includes comment settings as false even if unchecked', () => { it('includes comment settings as false even if unchecked', () => {
expect( expect(
findCommentSettings() findCommentSettings().find('input[name="service[comment_on_event_enabled]"]').exists(),
.find('input[name="service[comment_on_event_enabled]"]')
.exists(),
).toBe(true); ).toBe(true);
}); });
......
...@@ -130,10 +130,7 @@ describe('RelatedIssuesBlock', () => { ...@@ -130,10 +130,7 @@ describe('RelatedIssuesBlock', () => {
describe('showCategorizedIssues prop', () => { describe('showCategorizedIssues prop', () => {
const issueList = () => wrapper.findAll('.js-related-issues-token-list-item'); const issueList = () => wrapper.findAll('.js-related-issues-token-list-item');
const categorizedHeadings = () => wrapper.findAll('h4'); const categorizedHeadings = () => wrapper.findAll('h4');
const headingTextAt = index => const headingTextAt = index => categorizedHeadings().at(index).text();
categorizedHeadings()
.at(index)
.text();
const mountComponent = showCategorizedIssues => { const mountComponent = showCategorizedIssues => {
wrapper = mount(RelatedIssuesBlock, { wrapper = mount(RelatedIssuesBlock, {
propsData: { propsData: {
......
...@@ -182,12 +182,7 @@ describe('RelatedIssuesList', () => { ...@@ -182,12 +182,7 @@ describe('RelatedIssuesList', () => {
}); });
it('shows due date', () => { it('shows due date', () => {
expect( expect(wrapper.find(IssueDueDate).find('.board-card-info-text').text()).toBe('Nov 22, 2010');
wrapper
.find(IssueDueDate)
.find('.board-card-info-text')
.text(),
).toBe('Nov 22, 2010');
}); });
}); });
}); });
...@@ -315,9 +315,7 @@ describe('RelatedIssuesRoot', () => { ...@@ -315,9 +315,7 @@ describe('RelatedIssuesRoot', () => {
const input = 23; const input = 23;
wrapper.vm.onInput({ wrapper.vm.onInput({
untouchedRawReferences: String(input) untouchedRawReferences: String(input).trim().split(/\s/),
.trim()
.split(/\s/),
touchedReference: input, touchedReference: input,
}); });
......
...@@ -252,12 +252,9 @@ describe('IssuableItem', () => { ...@@ -252,12 +252,9 @@ describe('IssuableItem', () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect( expect(wrapper.find('[data-testid="issuable-title"]').find(GlLink).attributes('target')).toBe(
wrapper '_blank',
.find('[data-testid="issuable-title"]') );
.find(GlLink)
.attributes('target'),
).toBe('_blank');
}); });
it('renders issuable reference', () => { it('renders issuable reference', () => {
......
...@@ -98,10 +98,7 @@ describe('IssuableBody', () => { ...@@ -98,10 +98,7 @@ describe('IssuableBody', () => {
it('renders issuable edit info', () => { it('renders issuable edit info', () => {
const editedEl = wrapper.find('small'); const editedEl = wrapper.find('small');
const sanitizedText = editedEl const sanitizedText = editedEl.text().replace(/\n/g, ' ').replace(/\s+/g, ' ');
.text()
.replace(/\n/g, ' ')
.replace(/\s+/g, ' ');
expect(sanitizedText).toContain('Edited'); expect(sanitizedText).toContain('Edited');
expect(sanitizedText).toContain('ago'); expect(sanitizedText).toContain('ago');
......
...@@ -85,12 +85,7 @@ describe('Issuable suggestions app component', () => { ...@@ -85,12 +85,7 @@ describe('Issuable suggestions app component', () => {
wrapper.setData(data); wrapper.setData(data);
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect( expect(wrapper.findAll('li').at(0).classes()).toContain('gl-mb-3');
wrapper
.findAll('li')
.at(0)
.classes(),
).toContain('gl-mb-3');
}); });
}); });
...@@ -98,12 +93,7 @@ describe('Issuable suggestions app component', () => { ...@@ -98,12 +93,7 @@ describe('Issuable suggestions app component', () => {
wrapper.setData(data); wrapper.setData(data);
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect( expect(wrapper.findAll('li').at(1).classes()).not.toContain('gl-mb-3');
wrapper
.findAll('li')
.at(1)
.classes(),
).not.toContain('gl-mb-3');
}); });
}); });
}); });
......
...@@ -70,10 +70,7 @@ describe('HeaderActions component', () => { ...@@ -70,10 +70,7 @@ describe('HeaderActions component', () => {
const findModal = () => wrapper.find(GlModal); const findModal = () => wrapper.find(GlModal);
const findModalLinkAt = index => const findModalLinkAt = index => findModal().findAll(GlLink).at(index);
findModal()
.findAll(GlLink)
.at(index);
const mountComponent = ({ const mountComponent = ({
props = {}, props = {},
......
...@@ -26,11 +26,7 @@ describe('PinnedLinks', () => { ...@@ -26,11 +26,7 @@ describe('PinnedLinks', () => {
zoomMeetingUrl: `<a href="${plainZoomUrl}">Zoom</a>`, zoomMeetingUrl: `<a href="${plainZoomUrl}">Zoom</a>`,
}); });
expect( expect(findButtons().at(0).text()).toBe(JOIN_ZOOM_MEETING);
findButtons()
.at(0)
.text(),
).toBe(JOIN_ZOOM_MEETING);
}); });
it('displays Status link', () => { it('displays Status link', () => {
...@@ -38,11 +34,7 @@ describe('PinnedLinks', () => { ...@@ -38,11 +34,7 @@ describe('PinnedLinks', () => {
publishedIncidentUrl: `<a href="${plainStatusUrl}">Status</a>`, publishedIncidentUrl: `<a href="${plainStatusUrl}">Status</a>`,
}); });
expect( expect(findButtons().at(0).text()).toBe(STATUS_PAGE_PUBLISHED);
findButtons()
.at(0)
.text(),
).toBe(STATUS_PAGE_PUBLISHED);
}); });
it('does not render if there are no links', () => { it('does not render if there are no links', () => {
......
...@@ -238,15 +238,15 @@ describe('Issuables list component', () => { ...@@ -238,15 +238,15 @@ describe('Issuables list component', () => {
wrapper.vm.onSelectIssuable({ issuable: i0, selected: false }); wrapper.vm.onSelectIssuable({ issuable: i0, selected: false });
expect(wrapper.vm.selection).toEqual({}); expect(wrapper.vm.selection).toEqual({});
wrapper.vm.onSelectIssuable({ issuable: i1, selected: true }); wrapper.vm.onSelectIssuable({ issuable: i1, selected: true });
expect(wrapper.vm.selection).toEqual({ '1': true }); expect(wrapper.vm.selection).toEqual({ 1: true });
wrapper.vm.onSelectIssuable({ issuable: i0, selected: true }); wrapper.vm.onSelectIssuable({ issuable: i0, selected: true });
expect(wrapper.vm.selection).toEqual({ '1': true, '0': true }); expect(wrapper.vm.selection).toEqual({ 1: true, 0: true });
wrapper.vm.onSelectIssuable({ issuable: i2, selected: true }); wrapper.vm.onSelectIssuable({ issuable: i2, selected: true });
expect(wrapper.vm.selection).toEqual({ '1': true, '0': true, '2': true }); expect(wrapper.vm.selection).toEqual({ 1: true, 0: true, 2: true });
wrapper.vm.onSelectIssuable({ issuable: i2, selected: true }); wrapper.vm.onSelectIssuable({ issuable: i2, selected: true });
expect(wrapper.vm.selection).toEqual({ '1': true, '0': true, '2': true }); expect(wrapper.vm.selection).toEqual({ 1: true, 0: true, 2: true });
wrapper.vm.onSelectIssuable({ issuable: i0, selected: false }); wrapper.vm.onSelectIssuable({ issuable: i0, selected: false });
expect(wrapper.vm.selection).toEqual({ '1': true, '2': true }); expect(wrapper.vm.selection).toEqual({ 1: true, 2: true });
}); });
it('broadcasts a message to the bulk edit sidebar when a value is added to selection', () => { it('broadcasts a message to the bulk edit sidebar when a value is added to selection', () => {
......
...@@ -46,11 +46,7 @@ describe('Empty State', () => { ...@@ -46,11 +46,7 @@ describe('Empty State', () => {
}); });
it('renders provided title', () => { it('renders provided title', () => {
expect( expect(findTitle().text().trim()).toBe(defaultProps.title);
findTitle()
.text()
.trim(),
).toBe(defaultProps.title);
}); });
}); });
...@@ -60,11 +56,7 @@ describe('Empty State', () => { ...@@ -60,11 +56,7 @@ describe('Empty State', () => {
}); });
it('renders content', () => { it('renders content', () => {
expect( expect(findContent().text().trim()).toBe(content);
findContent()
.text()
.trim(),
).toBe(content);
}); });
}); });
......
...@@ -133,13 +133,9 @@ describe('Job App', () => { ...@@ -133,13 +133,9 @@ describe('Job App', () => {
}); });
it('should render provided job information', () => { it('should render provided job information', () => {
expect( expect(wrapper.find('.header-main-content').text().replace(/\s+/g, ' ').trim()).toContain(
wrapper 'passed Job #4757 triggered 1 year ago by Root',
.find('.header-main-content') );
.text()
.replace(/\s+/g, ' ')
.trim(),
).toContain('passed Job #4757 triggered 1 year ago by Root');
}); });
it('should render new issue link', () => { it('should render new issue link', () => {
...@@ -151,11 +147,7 @@ describe('Job App', () => { ...@@ -151,11 +147,7 @@ describe('Job App', () => {
it('should render created key', () => it('should render created key', () =>
setupAndMount().then(() => { setupAndMount().then(() => {
expect( expect(
wrapper wrapper.find('.header-main-content').text().replace(/\s+/g, ' ').trim(),
.find('.header-main-content')
.text()
.replace(/\s+/g, ' ')
.trim(),
).toContain('passed Job #4757 created 3 weeks ago by Root'); ).toContain('passed Job #4757 created 3 weeks ago by Root');
})); }));
}); });
......
...@@ -34,10 +34,7 @@ describe('Job Log Line', () => { ...@@ -34,10 +34,7 @@ describe('Job Log Line', () => {
const findLine = () => wrapper.find('span'); const findLine = () => wrapper.find('span');
const findLink = () => findLine().find('a'); const findLink = () => findLine().find('a');
const findLinks = () => findLine().findAll('a'); const findLinks = () => findLine().findAll('a');
const findLinkAttributeByIndex = i => const findLinkAttributeByIndex = i => findLinks().at(i).attributes();
findLinks()
.at(i)
.attributes();
beforeEach(() => { beforeEach(() => {
data = mockProps(); data = mockProps();
......
...@@ -62,11 +62,7 @@ describe('Job Log', () => { ...@@ -62,11 +62,7 @@ describe('Job Log', () => {
}); });
it('renders an icon with the open state', () => { it('renders an icon with the open state', () => {
expect( expect(findCollapsibleLine().find('[data-testid="angle-down-icon"]').exists()).toBe(true);
findCollapsibleLine()
.find('[data-testid="angle-down-icon"]')
.exists(),
).toBe(true);
}); });
describe('on click header section', () => { describe('on click header section', () => {
......
...@@ -3,7 +3,11 @@ import { firstAndLastY } from '~/lib/utils/chart_utils'; ...@@ -3,7 +3,11 @@ import { firstAndLastY } from '~/lib/utils/chart_utils';
describe('Chart utils', () => { describe('Chart utils', () => {
describe('firstAndLastY', () => { describe('firstAndLastY', () => {
it('returns the first and last y-values of a given data set as an array', () => { it('returns the first and last y-values of a given data set as an array', () => {
const data = [['', 1], ['', 2], ['', 3]]; const data = [
['', 1],
['', 2],
['', 3],
];
expect(firstAndLastY(data)).toEqual([1, 3]); expect(firstAndLastY(data)).toEqual([1, 3]);
}); });
......
...@@ -181,11 +181,7 @@ describe('EnvironmentLogs', () => { ...@@ -181,11 +181,7 @@ describe('EnvironmentLogs', () => {
it('shows a logs trace', () => { it('shows a logs trace', () => {
expect(findLogTrace().text()).toBe(''); expect(findLogTrace().text()).toBe('');
expect( expect(findLogTrace().find('.js-build-loader-animation').isVisible()).toBe(true);
findLogTrace()
.find('.js-build-loader-animation')
.isVisible(),
).toBe(true);
}); });
}); });
......
...@@ -57,10 +57,8 @@ describe('ResendInviteButton', () => { ...@@ -57,10 +57,8 @@ describe('ResendInviteButton', () => {
it('displays form with correct action and inputs', () => { it('displays form with correct action and inputs', () => {
expect(findForm().attributes('action')).toBe('/groups/foo-bar/-/group_members/1/resend_invite'); expect(findForm().attributes('action')).toBe('/groups/foo-bar/-/group_members/1/resend_invite');
expect( expect(findForm().find('input[name="authenticity_token"]').attributes('value')).toBe(
findForm() 'mock-csrf-token',
.find('input[name="authenticity_token"]') );
.attributes('value'),
).toBe('mock-csrf-token');
}); });
}); });
...@@ -86,7 +86,10 @@ describe('MembersFilteredSearchBar', () => { ...@@ -86,7 +86,10 @@ describe('MembersFilteredSearchBar', () => {
token: GlFilteredSearchToken, token: GlFilteredSearchToken,
unique: true, unique: true,
operators: [{ value: '=', description: 'is' }], operators: [{ value: '=', description: 'is' }],
options: [{ value: 'exclude', title: 'Direct' }, { value: 'only', title: 'Inherited' }], options: [
{ value: 'exclude', title: 'Direct' },
{ value: 'only', title: 'Inherited' },
],
}, },
]); ]);
}); });
......
...@@ -72,11 +72,9 @@ describe('ExpirationDatepicker', () => { ...@@ -72,11 +72,9 @@ describe('ExpirationDatepicker', () => {
}); });
it('sets `minDate` prop as tomorrow', () => { it('sets `minDate` prop as tomorrow', () => {
expect( expect(findDatepicker().props('minDate').toISOString()).toBe(
findDatepicker() new Date('2020-3-16').toISOString(),
.props('minDate') );
.toISOString(),
).toBe(new Date('2020-3-16').toISOString());
}); });
it('sets `target` prop as `null` so datepicker opens on focus', () => { it('sets `target` prop as `null` so datepicker opens on focus', () => {
......
...@@ -100,10 +100,7 @@ describe('MembersTable', () => { ...@@ -100,10 +100,7 @@ describe('MembersTable', () => {
if (expectedComponent) { if (expectedComponent) {
expect( expect(
wrapper wrapper.find(`[data-label="${label}"][role="cell"]`).find(expectedComponent).exists(),
.find(`[data-label="${label}"][role="cell"]`)
.find(expectedComponent)
.exists(),
).toBe(true); ).toBe(true);
} }
}); });
...@@ -117,10 +114,7 @@ describe('MembersTable', () => { ...@@ -117,10 +114,7 @@ describe('MembersTable', () => {
expect(actionField.exists()).toBe(true); expect(actionField.exists()).toBe(true);
expect(actionField.classes('gl-sr-only')).toBe(true); expect(actionField.classes('gl-sr-only')).toBe(true);
expect( expect(
wrapper wrapper.find(`[data-label="Actions"][role="cell"]`).find(MemberActionButtons).exists(),
.find(`[data-label="Actions"][role="cell"]`)
.find(MemberActionButtons)
.exists(),
).toBe(true); ).toBe(true);
}); });
...@@ -177,12 +171,9 @@ describe('MembersTable', () => { ...@@ -177,12 +171,9 @@ describe('MembersTable', () => {
it('renders badge in "Max role" field', () => { it('renders badge in "Max role" field', () => {
createComponent({ members: [memberMock], tableFields: ['maxRole'] }); createComponent({ members: [memberMock], tableFields: ['maxRole'] });
expect( expect(wrapper.find(`[data-label="Max role"][role="cell"]`).find(GlBadge).text()).toBe(
wrapper memberMock.accessLevel.stringValue,
.find(`[data-label="Max role"][role="cell"]`) );
.find(GlBadge)
.text(),
).toBe(memberMock.accessLevel.stringValue);
}); });
}); });
...@@ -203,10 +194,6 @@ describe('MembersTable', () => { ...@@ -203,10 +194,6 @@ describe('MembersTable', () => {
it('adds QA selector to table row', () => { it('adds QA selector to table row', () => {
createComponent(); createComponent();
expect( expect(findTable().find('tbody tr').attributes('data-qa-selector')).toBe('member_row');
findTable()
.find('tbody tr')
.attributes('data-qa-selector'),
).toBe('member_row');
}); });
}); });
...@@ -336,9 +336,7 @@ describe('Milestone combobox component', () => { ...@@ -336,9 +336,7 @@ describe('Milestone combobox component', () => {
await localVue.nextTick(); await localVue.nextTick();
expect( expect(
findFirstProjectMilestonesDropdownItem() findFirstProjectMilestonesDropdownItem().find('span').classes('selected-item'),
.find('span')
.classes('selected-item'),
).toBe(false); ).toBe(false);
selectFirstProjectMilestone(); selectFirstProjectMilestone();
...@@ -346,9 +344,7 @@ describe('Milestone combobox component', () => { ...@@ -346,9 +344,7 @@ describe('Milestone combobox component', () => {
await localVue.nextTick(); await localVue.nextTick();
expect( expect(
findFirstProjectMilestonesDropdownItem() findFirstProjectMilestonesDropdownItem().find('span').classes('selected-item'),
.find('span')
.classes('selected-item'),
).toBe(true); ).toBe(true);
}); });
...@@ -465,21 +461,17 @@ describe('Milestone combobox component', () => { ...@@ -465,21 +461,17 @@ describe('Milestone combobox component', () => {
await localVue.nextTick(); await localVue.nextTick();
expect( expect(findFirstGroupMilestonesDropdownItem().find('span').classes('selected-item')).toBe(
findFirstGroupMilestonesDropdownItem() false,
.find('span') );
.classes('selected-item'),
).toBe(false);
selectFirstGroupMilestone(); selectFirstGroupMilestone();
await localVue.nextTick(); await localVue.nextTick();
expect( expect(findFirstGroupMilestonesDropdownItem().find('span').classes('selected-item')).toBe(
findFirstGroupMilestonesDropdownItem() true,
.find('span') );
.classes('selected-item'),
).toBe(true);
}); });
describe('when a group milestones is selected', () => { describe('when a group milestones is selected', () => {
......
...@@ -28,12 +28,20 @@ describe('AlertWidget', () => { ...@@ -28,12 +28,20 @@ describe('AlertWidget', () => {
const nonFiringAlertResult = [ const nonFiringAlertResult = [
{ {
values: [[0, 1], [1, 42], [2, 41]], values: [
[0, 1],
[1, 42],
[2, 41],
],
}, },
]; ];
const firingAlertResult = [ const firingAlertResult = [
{ {
values: [[0, 42], [1, 43], [2, 44]], values: [
[0, 42],
[1, 43],
[2, 44],
],
}, },
]; ];
const metricId = '5'; const metricId = '5';
...@@ -88,10 +96,7 @@ describe('AlertWidget', () => { ...@@ -88,10 +96,7 @@ describe('AlertWidget', () => {
const findWidgetForm = () => wrapper.find({ ref: 'widgetForm' }); const findWidgetForm = () => wrapper.find({ ref: 'widgetForm' });
const findAlertErrorMessage = () => wrapper.find({ ref: 'alertErrorMessage' }); const findAlertErrorMessage = () => wrapper.find({ ref: 'alertErrorMessage' });
const findCurrentSettingsText = () => const findCurrentSettingsText = () =>
wrapper wrapper.find({ ref: 'alertCurrentSetting' }).text().replace(/\s\s+/g, ' ');
.find({ ref: 'alertCurrentSetting' })
.text()
.replace(/\s\s+/g, ' ');
const findBadge = () => wrapper.find(GlBadge); const findBadge = () => wrapper.find(GlBadge);
const findTooltip = () => wrapper.find(GlTooltip); const findTooltip = () => wrapper.find(GlTooltip);
...@@ -300,11 +305,7 @@ describe('AlertWidget', () => { ...@@ -300,11 +305,7 @@ describe('AlertWidget', () => {
createComponent(propsWithManyAlerts); createComponent(propsWithManyAlerts);
return waitForPromises().then(() => { return waitForPromises().then(() => {
expect( expect(findTooltip().text().replace(/\s\s+/g, ' ')).toEqual('Firing: alert-label > 42');
findTooltip()
.text()
.replace(/\s\s+/g, ' '),
).toEqual('Firing: alert-label > 42');
}); });
}); });
}); });
......
...@@ -777,11 +777,7 @@ describe('Dashboard Panel', () => { ...@@ -777,11 +777,7 @@ describe('Dashboard Panel', () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(findRunbookLinks().length).toBe(1); expect(findRunbookLinks().length).toBe(1);
expect( expect(findRunbookLinks().at(0).attributes('href')).toBe(invalidUrl);
findRunbookLinks()
.at(0)
.attributes('href'),
).toBe(invalidUrl);
}); });
}); });
}); });
......
...@@ -587,12 +587,9 @@ describe('Dashboard', () => { ...@@ -587,12 +587,9 @@ describe('Dashboard', () => {
}); });
it('group empty area displays a NO_DATA state', () => { it('group empty area displays a NO_DATA state', () => {
expect( expect(wrapper.findAll({ ref: 'empty-group' }).at(0).props('selectedState')).toEqual(
wrapper metricStates.NO_DATA,
.findAll({ ref: 'empty-group' }) );
.at(0)
.props('selectedState'),
).toEqual(metricStates.NO_DATA);
}); });
}); });
...@@ -634,9 +631,7 @@ describe('Dashboard', () => { ...@@ -634,9 +631,7 @@ describe('Dashboard', () => {
describe('when rearrange button is clicked', () => { describe('when rearrange button is clicked', () => {
const findFirstDraggableRemoveButton = () => const findFirstDraggableRemoveButton = () =>
findDraggablePanels() findDraggablePanels().at(0).find('.js-draggable-remove');
.at(0)
.find('.js-draggable-remove');
beforeEach(() => { beforeEach(() => {
findRearrangeButton().vm.$emit('click'); findRearrangeButton().vm.$emit('click');
...@@ -668,11 +663,7 @@ describe('Dashboard', () => { ...@@ -668,11 +663,7 @@ describe('Dashboard', () => {
}); });
it('shows a remove button, which removes a panel', () => { it('shows a remove button, which removes a panel', () => {
expect( expect(findFirstDraggableRemoveButton().find('a').exists()).toBe(true);
findFirstDraggableRemoveButton()
.find('a')
.exists(),
).toBe(true);
expect(findDraggablePanels().length).toEqual(metricsDashboardPanelCount); expect(findDraggablePanels().length).toEqual(metricsDashboardPanelCount);
findFirstDraggableRemoveButton().trigger('click'); findFirstDraggableRemoveButton().trigger('click');
...@@ -772,10 +763,7 @@ describe('Dashboard', () => { ...@@ -772,10 +763,7 @@ describe('Dashboard', () => {
const panelIndex = 1; // skip expanded panel const panelIndex = 1; // skip expanded panel
const getClipboardTextFirstPanel = () => const getClipboardTextFirstPanel = () =>
wrapper wrapper.findAll(DashboardPanel).at(panelIndex).props('clipboardText');
.findAll(DashboardPanel)
.at(panelIndex)
.props('clipboardText');
beforeEach(() => { beforeEach(() => {
setupStoreWithData(store); setupStoreWithData(store);
......
...@@ -101,9 +101,7 @@ describe('duplicate dashboard modal', () => { ...@@ -101,9 +101,7 @@ describe('duplicate dashboard modal', () => {
commitMessage: 'A commit message', commitMessage: 'A commit message',
}; };
findModal() findModal().find(DuplicateDashboardForm).vm.$emit('change', formVals);
.find(DuplicateDashboardForm)
.vm.$emit('change', formVals);
// Binding's second argument contains the modal id // Binding's second argument contains the modal id
expect(wrapper.vm.form).toEqual(formVals); expect(wrapper.vm.form).toEqual(formVals);
......
...@@ -10,7 +10,10 @@ describe('Custom variable component', () => { ...@@ -10,7 +10,10 @@ describe('Custom variable component', () => {
label: 'Select environment', label: 'Select environment',
value: 'Production', value: 'Production',
options: { options: {
values: [{ text: 'Production', value: 'prod' }, { text: 'Canary', value: 'canary' }], values: [
{ text: 'Production', value: 'prod' },
{ text: 'Canary', value: 'canary' },
],
}, },
}; };
...@@ -54,9 +57,7 @@ describe('Custom variable component', () => { ...@@ -54,9 +57,7 @@ describe('Custom variable component', () => {
createShallowWrapper(); createShallowWrapper();
jest.spyOn(wrapper.vm, '$emit'); jest.spyOn(wrapper.vm, '$emit');
findDropdownItems() findDropdownItems().at(1).vm.$emit('click');
.at(1)
.vm.$emit('click');
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(wrapper.vm.$emit).toHaveBeenCalledWith('input', 'canary'); expect(wrapper.vm.$emit).toHaveBeenCalledWith('input', 'canary');
......
...@@ -63,12 +63,7 @@ describe('Monitoring router', () => { ...@@ -63,12 +63,7 @@ describe('Monitoring router', () => {
}); });
expect(wrapper.find(DashboardPage).exists()).toBe(true); expect(wrapper.find(DashboardPage).exists()).toBe(true);
expect( expect(wrapper.find(DashboardPage).find(Dashboard).exists()).toBe(true);
wrapper
.find(DashboardPage)
.find(Dashboard)
.exists(),
).toBe(true);
}); });
}); });
...@@ -91,12 +86,7 @@ describe('Monitoring router', () => { ...@@ -91,12 +86,7 @@ describe('Monitoring router', () => {
}); });
expect(wrapper.find(DashboardPage).exists()).toBe(true); expect(wrapper.find(DashboardPage).exists()).toBe(true);
expect( expect(wrapper.find(DashboardPage).find(Dashboard).exists()).toBe(true);
wrapper
.find(DashboardPage)
.find(Dashboard)
.exists(),
).toBe(true);
}); });
}); });
......
...@@ -465,7 +465,10 @@ describe('Monitoring mutations', () => { ...@@ -465,7 +465,10 @@ describe('Monitoring mutations', () => {
}); });
expect(variable.options).toEqual({ expect(variable.options).toEqual({
values: [{ text: 'prometheus', value: 'prometheus' }, { text: 'node', value: 'node' }], values: [
{ text: 'prometheus', value: 'prometheus' },
{ text: 'node', value: 'node' },
],
}); });
}); });
}); });
......
...@@ -775,7 +775,11 @@ describe('normalizeQueryResponseData', () => { ...@@ -775,7 +775,11 @@ describe('normalizeQueryResponseData', () => {
job: 'prometheus', job: 'prometheus',
instance: 'localhost:9090', instance: 'localhost:9090',
}, },
values: [[1435781430.781, '1'], [1435781445.781, '2'], [1435781460.781, '3']], values: [
[1435781430.781, '1'],
[1435781445.781, '2'],
[1435781460.781, '3'],
],
}, },
{ {
metric: { metric: {
...@@ -783,7 +787,11 @@ describe('normalizeQueryResponseData', () => { ...@@ -783,7 +787,11 @@ describe('normalizeQueryResponseData', () => {
job: 'node', job: 'node',
instance: 'localhost:9091', instance: 'localhost:9091',
}, },
values: [[1435781430.781, '4'], [1435781445.781, '5'], [1435781460.781, '6']], values: [
[1435781430.781, '4'],
[1435781445.781, '5'],
[1435781460.781, '6'],
],
}, },
], ],
}; };
...@@ -840,7 +848,10 @@ describe('normalizeQueryResponseData', () => { ...@@ -840,7 +848,10 @@ describe('normalizeQueryResponseData', () => {
job: 'prometheus', job: 'prometheus',
instance: 'localhost:9090', instance: 'localhost:9090',
}, },
values: [[1435781430.781, '1'], [1435781460.781, 'NaN']], values: [
[1435781430.781, '1'],
[1435781460.781, 'NaN'],
],
}, },
], ],
}; };
...@@ -849,7 +860,10 @@ describe('normalizeQueryResponseData', () => { ...@@ -849,7 +860,10 @@ describe('normalizeQueryResponseData', () => {
{ {
metric: { __name__: 'up', instance: 'localhost:9090', job: 'prometheus' }, metric: { __name__: 'up', instance: 'localhost:9090', job: 'prometheus' },
value: ['2015-07-01T20:11:00.781Z', NaN], value: ['2015-07-01T20:11:00.781Z', NaN],
values: [['2015-07-01T20:10:30.781Z', 1], ['2015-07-01T20:11:00.781Z', NaN]], values: [
['2015-07-01T20:10:30.781Z', 1],
['2015-07-01T20:11:00.781Z', NaN],
],
}, },
]); ]);
}); });
......
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