Repository navigation
test(app): close the three gaps left by the pinned-sessions PR - #191
Merged
Merged
Conversation
#189 shipped with the pinned section covered only through the sidebar row menu. Three behaviours it introduced had nothing behind them. - The five-row cap: pinning a sixth session now has to leave the list capped and scrolling, with all six rows still rendered, and Recents still holding its height. PINNED_VISIBLE_ROWS appeared in no test before this. - The in-session header menu: pinning from the ⋯ beside a session title has to show up in the sidebar. That is the cross-surface agreement DIVERGENCES singles out as the silent breakage — the header resolves the pin's server independently, and a mismatch files the pin under a key the sidebar never reads. - Deleting a pinned session has to drop the pin from storage, and pins have to be stored under the server they were made against rather than in one flat list. Each was run against a deliberate break of the behaviour it covers and fails there. The per-server test needed tightening to earn that: the first version asserted only that some single key existed, which a hardcoded "all" satisfied, so it now asserts the exact server key. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#189 shipped the pinned section with coverage only through the sidebar row menu. Three behaviours it introduced had nothing behind them. This adds four e2e tests, all in the existing
sidebar-pinned-sessions.spec.ts.1. The five-row scroll cap
PINNED_VISIBLE_ROWSappeared in no test at all, so the cap that stops a long pin list from squeezing Recents out of the column was unguarded. A new harness seeds seven sessions and pins six:Reading the overflow needed care:
ScrollViewcaps its root and scrolls an inner.scroll-view__viewport, so measuringscrollHeighton the element carrying themax-heightreported no overflow and the first version of this test passed against a broken cap.2. The in-session header menu
Every existing test drove the sidebar row menu. Pinning from the ⋯ beside a session title now has to appear in the sidebar's Pinned section, and the header then has to offer Unpin.
This is the failure
DIVERGENCES.mdsingles out: the header resolves the pin's server independently of the sidebar (params.serverKey ?? the current connection), and if the two ever disagree the pin is filed under a key the sidebar never reads, so the row silently never appears.3. Delete-drops-the-pin, and per-server storage
Deleting a pinned session has to clear it from Pinned and from storage — an id left behind would silently re-pin a future session that reused it. The mock serves
/sessionfrom an array by reference, so the DELETE route splices it and the index refetch cannot resurrect the row.Pins also have to be stored under the server they were made against rather than in one flat list, since session ids are only unique within a server.
Each test was checked against a break
max-heightraised to 50 rowspinned?.remove(...)deleted fromdeleteSession"all"keyThe per-server one needed tightening to earn its place. The first version asserted only that
sessionshad exactly one non-empty key holding the id — which the flattened{ all: [...] }break satisfied, so it passed against the bug. It now asserts the exact server key, derived from the harness the same wayplaywright.config.tsbuilds it.Verification
bun test:e2e:local— 134 passed, 0 failed (was 130)bun test(packages/app) — 638 passbun typecheck(packages/app) — cleanbun lint— 4746 warnings + 1 error, identical tomainTest-only: no
srcchanges, so no CHANGELOG or DIVERGENCES entry.🤖 Generated with Claude Code