Skip to content

Commit ebf92ea

Browse files
committed
ui tests: add missing await before nav status check
This caused tests to pass, but failure to be reported outside tests. The option selection also had a missing await. Use `toBeDisabled` and `toBeEnabled` instead of the 'disabled' attribute check.
1 parent aec0901 commit ebf92ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/evolution-frontend/tests/ui-testing/testHelpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ export const inputSelectTest: InputSelectTest = ({ context, path, value }) => {
436436
const newPath = context.objectDetector.replaceWithIds(path);
437437
const option = context.page.locator(`id=survey-question__${newPath}`);
438438
await option.scrollIntoViewIfNeeded();
439-
option.selectOption(value);
439+
await option.selectOption(value);
440440
await expect(option).toHaveValue(value);
441441
await focusOut(context.page);
442442
});
@@ -1099,12 +1099,12 @@ export const verifyNavBarButtonStatus: NavBarButtonStatusTest = ({ context, butt
10991099
break;
11001100
}
11011101

1102-
expect(button).toHaveClass(expectedStatusClass);
1102+
await expect(button).toHaveClass(expectedStatusClass);
11031103

11041104
if (isDisabled) {
1105-
await expect(button).toHaveAttribute('disabled');
1105+
await expect(button).toBeDisabled();
11061106
} else {
1107-
await expect(button).not.toHaveAttribute('disabled');
1107+
await expect(button).toBeEnabled();
11081108
}
11091109
});
11101110
};

0 commit comments

Comments
 (0)