diff --git a/packages/app/e2e/browser/question-prompt-pagination.spec.ts b/packages/app/e2e/browser/question-prompt-pagination.spec.ts index 3a3a8ced5c..1d75ae2839 100644 --- a/packages/app/e2e/browser/question-prompt-pagination.spec.ts +++ b/packages/app/e2e/browser/question-prompt-pagination.spec.ts @@ -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, diff --git a/packages/app/e2e/support/helpers/questions.ts b/packages/app/e2e/support/helpers/questions.ts index e7d24b6eea..a26bd9a975 100644 --- a/packages/app/e2e/support/helpers/questions.ts +++ b/packages/app/e2e/support/helpers/questions.ts @@ -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 { +export async function expectQuestionOptionPreview( + page: Page, + input: { option: string; preview: string }, +): Promise { 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(