| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { shouldHandleAppLink } from "./appLinking"; |
| 4 | |
| 5 | describe("shouldHandleAppLink", () => { |
| 6 | it.each(["t3code://", "t3code:///", "t3code-dev://", "t3code-preview://"])( |
| 7 | "ignores scheme-only URL %s", |
| 8 | (url) => { |
| 9 | expect(shouldHandleAppLink(url)).toBe(false); |
| 10 | }, |
| 11 | ); |
| 12 | |
| 13 | it.each([ |
| 14 | "t3code://threads/env-1/thread-1", |
| 15 | "t3code://pair?pairingUrl=x", |
| 16 | "t3code-dev://settings/usage?tab=limits", |
| 17 | ])("handles path-bearing URL %s", (url) => { |
| 18 | expect(shouldHandleAppLink(url)).toBe(true); |
| 19 | }); |
| 20 | |
| 21 | it.each(["t3code://expo-development-client/?url=x", "t3code://expo-sharing/anything"])( |
| 22 | "ignores lifecycle URL %s", |
| 23 | (url) => { |
| 24 | expect(shouldHandleAppLink(url)).toBe(false); |
| 25 | }, |
| 26 | ); |
| 27 | }); |