1import { describe, expect, it } from "vite-plus/test";
2
3import { nativeHeaderScrollEdgeEffects, nativeTopScrollEdgeEffect } from "./scrollEdgeEffects";
4
5describe("nativeTopScrollEdgeEffect", () => {
6 it("keeps the automatic native treatment on iOS 26", () => {
7 expect(nativeTopScrollEdgeEffect("ios", "26.5")).toBe("automatic");
8 });
9
10 it("keeps UIKit automatic scroll-edge sampling on iOS 27 and later", () => {
11 expect(nativeTopScrollEdgeEffect("ios", "27.0")).toBe("automatic");
12 expect(nativeTopScrollEdgeEffect("ios", 28)).toBe("automatic");
13 });
14
15 it("does not apply the iOS workaround to other platforms", () => {
16 expect(nativeTopScrollEdgeEffect("android", 27)).toBe("automatic");
17 });
18});
19
20describe("nativeHeaderScrollEdgeEffects", () => {
21 it("keeps non-top header edges hidden while applying the platform top effect", () => {
22 expect(nativeHeaderScrollEdgeEffects("ios", "27.0")).toEqual({
23 top: "automatic",
24 bottom: "hidden",
25 left: "hidden",
26 right: "hidden",
27 });
28 });
29});