Skip to content

Commit

Permalink
feat(withdrawal-confirmation): medicaid and chip spa state withdrawal…
Browse files Browse the repository at this point in the history
… confirmation (#938)

* finish logic for medicaid and chip spa state

* add snapshot logic

* add snapshot

* update snapshots

* snapshot update

* update tests
  • Loading branch information
jdinh8124 authored and benjaminpaige committed Jan 2, 2025
1 parent 12dffd1 commit 8e93f31
Show file tree
Hide file tree
Showing 9 changed files with 2,754 additions and 0 deletions.
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>
);
};
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>
);
};
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";
5 changes: 5 additions & 0 deletions lib/libs/email/preview/WithdrawConfirmation/State/AppK.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<<<<<<< HEAD
import { Waiver1915bStateEmail } from "../../../content/withdrawRai/emailTemplates/Waiver1915bState";
import { emailTemplateValue } from "../../../mock-data/new-submission";
=======
import { WaiverStateEmail } from "libs/email/content/withdrawConfirmation/emailTemplates";
import { emailTemplateValue } from "libs/email/mock-data/new-submission";
>>>>>>> ab59fff7 (feat(withdrawal-confirmation): medicaid and chip spa state withdrawal confirmation (#938))
import * as attachments from "../../../mock-data/attachments";

export default () => {
Expand Down
22 changes: 22 additions & 0 deletions lib/libs/email/preview/WithdrawConfirmation/State/CHIP_SPA.tsx
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 lib/libs/email/preview/WithdrawConfirmation/State/Medicaid_SPA.tsx
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,
},
}}
/>
);
};
5 changes: 5 additions & 0 deletions lib/libs/email/preview/WithdrawConfirmation/State/Waiver.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<<<<<<< HEAD
import { WaiverStateEmail } from "../../../content/withdrawConfirmation/emailTemplates/WaiverState";
import { emailTemplateValue } from "../../../mock-data/new-submission";
=======
import { WaiverStateEmail } from "libs/email/content/withdrawConfirmation/emailTemplates";
import { emailTemplateValue } from "libs/email/mock-data/new-submission";
>>>>>>> ab59fff7 (feat(withdrawal-confirmation): medicaid and chip spa state withdrawal confirmation (#938))
import * as attachments from "../../../mock-data/attachments";

export default () => {
Expand Down
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();
});
});
Loading

0 comments on commit 8e93f31

Please sign in to comment.