From e869b2631eb3372f8ee3c034f69aab9e37a8ca72 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Sat, 22 Aug 2026 09:24:36 -0700 Subject: [PATCH] Fix US-039 spec --- e2e/specs/articles-threads.spec.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/e2e/specs/articles-threads.spec.ts b/e2e/specs/articles-threads.spec.ts index b926e755..2314fb40 100644 --- a/e2e/specs/articles-threads.spec.ts +++ b/e2e/specs/articles-threads.spec.ts @@ -354,7 +354,11 @@ test("US-039 comment on an article", async ({seed, as}) => { await editorOf(composerForm(bob)).pressSequentially("The soil chapter is the good one.") await composerForm(bob).getByRole("button", {name: "Comment"}).click() - await expect(bob.getByText("The soil chapter is the good one.")).toBeVisible() + // The comment renders from the optimistic write, but the composer holds what was typed until the + // relay confirms it, so for a moment the page carries this text twice. Match the rendered card. + await expect( + bob.locator(".card.z-feature").filter({hasText: "The soil chapter is the good one."}), + ).toBeVisible() const carol = await as(users.carol, articlesPath) @@ -372,7 +376,11 @@ test("US-039 comment on an article", async ({seed, as}) => { ) await composerForm(carol).getByRole("button", {name: "Reply", exact: true}).click() - await expect(carol.getByText("Only because you skipped the water chapter.")).toBeVisible() + await expect( + carol + .locator(".card.z-feature") + .filter({hasText: "Only because you skipped the water chapter."}), + ).toBeVisible() const alice = await as(users.alice, articlesPath)