Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display submit date on Submission Summary page #2400

Merged
merged 6 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export const SingleRateSummarySection = ({
!isSubmitted && loggedInUser?.role === 'STATE_USER'
const isCMSUser = loggedInUser?.role === 'CMS_USER'
const isSubmittedOrCMSUser =
rate.status === 'SUBMITTED' || loggedInUser?.role === 'CMS_USER'
rate.status === 'SUBMITTED' ||
rate.status === 'RESUBMITTED' ||
loggedInUser?.role === 'CMS_USER'

// feature flags
const ldClient = useLDClient()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export const ContractDetailsSummarySectionV2 = ({
const ldClient = useLDClient()
const { loggedInUser } = useAuth()
const isSubmittedOrCMSUser =
contract.status === 'SUBMITTED' || loggedInUser?.role === 'CMS_USER'
contract.status === 'SUBMITTED' ||
contract.status === 'RESUBMITTED' ||
loggedInUser?.role === 'CMS_USER'
const isEditing = !isSubmittedOrCMSUser && editNavigateTo !== undefined
const contractOrRev = contractRev ? contractRev : contract

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ export const RateDetailsSummarySectionV2 = ({
}: RateDetailsSummarySectionV2Props): React.ReactElement => {
const { loggedInUser } = useAuth()
const isSubmittedOrCMSUser =
contract.status === 'SUBMITTED' || loggedInUser?.role === 'CMS_USER'
contract.status === 'SUBMITTED' ||
contract.status === 'RESUBMITTED' ||
loggedInUser?.role === 'CMS_USER'
const isEditing = !isSubmittedOrCMSUser && editNavigateTo !== undefined
const isPreviousSubmission = usePreviousSubmission()
const contractOrRev = contractRev ? contractRev : contract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
mockMNState,
mockContractPackageSubmitted,
fetchCurrentUserMock,
mockValidStateUser
mockValidStateUser,
mockContractPackageUnlocked
} from '../../../../../testHelpers/apolloMocks'

describe('SubmissionTypeSummarySection', () => {
Expand Down Expand Up @@ -182,7 +183,7 @@ describe('SubmissionTypeSummarySection', () => {
)
})

it.skip('renders expected fields for submitted package on submission summary', () => {
it('renders expected fields for submitted package on submission summary', () => {
renderWithProviders(
<SubmissionTypeSummarySection
contract={{ ...stateSubmission, status: 'SUBMITTED' }}
Expand All @@ -192,6 +193,63 @@ describe('SubmissionTypeSummarySection', () => {
isStateUser={true}
/>
)
expect(
screen.getByRole('definition', { name: 'Submitted' })
).toBeInTheDocument()
expect(
screen.getByRole('definition', { name: 'Program(s)' })
).toBeInTheDocument()
expect(
screen.getByRole('definition', { name: 'Submission type' })
).toBeInTheDocument()
expect(
screen.getByRole('definition', { name: 'Submission description' })
).toBeInTheDocument()
expect(
screen.queryByRole('definition', { name: 'Submitted' })
).toBeInTheDocument()
})

it('renders expected fields for resubmitted package on submission summary', () => {
renderWithProviders(
<SubmissionTypeSummarySection
contract={{ ...stateSubmission, status: 'RESUBMITTED' }}
statePrograms={statePrograms}
editNavigateTo="submission-type"
submissionName="MN-MSHO-0003"
isStateUser={true}
/>
)
expect(
screen.getByRole('definition', { name: 'Submitted' })
).toBeInTheDocument()
expect(
screen.getByRole('definition', { name: 'Program(s)' })
).toBeInTheDocument()
expect(
screen.getByRole('definition', { name: 'Submission type' })
).toBeInTheDocument()
expect(
screen.getByRole('definition', { name: 'Submission description' })
).toBeInTheDocument()
expect(
screen.queryByRole('definition', { name: 'Submitted' })
).toBeInTheDocument()
})

it('renders expected fields for unlocked package on submission summary', () => {
renderWithProviders(
<SubmissionTypeSummarySection
contract={mockContractPackageUnlocked()}
statePrograms={statePrograms}
editNavigateTo="submission-type"
submissionName="MN-MSHO-0003"
isStateUser={true}
/>
)
expect(
screen.getByRole('definition', { name: 'Submitted' })
).toBeInTheDocument()
expect(
screen.getByRole('definition', { name: 'Program(s)' })
).toBeInTheDocument()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ export const SubmissionTypeSummarySectionV2 = ({
const programNames = statePrograms
.filter((p) => contractFormData?.programIDs.includes(p.id))
.map((p) => p.name)
const isSubmitted = contract.status === 'SUBMITTED'

const isSubmitted =
contract.status === 'SUBMITTED' || contract.status === 'RESUBMITTED'
const isUnlocked = contract.status === 'UNLOCKED'
return (
<SectionCard
id="submissionTypeSection"
Expand All @@ -68,7 +69,7 @@ export const SubmissionTypeSummarySectionV2 = ({
{headerChildComponent && headerChildComponent}
</SectionHeader>
<dl>
{isSubmitted && (
{(isSubmitted || isUnlocked) && (
<DoubleColumnGrid>
<DataDetail
id="submitted"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ function mockContractPackageSubmitted(
): Contract {
return {
status: 'SUBMITTED',
__typename: 'Contract',
createdAt: new Date(),
updatedAt: new Date(),
id: 'test-abc-123',
Expand Down Expand Up @@ -937,6 +938,7 @@ function mockContractPackageUnlocked(
): Contract {
return {
status: 'UNLOCKED',
__typename: 'Contract',
createdAt: new Date(),
updatedAt: new Date(),
initiallySubmittedAt: new Date(),
Expand Down
Loading