diff --git a/services/app-web/src/components/SubmissionSummarySection/ContractDetailsSummarySection/ContractDetailsSummarySection.tsx b/services/app-web/src/components/SubmissionSummarySection/ContractDetailsSummarySection/ContractDetailsSummarySection.tsx index 50222683f3..9f25cdffa0 100644 --- a/services/app-web/src/components/SubmissionSummarySection/ContractDetailsSummarySection/ContractDetailsSummarySection.tsx +++ b/services/app-web/src/components/SubmissionSummarySection/ContractDetailsSummarySection/ContractDetailsSummarySection.tsx @@ -309,7 +309,7 @@ export const ContractDetailsSummarySection = ({ ? new Date( documentDateLookupTable.previousSubmissionDate ) - : undefined + : null } caption="Contract" documentCategory="Contract" @@ -325,7 +325,7 @@ export const ContractDetailsSummarySection = ({ ? new Date( documentDateLookupTable.previousSubmissionDate ) - : undefined + : null } caption="Contract supporting documents" documentCategory="Contract-supporting" diff --git a/services/app-web/src/components/SubmissionSummarySection/RateDetailsSummarySection/RateDetailsSummarySection.tsx b/services/app-web/src/components/SubmissionSummarySection/RateDetailsSummarySection/RateDetailsSummarySection.tsx index 90c3fe7d5b..27b89b9143 100644 --- a/services/app-web/src/components/SubmissionSummarySection/RateDetailsSummarySection/RateDetailsSummarySection.tsx +++ b/services/app-web/src/components/SubmissionSummarySection/RateDetailsSummarySection/RateDetailsSummarySection.tsx @@ -364,7 +364,7 @@ export const RateDetailsSummarySection = ({ ? new Date( documentDateLookupTable.previousSubmissionDate ) - : undefined + : null } multipleDocumentsAllowed={false} caption="Rate certification" @@ -388,7 +388,7 @@ export const RateDetailsSummarySection = ({ ? new Date( documentDateLookupTable.previousSubmissionDate ) - : undefined + : null } caption="Rate supporting documents" isSupportingDocuments diff --git a/services/app-web/src/components/SubmissionSummarySection/UploadedDocumentsTable/UploadedDocumentsTable.test.tsx b/services/app-web/src/components/SubmissionSummarySection/UploadedDocumentsTable/UploadedDocumentsTable.test.tsx index 19510796d4..a071847f1d 100644 --- a/services/app-web/src/components/SubmissionSummarySection/UploadedDocumentsTable/UploadedDocumentsTable.test.tsx +++ b/services/app-web/src/components/SubmissionSummarySection/UploadedDocumentsTable/UploadedDocumentsTable.test.tsx @@ -67,6 +67,7 @@ describe('UploadedDocumentsTable', () => { renderWithProviders( { renderWithProviders( { const defaultApolloMocks = { @@ -314,7 +315,20 @@ describe('ContractDetailsSummarySection', () => { it('does not render supporting contract documents table when no documents exist', () => { renderWithProviders( , { 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 a67d3cfecf..ddc8aad20a 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 @@ -1,4 +1,4 @@ -import { screen, waitFor } from '@testing-library/react' +import { screen, waitFor, within } from '@testing-library/react' import { renderWithProviders, userClickByRole, @@ -7,6 +7,7 @@ import { ReviewSubmitV2 } from './ReviewSubmitV2' import { fetchCurrentUserMock, fetchContractMockSuccess, + mockContractPackageUnlocked, } from '../../../../../testHelpers/apolloMocks' import { Route, Routes } from 'react-router-dom' import { RoutesRecord } from '../../../../../constants' @@ -177,6 +178,60 @@ describe('ReviewSubmit', () => { }) }) + it('extracts the correct dates from unlocked submission and displays them in tables', async () => { + const contractMock = fetchContractMockSuccess({ + contract: mockContractPackageUnlocked(), + }) + + renderWithProviders( + + } + /> + , + { + apolloProvider: { + mocks: [ + fetchCurrentUserMock({ statusCode: 200 }), + contractMock, + ], + }, + routerProvider: { + route: '/submissions/test-abc-123/edit/review-and-submit', + }, + featureFlags: { + 'link-rates': true, + }, + } + ) + + 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() + }) + }) + it('displays back, save as draft, and submit buttons', async () => { renderWithProviders( diff --git a/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts b/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts index ee8ee65ae0..4cbbfa9a24 100644 --- a/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts +++ b/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts @@ -1,9 +1,106 @@ import { mockMNState } from '../../common-code/healthPlanFormDataMocks/healthPlanFormData' -import { Contract } from '../../gen/gqlClient' +import { Contract, ContractFormData } from '../../gen/gqlClient' // Assemble versions of Contract data (with or without rates) for jest testing. Intended for use with related GQL Moc file. function mockContractPackageDraft( partial?: Partial +): Contract { + return { + __typename: 'Contract', + initiallySubmittedAt: undefined, + status: 'DRAFT', + createdAt: new Date('01/01/24'), + updatedAt: new Date(), + id: 'test-abc-123', + stateCode: 'MN', + state: mockMNState(), + stateNumber: 5, + draftRevision: { + __typename: 'ContractRevision', + submitInfo: undefined, + unlockInfo: undefined, + id: '123', + createdAt: new Date(), + updatedAt: new Date(), + contractName: 'MCR-0005-alvhalfhdsalf', + formData: mockContractFormData(partial?.draftRevision?.formData) + }, + + draftRates: [ + { + id: '123', + createdAt: new Date(), + updatedAt: new Date(), + status: 'DRAFT', + stateCode: 'MN', + revisions: [], + state: mockMNState(), + stateNumber: 5, + draftRevision: { + id: '123', + contractRevisions: [], + createdAt: new Date(), + updatedAt: new Date(), + formData: { + rateType: 'AMENDMENT', + rateCapitationType: 'RATE_CELL', + rateDocuments: [ + { + s3URL: 's3://bucketname/key/rate', + sha256: 'fakesha', + name: 'rate certification', + dateAdded: new Date('01/13/2024') + }, + ], + supportingDocuments: [ + { + s3URL: 's3://bucketname/key/ratesupporting1', + sha256: 'fakesha', + name: 'rateSupporting1', + dateAdded: new Date('01/15/2024') + }, + { + s3URL: 's3://bucketname/key/rateSupporting2', + sha256: 'fakesha', + name: 'rateSupporting2', + dateAdded: new Date('01/13/2024') + }, + ], + rateDateStart: new Date(), + rateDateEnd: new Date(), + rateDateCertified: new Date(), + amendmentEffectiveDateStart: new Date(), + amendmentEffectiveDateEnd: new Date(), + rateProgramIDs: ['abbdf9b0-c49e-4c4c-bb6f-040cb7b51cce'], + certifyingActuaryContacts: [ + { + actuarialFirm: 'DELOITTE', + name: 'Actuary Contact 1', + titleRole: 'Test Actuary Contact 1', + email: 'actuarycontact1@test.com', + }, + ], + addtlActuaryContacts: [ + { + actuarialFirm: 'DELOITTE', + name: 'Actuary Contact 1', + titleRole: 'Test Actuary Contact 1', + email: 'additionalactuarycontact1@test.com', + }, + ], + actuaryCommunicationPreference: 'OACT_TO_ACTUARY', + packagesWithSharedRateCerts: [], + } + } + + }, + ], + packageSubmissions: [], + ...partial, + } +} +function mockContractWithLinkedRateDraft( + partial?: Partial ): Contract { return { __typename: 'Contract', @@ -78,7 +175,7 @@ function mockContractPackageDraft( id: '123', createdAt: new Date(), updatedAt: new Date(), - status: 'DRAFT', + status: 'SUBMITTED', stateCode: 'MN', revisions: [], state: mockMNState(), @@ -133,14 +230,14 @@ function mockContractPackageDraft( ...partial, } } -function mockContractWithLinkedRateDraft( +function mockContractPackageUnlocked( partial?: Partial ): Contract { return { __typename: 'Contract', initiallySubmittedAt: undefined, - status: 'DRAFT', - createdAt: new Date(), + status: 'UNLOCKED', + createdAt: new Date('01/01/24'), updatedAt: new Date(), id: 'test-abc-123', stateCode: 'MN', @@ -160,7 +257,20 @@ function mockContractWithLinkedRateDraft( submissionType: 'CONTRACT_AND_RATES', riskBasedContract: true, submissionDescription: 'A real submission', - supportingDocuments: [], + supportingDocuments: [ + { + s3URL: 's3://bucketname/key/contractsupporting1', + sha256: 'fakesha', + name: 'contractSupporting1', + dateAdded: new Date('01/15/2024') + }, + { + s3URL: 's3://bucketname/key/contractSupporting2', + sha256: 'fakesha', + name: 'contractSupporting2', + dateAdded: new Date('01/13/2024') + }, + ], stateContacts: [ { name: 'State Contact 1', @@ -174,8 +284,8 @@ function mockContractWithLinkedRateDraft( { s3URL: 's3://bucketname/one-two/one-two.png', sha256: 'fakesha', - name: 'one two', - dateAdded: new Date() + name: 'contract document', + dateAdded: new Date('01/01/2024') }, ], contractDateStart: new Date('01/01/2023'), @@ -209,7 +319,7 @@ function mockContractWithLinkedRateDraft( id: '123', createdAt: new Date(), updatedAt: new Date(), - status: 'SUBMITTED', + status: 'DRAFT', stateCode: 'MN', revisions: [], state: mockMNState(), @@ -226,11 +336,24 @@ function mockContractWithLinkedRateDraft( { s3URL: 's3://bucketname/key/rate', sha256: 'fakesha', - name: 'rate', - dateAdded: new Date() + name: 'rate certification', + dateAdded: new Date('01/13/2024') + }, + ], + supportingDocuments: [ + { + s3URL: 's3://bucketname/key/ratesupporting1', + sha256: 'fakesha', + name: 'rateSupporting1', + dateAdded: new Date('01/15/2024') + }, + { + s3URL: 's3://bucketname/key/rateSupporting2', + sha256: 'fakesha', + name: 'rateSupporting2', + dateAdded: new Date('01/13/2024') }, ], - supportingDocuments: [], rateDateStart: new Date(), rateDateEnd: new Date(), rateDateCertified: new Date(), @@ -260,7 +383,134 @@ function mockContractWithLinkedRateDraft( }, ], - packageSubmissions: [], + packageSubmissions: [{ + cause: 'CONTRACT_SUBMISSION', + submitInfo: { + updatedAt: new Date('12/31/2023'), + updatedBy: 'example@state.com', + updatedReason: 'contract submit' + }, + submittedRevisions: [], + contractRevision: { + contractName: 'MCR-MN-0005-SNBC', + createdAt: new Date('01/01/2023'), + updatedAt: new Date('12/31/2023'), + id: '123', + formData: { + programIDs: ['abbdf9b0-c49e-4c4c-bb6f-040cb7b51cce'], + populationCovered: 'MEDICAID', + submissionType: 'CONTRACT_AND_RATES', + riskBasedContract: true, + submissionDescription: 'A real submission', + supportingDocuments: [ + { + s3URL: 's3://bucketname/key/contractsupporting1', + sha256: 'fakesha', + name: 'contractSupporting1', + dateAdded: new Date('01/15/2023') + }, + { + s3URL: 's3://bucketname/key/contractSupporting2', + sha256: 'fakesha', + name: 'contractSupporting2', + dateAdded: new Date('01/13/2023') + }, + ], + stateContacts: [], + contractType: 'AMENDMENT', + contractExecutionStatus: 'EXECUTED', + contractDocuments: [ + { + s3URL: 's3://bucketname/key/contract', + sha256: 'fakesha', + name: 'contract', + dateAdded: new Date('01/01/2023') + }, + ], + contractDateStart: new Date(), + contractDateEnd: new Date(), + managedCareEntities: ['MCO'], + federalAuthorities: ['STATE_PLAN'], + inLieuServicesAndSettings: true, + modifiedBenefitsProvided: true, + modifiedGeoAreaServed: false, + modifiedMedicaidBeneficiaries: true, + modifiedRiskSharingStrategy: true, + modifiedIncentiveArrangements: false, + modifiedWitholdAgreements: false, + modifiedStateDirectedPayments: true, + modifiedPassThroughPayments: true, + modifiedPaymentsForMentalDiseaseInstitutions: false, + modifiedMedicalLossRatioStandards: true, + modifiedOtherFinancialPaymentIncentive: false, + modifiedEnrollmentProcess: true, + modifiedGrevienceAndAppeal: false, + modifiedNetworkAdequacyStandards: true, + modifiedLengthOfContract: false, + modifiedNonRiskPaymentArrangements: true, + statutoryRegulatoryAttestation: true, + statutoryRegulatoryAttestationDescription: "everything meets regulatory attestation" + } + }, + rateRevisions: [ + { + id: '1234', + createdAt: new Date('01/01/2023'), + updatedAt: new Date('01/01/2023'), + contractRevisions: [], + formData: { + rateType: 'AMENDMENT', + rateCapitationType: 'RATE_CELL', + rateDocuments: [ + { + s3URL: 's3://bucketname/key/rate', + sha256: 'fakesha', + name: 'rate', + dateAdded: new Date('01/01/2023') + }, + ], + supportingDocuments: [ + { + s3URL: 's3://bucketname/key/rateSupporting1', + sha256: 'fakesha', + name: 'rate supporting 1', + dateAdded: new Date('01/15/2023') + }, + { + s3URL: 's3://bucketname/key/rateSupporting1', + sha256: 'fakesha', + name: 'rate supporting 2', + dateAdded: new Date('01/15/2023') + }, + ], + rateDateStart: new Date(), + rateDateEnd: new Date(), + rateDateCertified: new Date(), + amendmentEffectiveDateStart: new Date(), + amendmentEffectiveDateEnd: new Date(), + rateProgramIDs: ['abbdf9b0-c49e-4c4c-bb6f-040cb7b51cce'], + certifyingActuaryContacts: [ + { + actuarialFirm: 'DELOITTE', + name: 'Actuary Contact 1', + titleRole: 'Test Actuary Contact 1', + email: 'actuarycontact1@test.com', + }, + ], + addtlActuaryContacts: [ + { + actuarialFirm: 'DELOITTE', + name: 'Actuary Contact 1', + titleRole: 'Test Actuary Contact 1', + email: 'actuarycontact1@test.com', + }, + ], + actuaryCommunicationPreference: 'OACT_TO_ACTUARY', + packagesWithSharedRateCerts: [] + } + }, + ], + }], ...partial, } } @@ -294,7 +544,20 @@ function mockContractPackageSubmitted( submissionType: 'CONTRACT_AND_RATES', riskBasedContract: true, submissionDescription: 'A real submission', - supportingDocuments: [], + supportingDocuments: [ + { + s3URL: 's3://bucketname/key/contractsupporting1', + sha256: 'fakesha', + name: 'contractSupporting1', + dateAdded: new Date('01/15/2024') + }, + { + s3URL: 's3://bucketname/key/contractSupporting2', + sha256: 'fakesha', + name: 'contractSupporting2', + dateAdded: new Date('01/13/2024') + }, + ], stateContacts: [], contractType: 'AMENDMENT', contractExecutionStatus: 'EXECUTED', @@ -303,7 +566,7 @@ function mockContractPackageSubmitted( s3URL: 's3://bucketname/key/contract', sha256: 'fakesha', name: 'contract', - dateAdded: new Date() + dateAdded: new Date('01/01/2024') }, ], contractDateStart: new Date(), @@ -345,10 +608,23 @@ function mockContractPackageSubmitted( s3URL: 's3://bucketname/key/rate', sha256: 'fakesha', name: 'rate', - dateAdded: new Date() + dateAdded: new Date('01/01/2023') + }, + ], + supportingDocuments: [ + { + s3URL: 's3://bucketname/key/rateSupporting1', + sha256: 'fakesha', + name: 'rate supporting 1', + dateAdded: new Date('01/15/2023') + }, + { + s3URL: 's3://bucketname/key/rateSupporting1', + sha256: 'fakesha', + name: 'rate supporting 2', + dateAdded: new Date('01/15/2023') }, ], - supportingDocuments: [], rateDateStart: new Date(), rateDateEnd: new Date(), rateDateCertified: new Date(), @@ -381,4 +657,69 @@ function mockContractPackageSubmitted( } } -export { mockContractPackageDraft, mockContractPackageSubmitted, mockContractWithLinkedRateDraft } +function mockContractFormData( partial?: Partial): ContractFormData { + return { + programIDs: ['abbdf9b0-c49e-4c4c-bb6f-040cb7b51cce'], + populationCovered: 'MEDICAID', + submissionType: 'CONTRACT_AND_RATES', + riskBasedContract: true, + submissionDescription: 'A real submission', + supportingDocuments: [ + { + s3URL: 's3://bucketname/key/contractsupporting1', + sha256: 'fakesha', + name: 'contractSupporting1', + dateAdded: new Date('01/15/2024') + }, + { + s3URL: 's3://bucketname/key/contractSupporting2', + sha256: 'fakesha', + name: 'contractSupporting2', + dateAdded: new Date('01/13/2024') + }, + ], + stateContacts: [ + { + name: 'State Contact 1', + titleRole: 'Test State Contact 1', + email: 'actuarycontact1@test.com', + }, + ], + contractType: 'AMENDMENT', + contractExecutionStatus: 'EXECUTED', + contractDocuments: [ + { + s3URL: 's3://bucketname/one-two/one-two.png', + sha256: 'fakesha', + name: 'contract document', + dateAdded: new Date('01/01/2024') + }, + ], + contractDateStart: new Date('01/01/2023'), + contractDateEnd: new Date('12/31/2023'), + managedCareEntities: ['MCO'], + federalAuthorities: ['STATE_PLAN'], + inLieuServicesAndSettings: true, + modifiedBenefitsProvided: true, + modifiedGeoAreaServed: false, + modifiedMedicaidBeneficiaries: true, + modifiedRiskSharingStrategy: true, + modifiedIncentiveArrangements: false, + modifiedWitholdAgreements: false, + modifiedStateDirectedPayments: true, + modifiedPassThroughPayments: true, + modifiedPaymentsForMentalDiseaseInstitutions: false, + modifiedMedicalLossRatioStandards: true, + modifiedOtherFinancialPaymentIncentive: false, + modifiedEnrollmentProcess: true, + modifiedGrevienceAndAppeal: false, + modifiedNetworkAdequacyStandards: true, + modifiedLengthOfContract: false, + modifiedNonRiskPaymentArrangements: true, + statutoryRegulatoryAttestation: true, + statutoryRegulatoryAttestationDescription: "everything meets regulatory attestation", + ...partial + } +} + +export { mockContractPackageDraft, mockContractPackageSubmitted, mockContractWithLinkedRateDraft, mockContractPackageUnlocked, mockContractFormData} diff --git a/services/app-web/src/testHelpers/apolloMocks/index.ts b/services/app-web/src/testHelpers/apolloMocks/index.ts index 656375ff07..403fd4a90f 100644 --- a/services/app-web/src/testHelpers/apolloMocks/index.ts +++ b/services/app-web/src/testHelpers/apolloMocks/index.ts @@ -65,7 +65,8 @@ export { export { mockContractPackageDraft, mockContractPackageSubmitted, - mockContractWithLinkedRateDraft + mockContractWithLinkedRateDraft, + mockContractPackageUnlocked } from './contractPackageDataMock' export { rateDataMock } from './rateDataMock' export { fetchContractMockSuccess, updateDraftContractRatesMockSuccess } from './contractGQLMock'