diff --git a/apps/web/tests/navigation-panes.e2e.ts b/apps/web/tests/navigation-panes.e2e.ts index 75202aea47..effd31c913 100644 --- a/apps/web/tests/navigation-panes.e2e.ts +++ b/apps/web/tests/navigation-panes.e2e.ts @@ -27,6 +27,7 @@ const SEED = join(SNAPSHOT_DIR, 'session.v3.jsonl') const TRAJECTORY_EXPECTED = join(SNAPSHOT_DIR, 'trajectory.expected.md') const TIMING_EXPECTED = join(SNAPSHOT_DIR, 'timing.expected.md') const SEARCH_EXPECTED = join(SNAPSHOT_DIR, 'search-results.expected.md') +const ID_SEARCH_EXPECTED = join(SNAPSHOT_DIR, 'search-id-results.expected.md') const TERMINAL_EXPECTED = join(SNAPSHOT_DIR, 'terminal-card.expected.md') const CODE_CARD_DIR = fileURLToPath(new URL('./expected/navigation-panes', import.meta.url)) const COMMAND_WRAP_EXPECTED = join(CODE_CARD_DIR, 'command-wrap.expected.md') @@ -202,9 +203,20 @@ describe('web e2e: navigation & panes over a rich seeded session', () => { { timeout: 10_000 }, ).toBe(0) - await search.fill('WATERFALL') const resultTree = page.getByRole('tree', { name: 'Search results' }) const result = resultTree.getByRole('treeitem') + // The seed log carries its id only in the header, so this mid-id, + // differently cased fragment can match only through local id matching. + await search.fill('PANES-WEB') + await expect.poll(() => result.count(), { timeout: 10_000 }).toBe(1) + await page.getByRole('status', { name: 'Searching session history…' }).waitFor({ state: 'detached', timeout: 30_000 }) + await compareOrRefreshGolden( + ID_SEARCH_EXPECTED, + await captureStableAria(page, '[class*="listArea"]', scaffold.workspaceCwd), + MODE, + ) + + await search.fill('WATERFALL') await expect.poll(() => result.count(), { timeout: 30_000 }).toBe(1) await expect.poll(() => result.getByText('WATERFALL', { exact: false }).count(), { timeout: 10_000, @@ -551,7 +563,7 @@ describe('web e2e: navigation & panes over a rich seeded session', () => { it.skipIf(MODE === 'record')('keeps the recorded fixture inventory exact', async () => { await assertFixtureInventory(CODE_CARD_DIR, ['code-card.expected.md', 'command-wrap.expected.md']) await assertFixtureInventory(SNAPSHOT_DIR, [ - 'session.v3.jsonl', 'search-results.expected.md', 'trajectory.expected.md', + 'session.v3.jsonl', 'search-id-results.expected.md', 'search-results.expected.md', 'trajectory.expected.md', 'terminal-card.expected.md', 'timing.expected.md', ]) }) diff --git a/packages/client/ui-workspace/tests/tree.client.spec.ts b/packages/client/ui-workspace/tests/tree.client.spec.ts index dc0ce2709d..4c9cf139fe 100644 --- a/packages/client/ui-workspace/tests/tree.client.spec.ts +++ b/packages/client/ui-workspace/tests/tree.client.spec.ts @@ -699,7 +699,7 @@ describe('deriveSearchResults', () => { const other = summary('b7e0d4aa-session', 1) other.title = other.displayTitle = 'Another title' const result = deriveSearchResults( - list(idHit, other), [], '3F9A2C', noArchive, 'default', noAttention, { items: [], hasMore: false }, 10, + list(idHit, other), [], '9A2C71', noArchive, 'default', noAttention, { items: [], hasMore: false }, 10, ) expect(result.items.map(item => [item.id, item.title])).toEqual([[idHit.id, 'Ordinary title']]) }) diff --git a/snapshots/web/navigation-panes/search-id-results.expected.md b/snapshots/web/navigation-panes/search-id-results.expected.md new file mode 100644 index 0000000000..3807b915a9 --- /dev/null +++ b/snapshots/web/navigation-panes/search-id-results.expected.md @@ -0,0 +1,2 @@ +- tree "Search results": + - treeitem "Untitled {{workspace}}"