Commit 4acba7de authored by Scott Hampton's avatar Scott Hampton

Update summary row tests

Update the selectors for the summary row tests.
parent b5011318
...@@ -66,13 +66,10 @@ export default { ...@@ -66,13 +66,10 @@ export default {
css-class="report-block-list-loading-icon" css-class="report-block-list-loading-icon"
size="md" size="md"
/> />
<ci-icon v-else :status="iconStatus" :size="statusIconSize" /> <ci-icon v-else :status="iconStatus" :size="statusIconSize" data-testid="summary-row-icon" />
</div> </div>
<div class="report-block-list-issue-description"> <div class="report-block-list-issue-description">
<div <div class="report-block-list-issue-description-text" data-testid="summary-row-description">
class="report-block-list-issue-description-text"
data-testid="test-summary-row-description"
>
<slot name="summary">{{ summary }}</slot <slot name="summary">{{ summary }}</slot
><span v-if="popoverOptions" class="text-nowrap" ><span v-if="popoverOptions" class="text-nowrap"
>&nbsp;<popover v-if="popoverOptions" :options="popoverOptions" class="align-top" /> >&nbsp;<popover v-if="popoverOptions" :options="popoverOptions" class="align-top" />
......
...@@ -42,7 +42,7 @@ describe('Grouped test reports app', () => { ...@@ -42,7 +42,7 @@ describe('Grouped test reports app', () => {
const findHeader = () => wrapper.find('[data-testid="report-section-code-text"]'); const findHeader = () => wrapper.find('[data-testid="report-section-code-text"]');
const findExpandButton = () => wrapper.find('[data-testid="report-section-expand-button"]'); const findExpandButton = () => wrapper.find('[data-testid="report-section-expand-button"]');
const findFullTestReportLink = () => wrapper.find('[data-testid="group-test-reports-full-link"]'); const findFullTestReportLink = () => wrapper.find('[data-testid="group-test-reports-full-link"]');
const findSummaryDescription = () => wrapper.find('[data-testid="test-summary-row-description"]'); const findSummaryDescription = () => wrapper.find('[data-testid="summary-row-description"]');
const findIssueDescription = () => wrapper.find('[data-testid="test-issue-body-description"]'); const findIssueDescription = () => wrapper.find('[data-testid="test-issue-body-description"]');
const findAllIssueDescriptions = () => const findAllIssueDescriptions = () =>
wrapper.findAll('[data-testid="test-issue-body-description"]'); wrapper.findAll('[data-testid="test-issue-body-description"]');
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import SummaryRow from '~/reports/components/summary_row.vue'; import SummaryRow from '~/reports/components/summary_row.vue';
describe('Summary row', () => { describe('Summary row', () => {
...@@ -14,16 +15,19 @@ describe('Summary row', () => { ...@@ -14,16 +15,19 @@ describe('Summary row', () => {
}; };
const createComponent = ({ propsData = {}, slots = {} } = {}) => { const createComponent = ({ propsData = {}, slots = {} } = {}) => {
wrapper = mount(SummaryRow, { wrapper = extendedWrapper(
propsData: { mount(SummaryRow, {
...props, propsData: {
...propsData, ...props,
}, ...propsData,
slots, },
}); slots,
}),
);
}; };
const findSummary = () => wrapper.find('.report-block-list-issue-description-text'); const findSummary = () => wrapper.findByTestId('summary-row-description');
const findStatusIcon = () => wrapper.findByTestId('summary-row-icon');
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
...@@ -37,9 +41,7 @@ describe('Summary row', () => { ...@@ -37,9 +41,7 @@ describe('Summary row', () => {
it('renders provided icon', () => { it('renders provided icon', () => {
createComponent(); createComponent();
expect(wrapper.find('.report-block-list-icon span').classes()).toContain( expect(findStatusIcon().classes()).toContain('js-ci-status-icon-warning');
'js-ci-status-icon-warning',
);
}); });
describe('summary slot', () => { describe('summary slot', () => {
......
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