Commit ed189d0e authored by Lukas Eipert's avatar Lukas Eipert

Run prettier on 30 spec files: 2 of 10

Mandatory not to break master. Automatically created with prettier.
parent 6e183d50
...@@ -11,17 +11,6 @@ doc/api/graphql/reference/gitlab_schema.graphql ...@@ -11,17 +11,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.md *.md
# temporarly ignored in order to migrate to prettier@2 more efficiently and iteratively: # temporarly ignored in order to migrate to prettier@2 more efficiently and iteratively:
ee/spec/frontend/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/components
ee/spec/frontend/groups/settings/ ee/spec/frontend/groups/settings/
ee/spec/frontend/incidents/components ee/spec/frontend/incidents/components
......
...@@ -216,10 +216,9 @@ describe('EE Approvals App', () => { ...@@ -216,10 +216,9 @@ describe('EE Approvals App', () => {
findResetButton().vm.$emit('click'); findResetButton().vm.$emit('click');
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(store.modules.approvals.actions.fetchRules).toHaveBeenLastCalledWith( expect(
expect.anything(), store.modules.approvals.actions.fetchRules,
{ targetBranch, resetToDefault: true }, ).toHaveBeenLastCalledWith(expect.anything(), { targetBranch, resetToDefault: true });
);
expect(showToast).toHaveBeenCalledWith('Approval rules reset to project defaults', { expect(showToast).toHaveBeenCalledWith('Approval rules reset to project defaults', {
action: { action: {
text: 'Undo', text: 'Undo',
......
...@@ -25,23 +25,13 @@ describe('Approval Check Popover', () => { ...@@ -25,23 +25,13 @@ describe('Approval Check Popover', () => {
}); });
it('should render the documentation link', () => { it('should render the documentation link', () => {
expect( expect(wrapper.find(GlPopover).find(GlLink).attributes('href')).toBe(documentationLink);
wrapper
.find(GlPopover)
.find(GlLink)
.attributes('href'),
).toBe(documentationLink);
}); });
}); });
describe('without a documentation link', () => { describe('without a documentation link', () => {
it('should not render the documentation link', () => { it('should not render the documentation link', () => {
expect( expect(wrapper.find(GlPopover).find(GlLink).exists()).toBeFalsy();
wrapper
.find(GlPopover)
.find(GlLink)
.exists(),
).toBeFalsy();
}); });
}); });
}); });
...@@ -7,7 +7,10 @@ import BranchesSelect from 'ee/approvals/components/branches_select.vue'; ...@@ -7,7 +7,10 @@ import BranchesSelect from 'ee/approvals/components/branches_select.vue';
const TEST_DEFAULT_BRANCH = { name: 'Any branch' }; const TEST_DEFAULT_BRANCH = { name: 'Any branch' };
const TEST_PROJECT_ID = '1'; 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 TEST_BRANCHES_SELECTIONS = [TEST_DEFAULT_BRANCH, ...TEST_PROTECTED_BRANCHES];
const waitForEvent = ($input, event) => new Promise(resolve => $input.one(event, resolve)); const waitForEvent = ($input, event) => new Promise(resolve => $input.one(event, resolve));
const select2Container = () => document.querySelector('.select2-container'); const select2Container = () => document.querySelector('.select2-container');
......
...@@ -89,11 +89,7 @@ describe('EE Approvals LicenseCompliance Modal', () => { ...@@ -89,11 +89,7 @@ describe('EE Approvals LicenseCompliance Modal', () => {
createWrapper(); createWrapper();
expect( expect(findModal().attributes('title').startsWith(expectTitleStartsWith)).toBe(true);
findModal()
.attributes('title')
.startsWith(expectTitleStartsWith),
).toBe(true);
}); });
}); });
......
...@@ -53,12 +53,7 @@ describe('EE Approvals MREditApp', () => { ...@@ -53,12 +53,7 @@ describe('EE Approvals MREditApp', () => {
}); });
it('renders hidden inputs', () => { it('renders hidden inputs', () => {
expect( expect(wrapper.find('.js-approval-rules').find(MRRulesHiddenInputs).exists()).toBe(true);
wrapper
.find('.js-approval-rules')
.find(MRRulesHiddenInputs)
.exists(),
).toBe(true);
}); });
}); });
...@@ -76,12 +71,7 @@ describe('EE Approvals MREditApp', () => { ...@@ -76,12 +71,7 @@ describe('EE Approvals MREditApp', () => {
store.modules.approvals.state.rules = [{ id: 7, approvers: [] }]; store.modules.approvals.state.rules = [{ id: 7, approvers: [] }];
factory(); factory();
expect( expect(wrapper.find('.js-approval-rules').find(MRRulesHiddenInputs).exists()).toBe(true);
wrapper
.find('.js-approval-rules')
.find(MRRulesHiddenInputs)
.exists(),
).toBe(true);
}); });
describe('summary text', () => { describe('summary text', () => {
......
...@@ -34,11 +34,7 @@ describe('EE Approvals MRRules', () => { ...@@ -34,11 +34,7 @@ describe('EE Approvals MRRules', () => {
const findHeaders = () => wrapper.findAll('thead th').wrappers.map(x => x.text()); const findHeaders = () => wrapper.findAll('thead th').wrappers.map(x => x.text());
const findRuleName = () => wrapper.find('.js-name'); const findRuleName = () => wrapper.find('.js-name');
const findRuleIndicator = () => wrapper.find({ ref: 'indicator' }); const findRuleIndicator = () => wrapper.find({ ref: 'indicator' });
const findRuleMembers = () => const findRuleMembers = () => wrapper.find('td.js-members').find(UserAvatarList).props('items');
wrapper
.find('td.js-members')
.find(UserAvatarList)
.props('items');
const findRuleControls = () => wrapper.find('td.js-controls').find(RuleControls); const findRuleControls = () => wrapper.find('td.js-controls').find(RuleControls);
const callTargetBranchHandler = MutationObserverSpy => { const callTargetBranchHandler = MutationObserverSpy => {
const onTargetBranchMutationHandler = MutationObserverSpy.mock.calls[0][0]; const onTargetBranchMutationHandler = MutationObserverSpy.mock.calls[0][0];
......
...@@ -20,13 +20,7 @@ describe('AuditEventsTable component', () => { ...@@ -20,13 +20,7 @@ describe('AuditEventsTable component', () => {
}; };
const getCell = (trIdx, tdIdx) => { const getCell = (trIdx, tdIdx) => {
return wrapper return wrapper.find(GlTable).find('tbody').findAll('tr').at(trIdx).findAll('td').at(tdIdx);
.find(GlTable)
.find('tbody')
.findAll('tr')
.at(trIdx)
.findAll('td')
.at(tdIdx);
}; };
beforeEach(() => { beforeEach(() => {
......
...@@ -24,12 +24,7 @@ describe('DateRangeButtons component', () => { ...@@ -24,12 +24,7 @@ describe('DateRangeButtons component', () => {
dateRange: { startDate: getDateInPast(CURRENT_DATE, 7), endDate: CURRENT_DATE }, dateRange: { startDate: getDateInPast(CURRENT_DATE, 7), endDate: CURRENT_DATE },
}); });
expect( expect(wrapper.find(GlButtonGroup).find('[selected="true"]').text()).toBe('Last 7 days');
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', () => { it('shows no date range as selected when the dateRange property does not match any option', () => {
...@@ -40,22 +35,14 @@ describe('DateRangeButtons component', () => { ...@@ -40,22 +35,14 @@ describe('DateRangeButtons component', () => {
}, },
}); });
expect( expect(wrapper.find(GlButtonGroup).find('[selected="true"]').exists()).toBe(false);
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 () => { it('emits an "input" event with the dateRange when a new date range is selected', async () => {
createComponent({ createComponent({
dateRange: { startDate: getDateInPast(CURRENT_DATE, 1), endDate: CURRENT_DATE }, dateRange: { startDate: getDateInPast(CURRENT_DATE, 1), endDate: CURRENT_DATE },
}); });
wrapper wrapper.find(GlButtonGroup).find(GlButton).vm.$emit('click');
.find(GlButtonGroup)
.find(GlButton)
.vm.$emit('click');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.emitted().input[0]).toEqual([ expect(wrapper.emitted().input[0]).toEqual([
......
...@@ -40,31 +40,25 @@ describe('DateRangeField component', () => { ...@@ -40,31 +40,25 @@ describe('DateRangeField component', () => {
it("sets the max selectable date to today's date on the date picker", () => { it("sets the max selectable date to today's date on the date picker", () => {
createComponent(); createComponent();
expect( expect(findDatePicker().props('defaultMaxDate').toDateString()).toBe(
findDatePicker() CURRENT_DATE.toDateString(),
.props('defaultMaxDate') );
.toDateString(),
).toBe(CURRENT_DATE.toDateString());
}); });
it('sets the default start date to the start of the month', () => { it('sets the default start date to the start of the month', () => {
createComponent(); createComponent();
expect( expect(findDatePicker().props('defaultStartDate').toDateString()).toBe(
findDatePicker() dateAtFirstDayOfMonth(CURRENT_DATE).toDateString(),
.props('defaultStartDate') );
.toDateString(),
).toBe(dateAtFirstDayOfMonth(CURRENT_DATE).toDateString());
}); });
it("sets the default end date to today's date", () => { it("sets the default end date to today's date", () => {
createComponent(); createComponent();
expect( expect(findDatePicker().props('defaultEndDate').toDateString()).toBe(
findDatePicker() CURRENT_DATE.toDateString(),
.props('defaultEndDate') );
.toDateString(),
).toBe(CURRENT_DATE.toDateString());
}); });
it('passes both startDate and endDate to the date picker as default dates', () => { it('passes both startDate and endDate to the date picker as default dates', () => {
......
...@@ -41,11 +41,7 @@ describe('SortingField component', () => { ...@@ -41,11 +41,7 @@ describe('SortingField component', () => {
it('should set the sorting option accordingly', () => { it('should set the sorting option accordingly', () => {
expect(getCheckedOptions()).toHaveLength(1); expect(getCheckedOptions()).toHaveLength(1);
expect( expect(getCheckedOptions().at(0).text()).toEqual('Oldest created');
getCheckedOptions()
.at(0)
.text(),
).toEqual('Oldest created');
}); });
}); });
}); });
...@@ -53,10 +49,7 @@ describe('SortingField component', () => { ...@@ -53,10 +49,7 @@ describe('SortingField component', () => {
describe('when the user clicks on a option', () => { describe('when the user clicks on a option', () => {
beforeEach(() => { beforeEach(() => {
initComponent(); initComponent();
wrapper wrapper.findAll(GlDropdownItem).at(1).vm.$emit('click');
.findAll(GlDropdownItem)
.at(1)
.vm.$emit('click');
}); });
it('should emit the "selected" event with clicked option', () => { it('should emit the "selected" event with clicked option', () => {
......
...@@ -86,10 +86,7 @@ describe('subscription table row', () => { ...@@ -86,10 +86,7 @@ describe('subscription table row', () => {
}); });
}; };
const findUsageButton = () => const findUsageButton = () => findContentCells().at(0).find('[data-testid="seats-usage-button"]');
findContentCells()
.at(0)
.find('[data-testid="seats-usage-button"]');
describe('dispatched actions', () => { describe('dispatched actions', () => {
it('dispatches action when created if namespace is group', () => { it('dispatches action when created if namespace is group', () => {
......
...@@ -42,7 +42,7 @@ describe('ee/BoardContentSidebar', () => { ...@@ -42,7 +42,7 @@ describe('ee/BoardContentSidebar', () => {
beforeEach(() => { beforeEach(() => {
store = createStore(); store = createStore();
store.state.sidebarType = ISSUABLE; 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'; store.state.activeId = '1';
createComponent(); createComponent();
......
...@@ -103,20 +103,14 @@ describe('EpicsSwimlanes', () => { ...@@ -103,20 +103,14 @@ describe('EpicsSwimlanes', () => {
}); });
it('makes non preset lists draggable', () => { it('makes non preset lists draggable', () => {
expect( expect(wrapper.findAll('[data-testid="board-header-container"]').at(1).classes()).toContain(
wrapper 'is-draggable',
.findAll('[data-testid="board-header-container"]') );
.at(1)
.classes(),
).toContain('is-draggable');
}); });
it('does not make preset lists draggable', () => { it('does not make preset lists draggable', () => {
expect( expect(
wrapper wrapper.findAll('[data-testid="board-header-container"]').at(0).classes(),
.findAll('[data-testid="board-header-container"]')
.at(0)
.classes(),
).not.toContain('is-draggable'); ).not.toContain('is-draggable');
}); });
}); });
......
...@@ -25,7 +25,7 @@ describe('BoardSidebarTimeTracker', () => { ...@@ -25,7 +25,7 @@ describe('BoardSidebarTimeTracker', () => {
beforeEach(() => { beforeEach(() => {
store = createStore(); store = createStore();
store.state.issues = { store.state.issues = {
'1': { 1: {
timeEstimate: 3600, timeEstimate: 3600,
totalTimeSpent: 1800, totalTimeSpent: 1800,
humanTimeEstimate: '1h', humanTimeEstimate: '1h',
......
...@@ -8,10 +8,7 @@ describe('WeightSelect', () => { ...@@ -8,10 +8,7 @@ describe('WeightSelect', () => {
const editButton = () => wrapper.find(GlButton); const editButton = () => wrapper.find(GlButton);
const valueContainer = () => wrapper.find('.value'); const valueContainer = () => wrapper.find('.value');
const weightDropdown = () => wrapper.find(GlDropdown); const weightDropdown = () => wrapper.find(GlDropdown);
const getWeightItemAtIndex = index => const getWeightItemAtIndex = index => weightDropdown().findAll(GlDropdownItem).at(index);
weightDropdown()
.findAll(GlDropdownItem)
.at(index);
const defaultProps = { const defaultProps = {
weights: ['Any', 'None', 0, 1, 2, 3], weights: ['Any', 'None', 0, 1, 2, 3],
board: { board: {
......
...@@ -310,10 +310,11 @@ describe('updateListWipLimit', () => { ...@@ -310,10 +310,11 @@ describe('updateListWipLimit', () => {
return actions return actions
.updateListWipLimit({ state: { activeId }, getters }, { maxIssueCount, listId: activeId }) .updateListWipLimit({ state: { activeId }, getters }, { maxIssueCount, listId: activeId })
.then(() => { .then(() => {
expect(axios.put).toHaveBeenCalledWith( expect(
`${boardsStoreEE.store.state.endpoints.listsEndpoint}/${activeId}`, axios.put,
{ list: { max_issue_count: maxIssueCount } }, ).toHaveBeenCalledWith(`${boardsStoreEE.store.state.endpoints.listsEndpoint}/${activeId}`, {
); list: { max_issue_count: maxIssueCount },
});
}); });
}); });
...@@ -620,8 +621,8 @@ describe('moveIssue', () => { ...@@ -620,8 +621,8 @@ describe('moveIssue', () => {
}; };
const issues = { const issues = {
'436': mockIssue, 436: mockIssue,
'437': mockIssue2, 437: mockIssue2,
}; };
const state = { const state = {
......
...@@ -98,8 +98,8 @@ describe('RECEIVE_ISSUES_FOR_EPIC_SUCCESS', () => { ...@@ -98,8 +98,8 @@ describe('RECEIVE_ISSUES_FOR_EPIC_SUCCESS', () => {
'gid://gitlab/List/2': [mockIssue2.id], 'gid://gitlab/List/2': [mockIssue2.id],
}; };
const issues = { const issues = {
'436': mockIssue, 436: mockIssue,
'437': mockIssue2, 437: mockIssue2,
}; };
mutations.RECEIVE_ISSUES_FOR_EPIC_SUCCESS(state, { mutations.RECEIVE_ISSUES_FOR_EPIC_SUCCESS(state, {
...@@ -265,8 +265,8 @@ describe('MOVE_ISSUE', () => { ...@@ -265,8 +265,8 @@ describe('MOVE_ISSUE', () => {
}; };
const issues = { const issues = {
'436': mockIssue, 436: mockIssue,
'437': mockIssue2, 437: mockIssue2,
}; };
state = { state = {
......
...@@ -232,7 +232,11 @@ describe('BurndownChartData', () => { ...@@ -232,7 +232,11 @@ describe('BurndownChartData', () => {
it('generates an array of arrays with date and issue count', () => { it('generates an array of arrays with date and issue count', () => {
const { burnupScope } = burndownChartData().generateBurnupTimeseries({ milestoneId }); 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', () => { it('starts from 0', () => {
...@@ -265,7 +269,11 @@ describe('BurndownChartData', () => { ...@@ -265,7 +269,11 @@ describe('BurndownChartData', () => {
milestoneId, 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', () => { it('ignores removed from other milestones', () => {
...@@ -289,7 +297,11 @@ describe('BurndownChartData', () => { ...@@ -289,7 +297,11 @@ describe('BurndownChartData', () => {
const { burnupScope } = burndownChartData(events).generateBurnupTimeseries({ milestoneId }); 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', () => { it('only adds milestone event_type', () => {
...@@ -314,7 +326,11 @@ describe('BurndownChartData', () => { ...@@ -314,7 +326,11 @@ describe('BurndownChartData', () => {
const { burnupScope } = burndownChartData(events).generateBurnupTimeseries({ milestoneId }); 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', () => { it('only removes milestone event_type', () => {
...@@ -345,7 +361,11 @@ describe('BurndownChartData', () => { ...@@ -345,7 +361,11 @@ describe('BurndownChartData', () => {
const { burnupScope } = burndownChartData(events).generateBurnupTimeseries({ milestoneId }); 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', () => { ...@@ -80,11 +80,7 @@ describe('burndown_chart', () => {
createComponent(); createComponent();
expect(findActiveButtons()).toHaveLength(1); expect(findActiveButtons()).toHaveLength(1);
expect( expect(findActiveButtons().at(0).text()).toBe('Issues');
findActiveButtons()
.at(0)
.text(),
).toBe('Issues');
expect(findBurndownChart().props('issuesSelected')).toBe(true); expect(findBurndownChart().props('issuesSelected')).toBe(true);
}); });
...@@ -96,11 +92,7 @@ describe('burndown_chart', () => { ...@@ -96,11 +92,7 @@ describe('burndown_chart', () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(findActiveButtons()).toHaveLength(1); expect(findActiveButtons()).toHaveLength(1);
expect( expect(findActiveButtons().at(0).text()).toBe('Issue weight');
findActiveButtons()
.at(0)
.text(),
).toBe('Issue weight');
expect(findBurndownChart().props('issuesSelected')).toBe(false); expect(findBurndownChart().props('issuesSelected')).toBe(false);
}); });
......
...@@ -34,21 +34,9 @@ describe('Iterations report summary cards', () => { ...@@ -34,21 +34,9 @@ describe('Iterations report summary cards', () => {
wrapper = null; wrapper = null;
}); });
const findCompleteCard = () => const findCompleteCard = () => wrapper.findAll(GlCard).at(0).text();
wrapper const findIncompleteCard = () => wrapper.findAll(GlCard).at(1).text();
.findAll(GlCard) const findUnstartedCard = () => wrapper.findAll(GlCard).at(2).text();
.at(0)
.text();
const findIncompleteCard = () =>
wrapper
.findAll(GlCard)
.at(1)
.text();
const findUnstartedCard = () =>
wrapper
.findAll(GlCard)
.at(2)
.text();
describe('with valid totals', () => { describe('with valid totals', () => {
beforeEach(() => { beforeEach(() => {
......
...@@ -47,11 +47,7 @@ describe('MergeRequest component', () => { ...@@ -47,11 +47,7 @@ describe('MergeRequest component', () => {
}); });
it('renders the author avatar', () => { it('renders the author avatar', () => {
expect( expect(findAuthorAvatarLink().find(GlAvatar).exists()).toEqual(true);
findAuthorAvatarLink()
.find(GlAvatar)
.exists(),
).toEqual(true);
}); });
it('renders the author name', () => { it('renders the author name', () => {
......
...@@ -204,9 +204,7 @@ describe('DependenciesTable component', () => { ...@@ -204,9 +204,7 @@ describe('DependenciesTable component', () => {
}); });
it('can be displayed by clicking on the vulnerabilities badge', () => { it('can be displayed by clicking on the vulnerabilities badge', () => {
const badge = findTableRows() const badge = findTableRows().at(rowIndexWithVulnerabilities).find(GlBadge);
.at(rowIndexWithVulnerabilities)
.find(GlBadge);
badge.trigger('click'); badge.trigger('click');
return nextTick().then(() => { return nextTick().then(() => {
......
...@@ -816,7 +816,10 @@ describe('Epic Store Actions', () => { ...@@ -816,7 +816,10 @@ describe('Epic Store Actions', () => {
describe('receiveEpicLabelsSelectSuccess', () => { describe('receiveEpicLabelsSelectSuccess', () => {
it('should set provided labels param to `state.labels`', done => { 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( testAction(
actions.receiveEpicLabelsSelectSuccess, actions.receiveEpicLabelsSelectSuccess,
...@@ -865,7 +868,10 @@ describe('Epic Store Actions', () => { ...@@ -865,7 +868,10 @@ describe('Epic Store Actions', () => {
}); });
describe('updateEpicLabels', () => { 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 => { it('dispatches `requestEpicLabelsSelect` and `receiveEpicLabelsSelectSuccess` actions when request succeeds', done => {
jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue( jest.spyOn(epicUtils.gqClient, 'mutate').mockReturnValue(
......
...@@ -371,7 +371,10 @@ describe('Epic Store Mutations', () => { ...@@ -371,7 +371,10 @@ describe('Epic Store Mutations', () => {
describe('RECEIVE_EPIC_LABELS_SELECT_SUCCESS', () => { describe('RECEIVE_EPIC_LABELS_SELECT_SUCCESS', () => {
it('Should update `labels` array on state when new labels are added', () => { 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 = { const state = {
labels: [], labels: [],
}; };
...@@ -384,7 +387,10 @@ describe('Epic Store Mutations', () => { ...@@ -384,7 +387,10 @@ describe('Epic Store Mutations', () => {
it('Should update `labels` array on state when existing labels are removed', () => { it('Should update `labels` array on state when existing labels are removed', () => {
const removedLabels = [{ id: 1, set: false }]; const removedLabels = [{ id: 1, set: false }];
const state = { 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); mutations[types.RECEIVE_EPIC_LABELS_SELECT_SUCCESS](state, removedLabels);
...@@ -396,7 +402,10 @@ describe('Epic Store Mutations', () => { ...@@ -396,7 +402,10 @@ describe('Epic Store Mutations', () => {
const removedLabels = [{ id: 1, set: false }]; const removedLabels = [{ id: 1, set: false }];
const addedLabels = [{ id: 3, set: true }]; const addedLabels = [{ id: 3, set: true }];
const state = { 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, [ mutations[types.RECEIVE_EPIC_LABELS_SELECT_SUCCESS](state, [
...@@ -405,7 +414,10 @@ describe('Epic Store Mutations', () => { ...@@ -405,7 +414,10 @@ describe('Epic Store Mutations', () => {
]); ]);
expect(state.labels).toEqual( 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', () => { ...@@ -122,11 +122,7 @@ describe('GeoNodeActionsComponent', () => {
describe(`when nodeRemovalAllowed is ${nodeRemovalAllowed}`, () => { describe(`when nodeRemovalAllowed is ${nodeRemovalAllowed}`, () => {
it('has the correct button text', () => { it('has the correct button text', () => {
expect( expect(findRemoveButton().text().trim()).toBe('Remove');
findRemoveButton()
.text()
.trim(),
).toBe('Remove');
}); });
it(`the button's disabled attribute should be ${buttonDisabled}`, () => { it(`the button's disabled attribute should be ${buttonDisabled}`, () => {
......
...@@ -44,23 +44,13 @@ describe('GeoNodeDetailItemComponent', () => { ...@@ -44,23 +44,13 @@ describe('GeoNodeDetailItemComponent', () => {
it('renders container elements correctly', () => { it('renders container elements correctly', () => {
expect(wrapper.find('.node-detail-item').exists()).toBeTruthy(); expect(wrapper.find('.node-detail-item').exists()).toBeTruthy();
expect(wrapper.findAll('.node-detail-title')).not.toHaveLength(0); expect(wrapper.findAll('.node-detail-title')).not.toHaveLength(0);
expect( expect(wrapper.find('.node-detail-title').text().trim()).toBe('GitLab version');
wrapper
.find('.node-detail-title')
.text()
.trim(),
).toBe('GitLab version');
}); });
describe('when plain text value', () => { describe('when plain text value', () => {
it('renders plain item value', () => { it('renders plain item value', () => {
expect(wrapper.findAll('.node-detail-value')).not.toHaveLength(0); expect(wrapper.findAll('.node-detail-value')).not.toHaveLength(0);
expect( expect(wrapper.find('.node-detail-value').text().trim()).toBe('10.4.0-pre');
wrapper
.find('.node-detail-value')
.text()
.trim(),
).toBe('10.4.0-pre');
}); });
it('does not render graph item', () => { it('does not render graph item', () => {
...@@ -140,12 +130,9 @@ describe('GeoNodeDetailItemComponent', () => { ...@@ -140,12 +130,9 @@ describe('GeoNodeDetailItemComponent', () => {
}); });
it('renders synchronization disabled text', () => { it('renders synchronization disabled text', () => {
expect( expect(wrapper.find({ ref: 'disabledText' }).text().trim()).toBe(
wrapper 'Synchronization disabled',
.find({ ref: 'disabledText' }) );
.text()
.trim(),
).toBe('Synchronization disabled');
}); });
it('renders GlPopover', () => { it('renders GlPopover', () => {
......
...@@ -42,11 +42,7 @@ describe('GeoNodeHealthStatusComponent', () => { ...@@ -42,11 +42,7 @@ describe('GeoNodeHealthStatusComponent', () => {
}); });
it(`sets background of StatusPill to ${healthCssClass} when status is ${status}`, () => { it(`sets background of StatusPill to ${healthCssClass} when status is ${status}`, () => {
expect( expect(findStatusPill().classes().join(' ')).toContain(healthCssClass);
findStatusPill()
.classes()
.join(' '),
).toContain(healthCssClass);
}); });
it('renders StatusPill correctly', () => { it('renders StatusPill correctly', () => {
......
...@@ -56,11 +56,7 @@ describe('GeoNodeReplicationStatusComponent', () => { ...@@ -56,11 +56,7 @@ describe('GeoNodeReplicationStatusComponent', () => {
}); });
it(`sets background of StatusPill to ${replicationStatusCssClass} when enabled is ${enabled}`, () => { it(`sets background of StatusPill to ${replicationStatusCssClass} when enabled is ${enabled}`, () => {
expect( expect(findStatusPill().classes().join(' ')).toContain(replicationStatusCssClass);
findStatusPill()
.classes()
.join(' '),
).toContain(replicationStatusCssClass);
}); });
it('renders StatusPill correctly', () => { it('renders StatusPill correctly', () => {
......
...@@ -134,11 +134,9 @@ describe('NodeDetailsSectionVerification', () => { ...@@ -134,11 +134,9 @@ describe('NodeDetailsSectionVerification', () => {
}); });
it('contains text about Replicated data', () => { it('contains text about Replicated data', () => {
expect( expect(findGlPopover().find(GlSprintf).attributes('message')).toContain(
findGlPopover() 'Replicated data is verified',
.find(GlSprintf) );
.attributes('message'),
).toContain('Replicated data is verified');
}); });
}); });
......
...@@ -69,9 +69,7 @@ describe('GeoReplicableFilterBar', () => { ...@@ -69,9 +69,7 @@ describe('GeoReplicableFilterBar', () => {
it('clicking a dropdown item calls setFilter with its index', () => { it('clicking a dropdown item calls setFilter with its index', () => {
const index = 1; const index = 1;
findGlDropdownItems() findGlDropdownItems().at(index).vm.$emit('click');
.at(index)
.vm.$emit('click');
expect(actionSpies.setFilter).toHaveBeenCalledWith(expect.any(Object), index); expect(actionSpies.setFilter).toHaveBeenCalledWith(expect.any(Object), index);
}); });
......
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