test(web): pin the source list's scroll geometry in the assembled browser
jsdom resolves no CSS Modules layout and reports scrollHeight === clientHeight for every element, so the unit test cannot witness the scroll the .sources max-height produces. Drive it in the real browser instead. The web-search-round search double now returns 12 provider results with a title, snippet, and date each. That pins the seam's cap end to end for the first time in a real composition — searchMaxResults keeps 8, the model-visible text carries the kept titles and none of the dropped URLs, meta.truncated is true — and 8 such rows overflow the 320px container. A case after the aria golden expands the row and asserts 8 <li>, no button, the truncation indicator, and computed max-height/overflow-y with scrollHeight > clientHeight. The recorded stream and the aria golden are unchanged: replay is a positional cursor over the fixture's chunks and the search double is a separate local endpoint, while the card is collapsed at capture time.
This commit is contained in:
@@ -36,6 +36,8 @@ Every source the tool returned is always in the DOM, so no source the view carri
|
||||
|
||||
`packages/client/ui-primitives/tests/web-block.spec.tsx` drops the collapse cases (head/tail slice, expand-on-click, collapsed-tail numbering, expander-out-of-numbering, head-alone, default cap) and adds: a 30-source card renders all 30 `<li>` with no `[aria-expanded]` and no `<button>`, every `<ol>` child is a source `<li>`, and `<li value>` numbers 1..N contiguously. `packages/client/ui-conversation/tests/web-card.spec.tsx` drops the `CHAT_WEB_MAX_SOURCES` cap assertion; the WebRow expansion test still asserts the card shows every source field. The `packages/web/tool-web` tests are unchanged — the model side did not move.
|
||||
|
||||
jsdom resolves no CSS Modules layout, so it reports `scrollHeight === clientHeight` for every element and cannot witness the scroll at all. The geometry is pinned in the assembled browser instead, by `apps/web/tests/web-search-round.e2e.ts`: its deterministic search double returns 12 provider results, each with a title, a citation snippet, and a date. That first pins the seam's cap end to end in a real composition — the shipped `searchMaxResults` keeps 8, the model-visible render text carries the 8 kept titles and none of the 4 dropped URLs plus `(Showing the first 8 sources. Refine the query for more.)`, and `meta.truncated` is true. A case after the aria golden then expands the `web_search` row and asserts on the card's `<ol>`: 8 `<li>`, no `<button>` anywhere in the card, the `来源列表已截断` indicator visible, and computed `max-height: 320px` with `overflow-y: auto` over `scrollHeight` 574 against `clientHeight` 320. Neither the recorded stream nor the aria golden moved: replay is a positional cursor over the fixture's `assistant/chunk` entries and the search double is a separate local endpoint the provider reaches by `fetch`, while the card is collapsed at capture time so its `<ol>` is out of the DOM and the summary row carries no source count.
|
||||
|
||||
## Related
|
||||
|
||||
- [Web result card](2026-07-30-web-result-card.md) — the `card: 'web'` render-intent arm and `presentationMeta` route this card consumes; the source of the capped-once list.
|
||||
|
||||
Reference in New Issue
Block a user