Skip to content

Commit 33bf0c4

Browse files
shivamhwpclaude
andcommitted
test(desktop): cover swipe targets that gain overflow and release over content
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent e1d13d5 commit 33bf0c4

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

‎apps/web/src/components/HistorySwipeNavigation.browser.test.tsx‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { HistorySwipeNavigation } from "./HistorySwipeNavigation";
55

66
type Scroller = "shadow" | "none" | "shadow-dialog";
77
type Step = readonly [
8-
event: number | "begin" | "end" | "show-scroller",
8+
event: number | "begin" | "end" | "show-scroller" | "gain-overflow",
99
after?: "remove" | "close-dialog",
1010
];
1111

@@ -52,10 +52,17 @@ describe("HistorySwipeNavigation", () => {
5252
null,
5353
],
5454
[
55-
"a history swipe over content replaced without overflow",
55+
"a history swipe over content replaced without overflow, released over a scroller",
5656
"none",
5757
0,
58-
[[-60, "remove"], [-70]],
58+
[[-60, "remove"], [-70], ["show-scroller"]],
59+
"back",
60+
],
61+
[
62+
"a history swipe whose target gains overflow",
63+
"none",
64+
0,
65+
[[-60], ["gain-overflow"], [-70]],
5966
"back",
6067
],
6168
])("%s", async (_name, scroller, scrollLeft, steps, navigates) => {
@@ -84,6 +91,9 @@ describe("HistorySwipeNavigation", () => {
8491
for (const listener of listeners.end) listener();
8592
} else if (event === "show-scroller") {
8693
({ viewport, content } = mountPanel(screen.container, "shadow", 400));
94+
} else if (event === "gain-overflow") {
95+
viewport.style.overflowX = "auto";
96+
content.style.width = "1000px";
8797
} else {
8898
content.dispatchEvent(
8999
new WheelEvent("wheel", { deltaX: event, bubbles: true, composed: true }),

0 commit comments

Comments
 (0)