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

feat(withdrawal-confirmation): medicaid and chip spa state withdrawal confirmation #938

Merged
merged 12 commits into from
Dec 31, 2024
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";

This file was deleted.

4 changes: 2 additions & 2 deletions lib/libs/email/preview/WithdrawConfirmation/State/AppK.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WaiverStateEmail } from "lib/libs/email/content/withdrawConfirmation/emailTemplates";
import { emailTemplateValue } from "lib/libs/email/mock-data/new-submission";
import { WaiverStateEmail } from "libs/email/content/withdrawConfirmation/emailTemplates";
import { emailTemplateValue } from "libs/email/mock-data/new-submission";
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,
},
}}
/>
);
};
4 changes: 2 additions & 2 deletions lib/libs/email/preview/WithdrawConfirmation/State/Waiver.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WaiverStateEmail } from "lib/libs/email/content/withdrawConfirmation/emailTemplates";
import { emailTemplateValue } from "lib/libs/email/mock-data/new-submission";
import { WaiverStateEmail } from "libs/email/content/withdrawConfirmation/emailTemplates";
import { emailTemplateValue } from "libs/email/mock-data/new-submission";
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
Loading