Skip to content

Commit

Permalink
Update TestResultDetailsModal.test.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
mpbrown committed Sep 24, 2024
1 parent fa63358 commit 855c6a1
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ const nonMultiplexTestResult = {
symptoms: '{"00000":"false"}',
symptomOnset: "myOnset",
pregnancy: null,
surveyData: {
pregnancy: null,
syphilisHistory: null,
symptoms: '{"00000":"false"}',
symptomOnset: "myOnset",
noSymptoms: false,
genderOfSexualPartners: null,
},
deviceType: {
name: "Fake device",
},
Expand Down Expand Up @@ -67,8 +75,8 @@ hivTestResult.results = [
__typename: "MultiplexResult",
},
];
hivTestResult.genderOfSexualPartners = ["female", "male", "other"];
hivTestResult.pregnancy = "77386006";
hivTestResult.surveyData.genderOfSexualPartners = ["female", "male", "other"];
hivTestResult.surveyData.pregnancy = "77386006";

const syphilisTestResult = JSON.parse(JSON.stringify(nonMultiplexTestResult));
syphilisTestResult.results = [
Expand All @@ -78,8 +86,17 @@ syphilisTestResult.results = [
__typename: "MultiplexResult",
},
];
syphilisTestResult.pregnancy = "77386006";
syphilisTestResult.symptoms = '{"266128007":"true"}';
syphilisTestResult.surveyData.pregnancy = "77386006";
syphilisTestResult.surveyData.syphilisHistory = "1087151000119108";
syphilisTestResult.surveyData.symptoms =
'{"91554004":"false","15188001":"false","724386005":"false","56940005":"true","266128007":"true","46636008":"true","68225006":"false","195469007":"false","26284000":"false"}';
syphilisTestResult.surveyData.symptomOnset = "2024-09-24";
syphilisTestResult.surveyData.noSymptoms = false;
syphilisTestResult.surveyData.genderOfSexualPartners = [
"female",
"male",
"other",
];

const renderComponent = (testResult: TestResult) =>
render(
Expand Down Expand Up @@ -176,8 +193,17 @@ describe("Syphilis TestResultDetailsModal", () => {
expect(screen.getByText("Syphilis result")).toBeInTheDocument();
expect(screen.getByText("Symptoms")).toBeInTheDocument();
expect(screen.getByText("Symptom onset")).toBeInTheDocument();
expect(screen.getByText("Body Rash")).toBeInTheDocument();
expect(
screen.getByText(
"Blurred vision, Palmar (hand)/plantar (foot) rash, Body Rash"
)
).toBeInTheDocument();
expect(screen.getByText("Gender of sexual partners")).toBeInTheDocument();
expect(screen.getByText("Female, Male, Other")).toBeInTheDocument();
expect(screen.getByText("Pregnant?")).toBeInTheDocument();
expect(
screen.getByText("Previously told they have syphilis?")
).toBeInTheDocument();
});

it("matches screenshot", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ Object {
<td
class="padding-y-3 border-bottom-1px border-base-lighter"
>
Body Rash
Blurred vision, Palmar (hand)/plantar (foot) rash, Body Rash
</td>
</tr>
<tr>
Expand All @@ -486,7 +486,7 @@ Object {
<td
class="padding-y-3 border-bottom-1px border-base-lighter"
>
Invalid date
09/24/2024
</td>
</tr>
<tr>
Expand All @@ -501,6 +501,30 @@ Object {
Yes
</td>
</tr>
<tr>
<th
class="text-bold text-no-strike text-ink padding-y-3 border-bottom-1px border-base-lighter width-card-lg text-left"
>
Gender of sexual partners
</th>
<td
class="padding-y-3 border-bottom-1px border-base-lighter"
>
Female, Male, Other
</td>
</tr>
<tr>
<th
class="text-bold text-no-strike text-ink padding-y-3 border-bottom-1px border-base-lighter width-card-lg text-left"
>
Previously told they have syphilis?
</th>
<td
class="padding-y-3 border-bottom-1px border-base-lighter"
>
Yes
</td>
</tr>
<tr>
<th
class="text-bold text-no-strike text-ink padding-y-3 width-card-lg text-left"
Expand Down Expand Up @@ -634,7 +658,7 @@ Object {
<td
class="padding-y-3 border-bottom-1px border-base-lighter"
>
Body Rash
Blurred vision, Palmar (hand)/plantar (foot) rash, Body Rash
</td>
</tr>
<tr>
Expand All @@ -646,7 +670,7 @@ Object {
<td
class="padding-y-3 border-bottom-1px border-base-lighter"
>
Invalid date
09/24/2024
</td>
</tr>
<tr>
Expand All @@ -661,6 +685,30 @@ Object {
Yes
</td>
</tr>
<tr>
<th
class="text-bold text-no-strike text-ink padding-y-3 border-bottom-1px border-base-lighter width-card-lg text-left"
>
Gender of sexual partners
</th>
<td
class="padding-y-3 border-bottom-1px border-base-lighter"
>
Female, Male, Other
</td>
</tr>
<tr>
<th
class="text-bold text-no-strike text-ink padding-y-3 border-bottom-1px border-base-lighter width-card-lg text-left"
>
Previously told they have syphilis?
</th>
<td
class="padding-y-3 border-bottom-1px border-base-lighter"
>
Yes
</td>
</tr>
<tr>
<th
class="text-bold text-no-strike text-ink padding-y-3 width-card-lg text-left"
Expand Down

0 comments on commit 855c6a1

Please sign in to comment.