Check option previews under the option that owns them

This commit is contained in:
Gabriel Giordano
2026-10-14 06:43:01 +02:00
committed by paseo-bot[bot]
parent f20c768ba2
commit a3eb80df55
2 changed files with 10 additions and 4 deletions
@@ -62,7 +62,10 @@ test.describe("Question prompt pagination", () => {
await expectQuestionOptionSelected(page, "App");
await openQuestion(page, { index: 2, total: TOTAL_QUESTIONS });
await expectQuestionOptionPreview(page, 'flags.enabled("new-surface")');
await expectQuestionOptionPreview(page, {
option: "Behind feature flag",
preview: 'flags.enabled("new-surface")',
});
await chooseQuestionOption(page, "Behind feature flag");
await expectCurrentQuestion(page, {
index: 3,
@@ -43,10 +43,13 @@ export async function expectQuestionOptionSelected(page: Page, option: string):
await expect(questionOption(page, option)).toHaveAttribute("aria-checked", "true");
}
export async function expectQuestionOptionPreview(page: Page, preview: string): Promise<void> {
export async function expectQuestionOptionPreview(
page: Page,
input: { option: string; preview: string },
): Promise<void> {
await expect(
page.getByTestId("question-form-card").first().getByTestId("question-form-option-preview"),
).toContainText(preview);
questionOption(page, input.option).getByTestId("question-form-option-preview"),
).toContainText(input.preview);
}
export async function openQuestion(