Skip to content

Commit ecd2ef2

Browse files
committed
test: add assertions to verify checkboxes actually unchecked after clicking
1 parent 77869a0 commit ecd2ef2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/interviewer/Interfaces/FamilyPedigree/FamilyPedigree.stories.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,11 @@ export const SingleParentTwoDonors: ScenarioStory = {
10141014
);
10151015
donor2Cb.scrollIntoView();
10161016
await userEvent.click(donor2Cb);
1017-
await waitForStepTransition();
1017+
1018+
// Verify the checkbox actually unchecked
1019+
await waitFor(async () => {
1020+
await expect(donor2Cb).toHaveAttribute('aria-checked', 'false');
1021+
});
10181022

10191023
// Fill sibling details
10201024
await typeInTextbox('Half Sib', 0);
@@ -1034,7 +1038,12 @@ export const SingleParentTwoDonors: ScenarioStory = {
10341038
// Index 1 is the sibling's "Donor 1" checkbox
10351039
donor1Cbs[1]!.scrollIntoView();
10361040
await userEvent.click(donor1Cbs[1]!);
1037-
await waitForStepTransition();
1041+
1042+
// Verify the checkbox actually unchecked
1043+
await waitFor(async () => {
1044+
await expect(donor1Cbs[1]).toHaveAttribute('aria-checked', 'false');
1045+
});
1046+
10381047
await clickContinue();
10391048
await waitForStepTransition();
10401049

0 commit comments

Comments
 (0)