From 4d43e9c2c9c5ae0f8fbde274a22daea6176e9863 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Tue, 23 Apr 2024 12:33:30 -0400 Subject: [PATCH] fix tests --- .../V2/ReviewSubmit/ReviewSubmitV2.test.tsx | 28 ++++--------------- .../apolloMocks/contractPackageDataMock.ts | 4 +-- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/ReviewSubmit/V2/ReviewSubmit/ReviewSubmitV2.test.tsx b/services/app-web/src/pages/StateSubmission/ReviewSubmit/V2/ReviewSubmit/ReviewSubmitV2.test.tsx index 39abc10790..0ea3d16adb 100644 --- a/services/app-web/src/pages/StateSubmission/ReviewSubmit/V2/ReviewSubmit/ReviewSubmitV2.test.tsx +++ b/services/app-web/src/pages/StateSubmission/ReviewSubmit/V2/ReviewSubmit/ReviewSubmitV2.test.tsx @@ -205,28 +205,12 @@ describe('ReviewSubmit', () => { ) await waitFor(() => { - const contractDocRow = screen.getByRole('row', { - name: /contract document/, - }) - expect( - within(contractDocRow).getByText('1/1/24') - ).toBeInTheDocument() - const contractSupporting1Row = screen.getByRole('row', { - name: /contractSupporting1/, - }) - expect( - within(contractSupporting1Row).getByText('1/15/24') - ).toBeInTheDocument() - const rateDocRow = screen.getByRole('row', { - name: /rate certification/, - }) - expect(within(rateDocRow).getByText('1/13/24')).toBeInTheDocument() - const rateSupporting1Row = screen.getByRole('row', { - name: /rateSupporting1/, - }) - expect( - within(rateSupporting1Row).getByText('1/15/24') - ).toBeInTheDocument() + const rows = screen.getAllByRole('row') + expect(rows).toHaveLength(4) + expect(within(rows[0]).getByText('Date added')).toBeInTheDocument() + expect(within(rows[1]).getByText('2/2/23')).toBeInTheDocument() + expect(within(rows[2]).getByText('Date added')).toBeInTheDocument() + expect(within(rows[3]).getByText('3/2/23')).toBeInTheDocument() }) }) diff --git a/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts b/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts index 2b534d9fff..bb742f4bb8 100644 --- a/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts +++ b/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts @@ -480,7 +480,7 @@ function mockContractPackageUnlocked( s3URL: 's3://bucketname/one-two/one-two.png', sha256: 'fakesha', name: 'one two', - dateAdded: new Date() + dateAdded: new Date('02/02/2023') }, ], contractDateStart: new Date('02/02/2023'), @@ -539,7 +539,7 @@ function mockContractPackageUnlocked( s3URL: 's3://bucketname/key/rate', sha256: 'fakesha', name: 'rate', - dateAdded: new Date() + dateAdded: new Date('03/02/2023') }, ], supportingDocuments: [],