From 00efaf376dcbe0ca16da74054949bd1ec5597d3b Mon Sep 17 00:00:00 2001 From: ZiyaZhang <199893125+ZiyaZhang@users.noreply.github.com> Date: Thu, 22 Oct 2026 00:32:24 -0700 Subject: [PATCH] test(web): expect the wider fold preview in the page card replay --- apps/web/tests/creation-recommendations.e2e.ts | 5 ++++- .../web/creation-recommendations/custom-location.expected.md | 2 +- snapshots/web/creation-recommendations/dismissed.expected.md | 2 +- snapshots/web/creation-recommendations/info.expected.md | 2 +- snapshots/web/creation-recommendations/offered.expected.md | 2 +- snapshots/web/creation-recommendations/options.expected.md | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/web/tests/creation-recommendations.e2e.ts b/apps/web/tests/creation-recommendations.e2e.ts index 51516b57db..99010ba9fd 100644 --- a/apps/web/tests/creation-recommendations.e2e.ts +++ b/apps/web/tests/creation-recommendations.e2e.ts @@ -75,7 +75,10 @@ describe('creation recommendation after an explicit wish', () => { const compactHeight = await plan.evaluate(element => element.clientHeight) const previewText = await plan.innerText() expect(previewText.endsWith('…')).toBe(true) - expect(Array.from(new Intl.Segmenter(undefined, { granularity: 'grapheme' }).segment(previewText))).toHaveLength(81) + // The preview keeps about 260 Latin-letter widths before the ellipsis; a trailing space may be trimmed. + const previewLength = Array.from(new Intl.Segmenter(undefined, { granularity: 'grapheme' }).segment(previewText)).length + expect(previewLength).toBeGreaterThan(200) + expect(previewLength).toBeLessThanOrEqual(261) await expand.click() expect(await plan.evaluate(element => element.clientHeight)).toBeGreaterThan(compactHeight) expect(await card.getByRole('button', { name: 'Create', exact: true }).isEnabled()).toBe(true) diff --git a/snapshots/web/creation-recommendations/custom-location.expected.md b/snapshots/web/creation-recommendations/custom-location.expected.md index 03fcae29ab..00cfed3aa5 100644 --- a/snapshots/web/creation-recommendations/custom-location.expected.md +++ b/snapshots/web/creation-recommendations/custom-location.expected.md @@ -2,7 +2,7 @@ - text: Personalized pages - button "How creation works and token usage" - strong: Counter - - paragraph: "Need: Keep a small counter visible across conversations. Location: A card titled…" + - paragraph: "Need: Keep a small counter visible across conversations. Location: A card titled Today’s achievements in the right sidebar. Controls: Increment and reset buttons beside the current value. Storage: Save changes in browser storage across navigation and refresh.…" - button "View full plan" - text: Add to - 'button "Add to: Write your own"': Write your own diff --git a/snapshots/web/creation-recommendations/dismissed.expected.md b/snapshots/web/creation-recommendations/dismissed.expected.md index 58e139f0d4..a860d1ec53 100644 --- a/snapshots/web/creation-recommendations/dismissed.expected.md +++ b/snapshots/web/creation-recommendations/dismissed.expected.md @@ -3,6 +3,6 @@ - button "How creation works and token usage" - status: Dismissed - strong: Counter - - paragraph: "Need: Keep a small counter visible across conversations. Location: A card titled…" + - paragraph: "Need: Keep a small counter visible across conversations. Location: A card titled Today’s achievements in the right sidebar. Controls: Increment and reset buttons beside the current value. Storage: Save changes in browser storage across navigation and refresh.…" - button "View full plan" - paragraph: Add to · Session tab diff --git a/snapshots/web/creation-recommendations/info.expected.md b/snapshots/web/creation-recommendations/info.expected.md index 20b589d7b0..c2d3ccc757 100644 --- a/snapshots/web/creation-recommendations/info.expected.md +++ b/snapshots/web/creation-recommendations/info.expected.md @@ -7,7 +7,7 @@ - strong: Creation may take a while and use a large number of tokens. - paragraph: Click Create to start in the background. You can keep chatting here. - strong: Counter - - paragraph: "Need: Keep a small counter visible across conversations. Location: A card titled…" + - paragraph: "Need: Keep a small counter visible across conversations. Location: A card titled Today’s achievements in the right sidebar. Controls: Increment and reset buttons beside the current value. Storage: Save changes in browser storage across navigation and refresh.…" - button "View full plan" - text: Add to - 'button "Add to: Right sidebar"': Right sidebar diff --git a/snapshots/web/creation-recommendations/offered.expected.md b/snapshots/web/creation-recommendations/offered.expected.md index 20b589d7b0..c2d3ccc757 100644 --- a/snapshots/web/creation-recommendations/offered.expected.md +++ b/snapshots/web/creation-recommendations/offered.expected.md @@ -7,7 +7,7 @@ - strong: Creation may take a while and use a large number of tokens. - paragraph: Click Create to start in the background. You can keep chatting here. - strong: Counter - - paragraph: "Need: Keep a small counter visible across conversations. Location: A card titled…" + - paragraph: "Need: Keep a small counter visible across conversations. Location: A card titled Today’s achievements in the right sidebar. Controls: Increment and reset buttons beside the current value. Storage: Save changes in browser storage across navigation and refresh.…" - button "View full plan" - text: Add to - 'button "Add to: Right sidebar"': Right sidebar diff --git a/snapshots/web/creation-recommendations/options.expected.md b/snapshots/web/creation-recommendations/options.expected.md index d98e24fdc1..6853871727 100644 --- a/snapshots/web/creation-recommendations/options.expected.md +++ b/snapshots/web/creation-recommendations/options.expected.md @@ -2,7 +2,7 @@ - text: Personalized pages - button "How creation works and token usage" - strong: Counter - - paragraph: "Need: Keep a small counter visible across conversations. Location: A card titled…" + - paragraph: "Need: Keep a small counter visible across conversations. Location: A card titled Today’s achievements in the right sidebar. Controls: Increment and reset buttons beside the current value. Storage: Save changes in browser storage across navigation and refresh.…" - button "View full plan" - text: Add to - 'button "Add to: Session tab"': Session tab