Skip to content

Commit dc393d7

Browse files
test(reactions): pin the 100 ms preview boundary in browser and unit tests
The browser timing contract still asserted the old 1200 ms first-open dwell, and the unit regression test advanced by the implementation constant, so it could not catch a return to a long dwell. Both now assert 99 ms closed and 100 ms open as a product expectation. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Nikolaj Goodger <[email protected]>
1 parent 025f12e commit dc393d7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/features/messages/MessageReactions.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ it("opens the reactor preview after a short hover, not a long dwell", async () =
499499
try {
500500
render(<h.Controls />);
501501
fireEvent.mouseEnter(screen.getByRole("button", { name: "👍: 1 person" }));
502-
await act(() => vi.advanceTimersByTimeAsync(REACTION_PREVIEW_DELAY_MS - 1));
502+
await act(() => vi.advanceTimersByTimeAsync(99));
503503
expect(document.body.querySelector('[role="tooltip"]')).toBeNull();
504504
await act(() => vi.advanceTimersByTimeAsync(1));
505505
expect(screen.getByRole("tooltip")).toBeTruthy();

‎tests/browser/reactions-polish.spec.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ test("reaction previews use the delayed first open, immediate warm switch, and r
185185
try {
186186
await custom.hover();
187187
await expect(tooltip).toHaveCount(0);
188-
await page.clock.runFor(1199);
188+
await page.clock.runFor(99);
189189
await expect(tooltip).toHaveCount(0);
190190
await page.clock.runFor(1);
191191
await expect(tooltip).toBeVisible();
@@ -195,7 +195,7 @@ test("reaction previews use the delayed first open, immediate warm switch, and r
195195
await expect(tooltip).toHaveCount(0);
196196
await page.clock.runFor(151);
197197
await custom.hover();
198-
await page.clock.runFor(1199);
198+
await page.clock.runFor(99);
199199
await expect(tooltip).toHaveCount(0);
200200
await page.clock.runFor(1);
201201
await expect(tooltip).toBeVisible();

0 commit comments

Comments
 (0)