-
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.
feat(withdrawal-confirmation): medicaid and chip spa state withdrawal…
… confirmation (#938) * finish logic for medicaid and chip spa state * add snapshot logic * add snapshot * update snapshots * snapshot update * update tests
- Loading branch information
1 parent
12dffd1
commit 8e93f31
Showing
9 changed files
with
2,754 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
lib/libs/email/content/withdrawConfirmation/emailTemplates/ChipSpaState.tsx
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { CommonEmailVariables, Events } from "shared-types"; | ||
import { FollowUpNotice, BasicFooter } from "../../email-components"; | ||
import { BaseEmailTemplate } from "../../email-templates"; | ||
|
||
export const ChipSpaStateEmail = (props: { | ||
variables: Events["WithdrawPackage"] & CommonEmailVariables; | ||
}) => { | ||
const variables = props.variables; | ||
return ( | ||
<BaseEmailTemplate | ||
previewText={`CHIP SPA Package ${variables.id} Withdrawal Confirmation`} | ||
heading={`This email is to confirm CHIP SPA ${variables.id} was withdrawn by ${variables.submitterName}. The review of CHIP SPA ${variables.id} has concluded.`} | ||
applicationEndpointUrl={variables.applicationEndpointUrl} | ||
footerContent={<BasicFooter />} | ||
> | ||
<FollowUpNotice isChip /> | ||
</BaseEmailTemplate> | ||
); | ||
}; |
19 changes: 19 additions & 0 deletions
19
lib/libs/email/content/withdrawConfirmation/emailTemplates/MedSpaState.tsx
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { CommonEmailVariables, Events } from "shared-types"; | ||
import { FollowUpNotice, BasicFooter } from "../../email-components"; | ||
import { BaseEmailTemplate } from "../../email-templates"; | ||
|
||
export const MedSpaStateEmail = (props: { | ||
variables: Events["WithdrawPackage"] & CommonEmailVariables; | ||
}) => { | ||
const variables = props.variables; | ||
return ( | ||
<BaseEmailTemplate | ||
previewText={`Medicaid SPA Package ${variables.id} Withdrawal Confirmation`} | ||
heading={`This email is to confirm Medicaid SPA ${variables.id} was withdrawn by ${variables.submitterName}. The review of Medicaid SPA ${variables.id} has concluded.`} | ||
applicationEndpointUrl={variables.applicationEndpointUrl} | ||
footerContent={<BasicFooter />} | ||
> | ||
<FollowUpNotice includeStateLead={false} /> | ||
</BaseEmailTemplate> | ||
); | ||
}; |
2 changes: 2 additions & 0 deletions
2
lib/libs/email/content/withdrawConfirmation/emailTemplates/index.tsx
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
export { ChipSpaStateEmail } from "./ChipSpaState"; | ||
export { MedSpaStateEmail } from "./MedSpaState"; | ||
export { WaiverStateEmail } from "./WaiverState"; |
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
22 changes: 22 additions & 0 deletions
22
lib/libs/email/preview/WithdrawConfirmation/State/CHIP_SPA.tsx
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ChipSpaStateEmail } from "libs/email/content/withdrawConfirmation/emailTemplates"; | ||
import { emailTemplateValue } from "libs/email/mock-data/new-submission"; | ||
import * as attachments from "../../../mock-data/attachments"; | ||
|
||
export default () => { | ||
return ( | ||
<ChipSpaStateEmail | ||
variables={{ | ||
...emailTemplateValue, | ||
event: "withdraw-package", | ||
id: "CO-1234.R21.00", | ||
authority: "1915(b)", | ||
actionType: "Amend", | ||
territory: "CO", | ||
attachments: { | ||
officialWithdrawalLetter: attachments.withdrawRequest, | ||
supportingDocumentation: attachments.supportingDocumentation, | ||
}, | ||
}} | ||
/> | ||
); | ||
}; |
22 changes: 22 additions & 0 deletions
22
lib/libs/email/preview/WithdrawConfirmation/State/Medicaid_SPA.tsx
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { MedSpaStateEmail } from "libs/email/content/withdrawConfirmation/emailTemplates"; | ||
import { emailTemplateValue } from "libs/email/mock-data/new-submission"; | ||
import * as attachments from "../../../mock-data/attachments"; | ||
|
||
export default () => { | ||
return ( | ||
<MedSpaStateEmail | ||
variables={{ | ||
...emailTemplateValue, | ||
event: "withdraw-package", | ||
id: "CO-1234.R21.00", | ||
authority: "1915(b)", | ||
actionType: "Amend", | ||
territory: "CO", | ||
attachments: { | ||
officialWithdrawalLetter: attachments.withdrawRequest, | ||
supportingDocumentation: attachments.supportingDocumentation, | ||
}, | ||
}} | ||
/> | ||
); | ||
}; |
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
29 changes: 29 additions & 0 deletions
29
lib/libs/email/preview/WithdrawConfirmation/State/WithdrawConfirmationState.test.tsx
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { describe, it, expect } from "vitest"; | ||
import { render } from "@testing-library/react"; | ||
import Appk from "./AppK"; | ||
import CHIP_SPA from "./CHIP_SPA"; | ||
import Medicaid_SPA from "./Medicaid_SPA"; | ||
import Waiver from "./Waiver"; | ||
|
||
describe("Withdraw Confirmation State Email Snapshot Test", () => { | ||
it("renders a Appk Preview Template", () => { | ||
const template = render(<Appk />); | ||
|
||
expect(template).toMatchSnapshot(); | ||
}); | ||
it("renders a ChipSPA Preview Template", () => { | ||
const template = render(<CHIP_SPA />); | ||
|
||
expect(template).toMatchSnapshot(); | ||
}); | ||
it("renders a Medicaid_SPA Preview Template", () => { | ||
const template = render(<Medicaid_SPA />); | ||
|
||
expect(template).toMatchSnapshot(); | ||
}); | ||
it("renders a Waiver Preview Template", () => { | ||
const template = render(<Waiver />); | ||
|
||
expect(template).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.