Skip to content

Commit dfdcf5b

Browse files
test(web): route reveal tests say why they render without a router
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 2a59127 commit dfdcf5b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/web/src/components/sidebar/routeReveal.browser.test.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ describe("useActiveRowReveal", () => {
3333
it("scrolls an off-screen row into view when the route opens its thread", async () => {
3434
const reveal = newReveal();
3535
const keys = rowKeys(50);
36-
// A bare list; the route arrives as the active key.
3736
await using screen = await render(
3837
<RevealList reveal={reveal} rowKeys={keys} activeKey="thread-0" />,
38+
// No router: the route arrives as the activeKey prop.
3939
{ router: false },
4040
);
4141
const target = screen.getByText("thread-40", { exact: true });
@@ -52,6 +52,7 @@ describe("useActiveRowReveal", () => {
5252
// listed it yet.
5353
await using screen = await render(
5454
<RevealList reveal={reveal} rowKeys={rowKeys(5)} activeKey="thread-40" />,
55+
// No router: the route arrives as the activeKey prop.
5556
{ router: false },
5657
);
5758
await expect.element(screen.getByText("thread-4", { exact: true })).toBeInTheDocument();
@@ -68,6 +69,7 @@ describe("useActiveRowReveal", () => {
6869
const keys = rowKeys(50);
6970
await using screen = await render(
7071
<RevealList reveal={reveal} rowKeys={keys} activeKey="thread-40" />,
72+
// No router: the route arrives as the activeKey prop.
7173
{ router: false },
7274
);
7375
const target = screen.getByText("thread-40", { exact: true });
@@ -88,6 +90,7 @@ describe("useActiveRowReveal", () => {
8890
{
8991
await using screen = await render(
9092
<RevealList reveal={reveal} rowKeys={keys} activeKey="thread-40" />,
93+
// No router: the route arrives as the activeKey prop.
9194
{ router: false },
9295
);
9396
await expect.element(screen.getByText("thread-40", { exact: true })).toBeInViewport();
@@ -96,6 +99,7 @@ describe("useActiveRowReveal", () => {
9699
// A remount starts the list at the top; the record outlives it with no reveal pending.
97100
await using screen = await render(
98101
<RevealList reveal={reveal} rowKeys={keys} activeKey="thread-40" />,
102+
// No router: the route arrives as the activeKey prop.
99103
{ router: false },
100104
);
101105
await expect.element(screen.getByText("thread-40", { exact: true })).toBeInViewport();

0 commit comments

Comments
 (0)