diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /spec/frontend/reports/components/grouped_test_reports_app_spec.js | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) | |
download | gitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'spec/frontend/reports/components/grouped_test_reports_app_spec.js')
-rw-r--r-- | spec/frontend/reports/components/grouped_test_reports_app_spec.js | 70 |
1 files changed, 19 insertions, 51 deletions
diff --git a/spec/frontend/reports/components/grouped_test_reports_app_spec.js b/spec/frontend/reports/components/grouped_test_reports_app_spec.js index 66d429017b2..492192988fb 100644 --- a/spec/frontend/reports/components/grouped_test_reports_app_spec.js +++ b/spec/frontend/reports/components/grouped_test_reports_app_spec.js @@ -22,7 +22,7 @@ describe('Grouped test reports app', () => { let wrapper; let mockStore; - const mountComponent = ({ props = { pipelinePath }, testFailureHistory = false } = {}) => { + const mountComponent = ({ props = { pipelinePath } } = {}) => { wrapper = mount(Component, { store: mockStore, localVue, @@ -31,15 +31,10 @@ describe('Grouped test reports app', () => { pipelinePath, ...props, }, - provide: { - glFeatures: { - testFailureHistory, - }, - }, }); }; - const setReports = reports => { + const setReports = (reports) => { mockStore.state.status = reports.status; mockStore.state.summary = reports.summary; mockStore.state.reports = reports.suites; @@ -232,11 +227,9 @@ describe('Grouped test reports app', () => { }); it('renders resolved errors', () => { - expect( - findAllIssueDescriptions() - .at(2) - .text(), - ).toContain(resolvedFailures.suites[0].resolved_errors[0].name); + expect(findAllIssueDescriptions().at(2).text()).toContain( + resolvedFailures.suites[0].resolved_errors[0].name, + ); }); }); @@ -244,50 +237,25 @@ describe('Grouped test reports app', () => { describe('with recent failures counts', () => { beforeEach(() => { setReports(recentFailuresTestReports); + mountComponent(); }); - describe('with feature flag enabled', () => { - beforeEach(() => { - mountComponent({ testFailureHistory: true }); - }); - - it('renders the recently failed tests summary', () => { - expect(findHeader().text()).toContain( - '2 out of 3 failed tests have failed more than once in the last 14 days', - ); - }); - - it('renders the recently failed count on the test suite', () => { - expect(findSummaryDescription().text()).toContain( - '1 out of 2 failed tests has failed more than once in the last 14 days', - ); - }); - - it('renders the recent failures count on the test case', () => { - expect(findIssueDescription().text()).toContain( - 'Failed 8 times in master in the last 14 days', - ); - }); + it('renders the recently failed tests summary', () => { + expect(findHeader().text()).toContain( + '2 out of 3 failed tests have failed more than once in the last 14 days', + ); }); - describe('with feature flag disabled', () => { - beforeEach(() => { - mountComponent({ testFailureHistory: false }); - }); - - it('does not render the recently failed tests summary', () => { - expect(findHeader().text()).not.toContain('failed more than once in the last 14 days'); - }); - - it('does not render the recently failed count on the test suite', () => { - expect(findSummaryDescription().text()).not.toContain( - 'failed more than once in the last 14 days', - ); - }); + it('renders the recently failed count on the test suite', () => { + expect(findSummaryDescription().text()).toContain( + '1 out of 2 failed tests has failed more than once in the last 14 days', + ); + }); - it('renders the recent failures count on the test case', () => { - expect(findIssueDescription().text()).not.toContain('in the last 14 days'); - }); + it('renders the recent failures count on the test case', () => { + expect(findIssueDescription().text()).toContain( + 'Failed 8 times in master in the last 14 days', + ); }); }); |