diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/frontend/pipelines/test_reports/test_suite_table_spec.js | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) | |
download | gitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/frontend/pipelines/test_reports/test_suite_table_spec.js')
-rw-r--r-- | spec/frontend/pipelines/test_reports/test_suite_table_spec.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/spec/frontend/pipelines/test_reports/test_suite_table_spec.js b/spec/frontend/pipelines/test_reports/test_suite_table_spec.js index 65bffe7039a..3a4aa94571e 100644 --- a/spec/frontend/pipelines/test_reports/test_suite_table_spec.js +++ b/spec/frontend/pipelines/test_reports/test_suite_table_spec.js @@ -23,6 +23,8 @@ describe('Test reports suite table', () => { const noCasesMessage = () => wrapper.find('.js-no-test-cases'); const allCaseRows = () => wrapper.findAll('.js-case-row'); const findCaseRowAtIndex = index => wrapper.findAll('.js-case-row').at(index); + const allCaseNames = () => + wrapper.findAll('[data-testid="caseName"]').wrappers.map(el => el.attributes('text')); const findIconForRow = (row, status) => row.find(`.ci-status-icon-${status}`); const createComponent = (suite = testSuite) => { @@ -61,18 +63,14 @@ describe('Test reports suite table', () => { expect(allCaseRows().length).toBe(testCases.length); }); - it('renders the failed tests first', () => { - const failedCaseNames = testCases - .filter(x => x.status === TestStatus.FAILED) - .map(x => x.name); + it('renders the failed tests first, skipped tests next, then successful tests', () => { + const expectedCaseOrder = [ + ...testCases.filter(x => x.status === TestStatus.FAILED), + ...testCases.filter(x => x.status === TestStatus.SKIPPED), + ...testCases.filter(x => x.status === TestStatus.SUCCESS), + ].map(x => x.name); - const skippedCaseNames = testCases - .filter(x => x.status === TestStatus.SKIPPED) - .map(x => x.name); - - expect(findCaseRowAtIndex(0).text()).toContain(failedCaseNames[0]); - expect(findCaseRowAtIndex(1).text()).toContain(failedCaseNames[1]); - expect(findCaseRowAtIndex(2).text()).toContain(skippedCaseNames[0]); + expect(allCaseNames()).toEqual(expectedCaseOrder); }); it('renders the correct icon for each status', () => { |