import { beforeEach, describe, expect, it, vi } from "vitest"; import { goWanfaRouteDetail } from "@/lib/navigation"; describe("wanfa route detail navigation", () => { const navigateTo = vi.fn(); beforeEach(() => { navigateTo.mockReset(); vi.stubGlobal("uni", { navigateTo }); }); it("encodes the route id in the detail page URL", () => { goWanfaRouteDetail("family water"); expect(navigateTo).toHaveBeenCalledWith({ url: "/pages/detail/index?routeId=family%20water", }); }); });