Files
romm/frontend/src/utils/pairCallback.test.ts
Georges-Antoine Assi f1a98234c2 pr-ready code-review: fix sweep prose and Pair error handling
Repair comments where the em-dash sweep left broken pairs, colon plus
conjunction joins, and misaligned column lists. Block filesystem: in the
pairing callback check, route both Pair views through the shared
errorMessage() helper, and drop the SfcNode comments field the removed
rule used.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 21:29:21 -04:00

24 lines
676 B
TypeScript

import { describe, expect, it } from "vitest";
import { isCustomScheme } from "./pairCallback";
describe("isCustomScheme", () => {
it.each(["argosy://pair", "myapp:callback?x=1"])("accepts %s", (url) => {
expect(isCustomScheme(url)).toBe(true);
});
it.each([
"https://evil.example/cb",
"http://evil.example/cb",
"javascript:alert(1)",
"JavaScript:alert(1)",
"data:text/html,<script>alert(1)</script>",
"vbscript:msgbox(1)",
"blob:https://example.com/uuid",
"filesystem:https://example.com/temporary/cb",
"file:///etc/passwd",
"not a url",
])("rejects %s", (url) => {
expect(isCustomScheme(url)).toBe(false);
});
});