From 8d85d79e23b7cea3b4c7c39bde351cb399fbd3a2 Mon Sep 17 00:00:00 2001 From: calvin-codecov Date: Wed, 23 Oct 2024 12:17:49 -0700 Subject: [PATCH] feat: Change errored uploads and uploads list text (#3429) --- .../CommitCoverage/CommitCoverage.test.jsx | 2 +- .../ErroredUploads/ErroredUploads.jsx | 38 ++++++------------- .../ErroredUploads/ErroredUploads.test.jsx | 28 +++----------- .../UploadsCard/UploadsCard.test.tsx | 8 ++-- .../UploadsCard/UploadsCard.tsx | 2 +- .../Dropdowns/CommitCoverageDropdown.tsx | 2 +- 6 files changed, 24 insertions(+), 56 deletions(-) diff --git a/src/pages/CommitDetailPage/CommitCoverage/CommitCoverage.test.jsx b/src/pages/CommitDetailPage/CommitCoverage/CommitCoverage.test.jsx index c97dc44fa8..dbf42bcec6 100644 --- a/src/pages/CommitDetailPage/CommitCoverage/CommitCoverage.test.jsx +++ b/src/pages/CommitDetailPage/CommitCoverage/CommitCoverage.test.jsx @@ -675,7 +675,7 @@ describe('CommitCoverage', () => { render(, { wrapper: wrapper({ queryClient }) }) const erroredUploads = await screen.findByText( - /The following uploads failed to process:/ + /No coverage data is available due to incomplete uploads on the first attempt./ ) expect(erroredUploads).toBeInTheDocument() }) diff --git a/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx b/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx index 1ed08c1068..87cf0f5f17 100644 --- a/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx +++ b/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.jsx @@ -1,37 +1,23 @@ import isEmpty from 'lodash/isEmpty' import PropTypes from 'prop-types' -import A from 'ui/A' - function ErroredUploads({ erroredUploads }) { return ( !isEmpty(erroredUploads) && ( - <> -

The following uploads failed to process:

- {Object.entries(erroredUploads)?.map(([provider, uploads]) => { - return ( -
-

{provider}

- {uploads?.map(({ buildCode, ciUrl, createdAt }) => { - return ( -
-

{buildCode}

- {ciUrl && ( - - view CI build - - )} -
- ) - })} -
- ) - })} +
+

+ No coverage data is available due to incomplete uploads on the first + attempt. +

+

+ To receive coverage data, ensure your coverage data is accurate and + then open a new commit. +

- We recommend checking the Codecov step of this commit's CI Run to - make sure it uploaded properly and, if needed, run your CI again. + Note: this page will not reflect the latest results, even if you have + re-run all jobs successfully or have merged this commit.

- +
) ) } diff --git a/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.test.jsx b/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.test.jsx index 958ca682e8..e58eae738b 100644 --- a/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.test.jsx +++ b/src/pages/CommitDetailPage/CommitCoverage/ErroredUploads/ErroredUploads.test.jsx @@ -37,35 +37,17 @@ describe('ErroredUploads', () => { render() const message = screen.getByText( - /The following uploads failed to process:/ + /No coverage data is available due to incomplete uploads on the first attempt./ ) expect(message).toBeInTheDocument() }) - it('all providers involved', () => { - render() - - const circle = screen.getByText(/circleCI/) - expect(circle).toBeInTheDocument() - - const ghActions = screen.getByText(/github actions/) - expect(ghActions).toBeInTheDocument() - }) - - it('build code', () => { - render() - - const buildCode1 = screen.getByText(82364) - expect(buildCode1).toBeInTheDocument() - - const buildCode2 = screen.getByText(20374) - expect(buildCode2).toBeInTheDocument() - }) - it('recommendation text', () => { render() - const recommendationText = screen.getByText(/We recommend checking/) + const recommendationText = screen.getByText( + /To receive coverage data, ensure your coverage data is accurate and then open a new commit./ + ) expect(recommendationText).toBeInTheDocument() }) }) @@ -75,7 +57,7 @@ describe('ErroredUploads', () => { render() const message = screen.queryByText( - /The following uploads failed to process:/ + /No coverage data is available due to incomplete uploads on the first attempt./ ) expect(message).not.toBeInTheDocument() }) diff --git a/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.test.tsx b/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.test.tsx index 8562075d4a..ed85f7787a 100644 --- a/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.test.tsx +++ b/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.test.tsx @@ -182,8 +182,8 @@ describe('UploadsCard', () => { it('renders the title', () => { render(, { wrapper }) - const uploads = screen.getByText(/Uploads/) - expect(uploads).toBeInTheDocument() + const covReportHistory = screen.getByText(/Coverage reports history/) + expect(covReportHistory).toBeInTheDocument() }) it('renders different cis', () => { render(, { wrapper }) @@ -237,7 +237,7 @@ describe('UploadsCard', () => { it('renders the title', () => { render(, { wrapper }) - const uploads = screen.getByText(/Uploads/) + const uploads = screen.getByText(/Coverage reports history/) expect(uploads).toBeInTheDocument() }) it('renders different cis', () => { @@ -264,7 +264,7 @@ describe('UploadsCard', () => { it('renders the title', () => { render(, { wrapper }) - const uploads = screen.getByText(/Uploads/) + const uploads = screen.getByText(/Coverage reports history/) expect(uploads).toBeInTheDocument() }) }) diff --git a/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.tsx b/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.tsx index 03a4197547..0a51e00c27 100644 --- a/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.tsx +++ b/src/pages/CommitDetailPage/CommitCoverage/UploadsCard/UploadsCard.tsx @@ -44,7 +44,7 @@ function UploadsCard() {