diff --git a/packages/app/e2e/browser/chat-find.spec.ts b/packages/app/e2e/browser/chat-find.spec.ts index b3db4903f8..b29a5f5b89 100644 --- a/packages/app/e2e/browser/chat-find.spec.ts +++ b/packages/app/e2e/browser/chat-find.spec.ts @@ -36,6 +36,7 @@ const RESPONSE = // One message taller than the viewport, exercising navigation between distant // matches inside the same rendered row. const PARAGRAPH_PADDING = Array.from({ length: 40 }, (_, index) => `padding${index}`).join(" "); +const VIRTUALIZED_TURN_COUNT = 60; const TALL_RESPONSE = Array.from({ length: 30 }, (_, index) => { if (index === 0) return `Opening paragraph with span-needle. ${PARAGRAPH_PADDING}`; if (index === 29) return `Closing paragraph with span-needle. ${PARAGRAPH_PADDING}`; @@ -322,11 +323,11 @@ test("finds a hit in a message that streamed while the chat was open", async ({ const chat = await openChatStreamingMultiBlockReply(page); try { await openChatFind(page); - // The only hit is in the first paragraph, which is no longer the row that grows. + // The first-paragraph hit must remain searchable while the same message grows. await expectFindStatus(page, "alpha-needle", "1 of 1"); await chat.replyFinished(); await expectFindStatus(page, "beta-needle", "1 of 1"); - // One message, two Markdown blocks, one count across both. + // One message, two paragraphs, one count across both. await expectFindStatus(page, "pair-needle", "1 of 2"); await expectNextMatch(page, "2 of 2", "pair-needle"); await closeFind(page); @@ -346,12 +347,14 @@ async function openChatWithVirtualizedTallMessage(page: Page): Promise { @@ -370,9 +372,9 @@ test("counts every occurrence of a virtualized message and steps between them", const chat = await openChatWithVirtualizedTallMessage(page); try { await openChatFind(page); - await expectFindStatus(page, "span-needle", "1 of 12"); + await expectFindStatus(page, "span-needle", `1 of ${VIRTUALIZED_TURN_COUNT * 2}`); await expectHighlight(page, "span-needle"); - await expectNextMatch(page, "2 of 12", "span-needle"); + await expectNextMatch(page, `2 of ${VIRTUALIZED_TURN_COUNT * 2}`, "span-needle"); await closeFind(page); } finally { await chat.cleanup();