-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jl-mcr-4663-cms-and-state-sees-a-withdrawn-tag-on-the-s…
…ubmission-summary' into jl-mcr-4664-state-cannot-edit-withdrawn-rates-on-unlocked-submissions Merge in jl-mcr-4663-cms-and-state-sees-a-withdrawn-tag-on-the-submission-summary
- Loading branch information
Showing
2 changed files
with
170 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,9 +224,6 @@ describe('RateDetailsSummarySection', () => { | |
// Is this the best way to check that the link is not present? | ||
expect(screen.queryByText('Edit')).not.toBeInTheDocument() | ||
|
||
//expects loading button on component load | ||
expect(screen.getByText('Loading')).toBeInTheDocument() | ||
|
||
// expects download all button after loading has completed | ||
await waitFor(() => { | ||
expect( | ||
|
@@ -1253,6 +1250,7 @@ describe('RateDetailsSummarySection', () => { | |
).toBeInTheDocument() | ||
}) | ||
}) | ||
|
||
it('displays deprecated fields on previous submissions viewed by state users', async () => { | ||
vi.spyOn( | ||
usePreviousSubmission, | ||
|
@@ -1301,6 +1299,7 @@ describe('RateDetailsSummarySection', () => { | |
screen.findByText('Programs this rate certification covers') | ||
).toBeTruthy() | ||
}) | ||
|
||
it('does not display deprecated fields on unlocked submissions for state users', async () => { | ||
const draftContract = mockContractPackageDraft() | ||
if ( | ||
|
@@ -1333,4 +1332,135 @@ describe('RateDetailsSummarySection', () => { | |
screen.queryByText('Programs this rate certification covers') | ||
).toBeNull() | ||
}) | ||
|
||
it('displays withdrawn rates', async () => { | ||
const contractWithWithdrawnRates = mockContractPackageSubmitted({ | ||
withdrawnRates: [ | ||
{ | ||
id: '1234', | ||
webURL: 'https://testmcreview.example/rates/1234', | ||
createdAt: new Date('01/01/2021'), | ||
updatedAt: new Date('01/01/2021'), | ||
status: 'SUBMITTED', | ||
reviewStatus: 'WITHDRAWN', | ||
consolidatedStatus: 'WITHDRAWN', | ||
state: mockMNState(), | ||
stateCode: 'MN', | ||
stateNumber: 5, | ||
parentContractID: 'test-abc-123', | ||
revisions: [], | ||
packageSubmissions: [ | ||
{ | ||
cause: 'CONTRACT_SUBMISSION', | ||
submitInfo: { | ||
updatedAt: new Date('01/01/2021'), | ||
updatedBy: { | ||
email: '[email protected]', | ||
familyName: 'Hotman', | ||
givenName: 'Zuko', | ||
role: 'CMS_USER', | ||
}, | ||
updatedReason: 'Test reason', | ||
}, | ||
contractRevisions: [], | ||
rateRevision: { | ||
id: '1234', | ||
rateID: '5678', | ||
createdAt: new Date('01/01/2021'), | ||
updatedAt: new Date('01/01/2021'), | ||
formData: { | ||
rateType: 'NEW', | ||
rateCapitationType: 'RATE_CELL', | ||
rateDocuments: [ | ||
{ | ||
s3URL: 's3://foo/bar/rate', | ||
name: 'rate docs test 1', | ||
sha256: 'fakesha', | ||
dateAdded: new Date(), | ||
}, | ||
], | ||
supportingDocuments: [], | ||
rateDateStart: new Date('01/01/2021'), | ||
rateDateEnd: new Date('12/31/2021'), | ||
rateDateCertified: new Date('12/31/2020'), | ||
amendmentEffectiveDateStart: new Date( | ||
'01/01/2021' | ||
), | ||
amendmentEffectiveDateEnd: new Date( | ||
'12/31/2021' | ||
), | ||
rateCertificationName: | ||
'WITHDRAWN-RATE-NAME', | ||
rateProgramIDs: [ | ||
'abbdf9b0-c49e-4c4c-bb6f-040cb7b51cce', | ||
], | ||
deprecatedRateProgramIDs: [], | ||
consolidatedRateProgramIDs: [ | ||
'abbdf9b0-c49e-4c4c-bb6f-040cb7b51cce', | ||
], | ||
certifyingActuaryContacts: [ | ||
{ | ||
actuarialFirm: 'DELOITTE', | ||
name: 'Jimmy Jimerson', | ||
titleRole: 'Certifying Actuary', | ||
email: '[email protected]', | ||
}, | ||
], | ||
addtlActuaryContacts: [ | ||
{ | ||
actuarialFirm: 'DELOITTE', | ||
name: 'Additional actuary', | ||
titleRole: 'Test Actuary Contact 1', | ||
email: '[email protected]', | ||
}, | ||
], | ||
actuaryCommunicationPreference: | ||
'OACT_TO_ACTUARY', | ||
packagesWithSharedRateCerts: [], | ||
}, | ||
}, | ||
submittedRevisions: [], | ||
}, | ||
], | ||
}, | ||
], | ||
}) | ||
|
||
renderWithProviders( | ||
<RateDetailsSummarySection | ||
contract={contractWithWithdrawnRates} | ||
submissionName="MN-MSHO-0003" | ||
statePrograms={statePrograms} | ||
/>, | ||
{ | ||
apolloProvider: apolloProviderCMSUser, | ||
} | ||
) | ||
|
||
expect( | ||
screen.getByRole('heading', { | ||
level: 2, | ||
name: 'Rate details', | ||
}) | ||
).toBeInTheDocument() | ||
// Is this the best way to check that the link is not present? | ||
expect(screen.queryByText('Edit')).not.toBeInTheDocument() | ||
|
||
// expects download all button after loading has completed | ||
await waitFor(() => { | ||
expect( | ||
screen.getByRole('link', { | ||
name: 'Download all rate documents', | ||
}) | ||
).toBeInTheDocument() | ||
}) | ||
|
||
// expect withdrawn rate to be on the screen | ||
expect( | ||
screen.getByRole('heading', { | ||
level: 3, | ||
name: /WITHDRAWN-RATE-NAME/, | ||
}) | ||
).toBeInTheDocument() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters