Skip to content

Commit

Permalink
Update tests and snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
mpbrown committed Dec 15, 2023
1 parent 62cd005 commit cea3bce
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe("TestResultPrintModal with only COVID results", () => {

it("should render only COVID information", () => {
renderWithUser();
expect(screen.getByText("Test result: COVID-19")).toBeInTheDocument();
expect(screen.getByText("For COVID-19:")).toBeInTheDocument();
});

it("matches screenshot", () => {
Expand Down Expand Up @@ -136,9 +136,7 @@ describe("TestResultPrintModal with multiplex results in SimpleReport App", () =
});

it("should render flu information", () => {
expect(
screen.getByText("Test results: COVID-19 and flu")
).toBeInTheDocument();
expect(screen.getByText("Test results")).toBeInTheDocument();
expect(screen.getByText("For flu A and B:")).toBeInTheDocument();
});

Expand Down Expand Up @@ -185,9 +183,7 @@ describe("TestResultPrintModal with multiplex results in Pxp App", () => {
});

it("should render information", () => {
expect(
screen.getByText("Test results: COVID-19 and flu")
).toBeInTheDocument();
expect(screen.getByText("Test results")).toBeInTheDocument();
expect(screen.getByText("fake npi for pxp")).toBeInTheDocument();
expect(screen.getAllByText("Negative").length).toBe(3);
});
Expand Down Expand Up @@ -231,11 +227,8 @@ describe("TestResultPrintModal with RSV and flu results", () => {
);
});

// this should be changed when we correct our copy to the right header text (#7000)
it("should render flu information", () => {
expect(
screen.getByText("Test results: COVID-19 and flu")
).toBeInTheDocument();
expect(screen.getByText("Test results")).toBeInTheDocument();
expect(screen.getByText("For flu A and B:")).toBeInTheDocument();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Object {
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -302,6 +302,27 @@ Object {
</a>
(cdc.gov/flu/treatment/takingcare.htm).
</p>
<p
class="text-bold sr-guidance-heading"
>
For RSV:
</p>
<p>
RSV usually causes mild, cold-like symptoms. Most people can recover at home, but RSV can cause serious illness and hospitalization for infants and older adults. You can help prevent the spread of RSV by staying at home when sick, avoiding close contact with others, and washing your hands frequently.
</p>
<p>
You can take steps to relieve symptoms, including managing fever and pain with over-the-counter fever reducers, and drinking enough fluids. If your child has RSV, talk to their healthcare provider before giving them non-prescription cold medicine.
</p>
<p>
Contact your healthcare professional if your symptoms worsen, you are having trouble breathing, or are dehydrated.
<a
href="https://www.cdc.gov/rsv/about/symptoms.html"
rel="noopener noreferrer"
target="_blank"
>
Learn more about RSV symptoms and care on the CDC website.
</a>
</p>
</section>
</main>
<footer>
Expand Down Expand Up @@ -383,7 +404,7 @@ Object {
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -628,6 +649,27 @@ Object {
</a>
(cdc.gov/flu/treatment/takingcare.htm).
</p>
<p
class="text-bold sr-guidance-heading"
>
For RSV:
</p>
<p>
RSV usually causes mild, cold-like symptoms. Most people can recover at home, but RSV can cause serious illness and hospitalization for infants and older adults. You can help prevent the spread of RSV by staying at home when sick, avoiding close contact with others, and washing your hands frequently.
</p>
<p>
You can take steps to relieve symptoms, including managing fever and pain with over-the-counter fever reducers, and drinking enough fluids. If your child has RSV, talk to their healthcare provider before giving them non-prescription cold medicine.
</p>
<p>
Contact your healthcare professional if your symptoms worsen, you are having trouble breathing, or are dehydrated.
<a
href="https://www.cdc.gov/rsv/about/symptoms.html"
rel="noopener noreferrer"
target="_blank"
>
Learn more about RSV symptoms and care on the CDC website.
</a>
</p>
</section>
</main>
<footer>
Expand Down Expand Up @@ -766,7 +808,7 @@ Object {
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -1122,7 +1164,7 @@ your local health department.
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -1535,7 +1577,7 @@ Object {
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -1941,7 +1983,7 @@ Object {
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -2401,7 +2443,7 @@ exports[`TestResultPrintModal with only COVID results matches screenshot 1`] = `
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test result: COVID-19
Test result
</h1>
<img
alt="SimpleReport logo"
Expand Down
32 changes: 8 additions & 24 deletions frontend/src/patientApp/timeOfTest/TestResult.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ describe("TestResult - single disease", () => {

const patientApp = screen.getByTestId("patient-app");

expect(
within(patientApp).getByText("Test result: COVID-19")
).toBeInTheDocument();
expect(within(patientApp).getByText("Test result")).toBeInTheDocument();
expect(
within(patientApp).getByText("Abbott BinaxNOW (Antigen)")
).toBeInTheDocument();
Expand All @@ -82,9 +80,7 @@ describe("TestResult - single disease", () => {

const patientApp = screen.getByTestId("patient-app");

expect(
within(patientApp).getByText("Test result: COVID-19")
).toBeInTheDocument();
expect(within(patientApp).getByText("Test result")).toBeInTheDocument();
expect(within(patientApp).getByText("Positive")).toBeInTheDocument();
});
it("should show a negative result", () => {
Expand All @@ -100,9 +96,7 @@ describe("TestResult - single disease", () => {

const patientApp = screen.getByTestId("patient-app");

expect(
within(patientApp).getByText("Test result: COVID-19")
).toBeInTheDocument();
expect(within(patientApp).getByText("Test result")).toBeInTheDocument();
expect(within(patientApp).getByText("Negative")).toBeInTheDocument();
});
it("should show an inconclusive result", () => {
Expand All @@ -118,9 +112,7 @@ describe("TestResult - single disease", () => {

const patientApp = screen.getByTestId("patient-app");

expect(
within(patientApp).getByText("Test result: COVID-19")
).toBeInTheDocument();
expect(within(patientApp).getByText("Test result")).toBeInTheDocument();
expect(within(patientApp).getByText("Inconclusive")).toBeInTheDocument();
});
});
Expand All @@ -140,9 +132,7 @@ describe("TestResult - multiple diseases", () => {
);

const patientApp = screen.getByTestId("patient-app");
expect(
within(patientApp).getByText("Test results: COVID-19 and flu")
).toBeInTheDocument();
expect(within(patientApp).getByText("Test results")).toBeInTheDocument();
expect(within(patientApp).getByText("COVID-19 result")).toBeInTheDocument();
expect(within(patientApp).getByText("Flu A result")).toBeInTheDocument();
expect(within(patientApp).getByText("Flu B result")).toBeInTheDocument();
Expand All @@ -164,9 +154,7 @@ describe("TestResult - multiple diseases", () => {
);

const patientApp = screen.getByTestId("patient-app");
expect(
within(patientApp).getByText("Test results: COVID-19 and flu")
).toBeInTheDocument();
expect(within(patientApp).getByText("Test results")).toBeInTheDocument();
expect(within(patientApp).getByText("COVID-19 result")).toBeInTheDocument();
expect(within(patientApp).getByText("Flu A result")).toBeInTheDocument();
expect(within(patientApp).getByText("Flu B result")).toBeInTheDocument();
Expand All @@ -192,9 +180,7 @@ describe("TestResult - multiple diseases", () => {
);

const patientApp = screen.getByTestId("patient-app");
expect(
within(patientApp).getByText("Test results: COVID-19 and flu")
).toBeInTheDocument();
expect(within(patientApp).getByText("Test results")).toBeInTheDocument();
expect(within(patientApp).getByText("COVID-19 result")).toBeInTheDocument();
expect(within(patientApp).getByText("Flu A result")).toBeInTheDocument();
expect(within(patientApp).getByText("Flu B result")).toBeInTheDocument();
Expand All @@ -214,9 +200,7 @@ describe("TestResult - multiple diseases", () => {
);

const patientApp = screen.getByTestId("patient-app");
expect(
within(patientApp).getByText("Test results: COVID-19 and flu")
).toBeInTheDocument();
expect(within(patientApp).getByText("Test results")).toBeInTheDocument();
expect(within(patientApp).getByText("COVID-19 result")).toBeInTheDocument();
expect(within(patientApp).getByText("RSV result")).toBeInTheDocument();
expect(within(patientApp).getAllByText("Positive")).toHaveLength(1);
Expand Down

0 comments on commit cea3bce

Please sign in to comment.