fix(github): qualify dedicated app setup and issue automation

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-07 13:04:15 -05:00
1 parent 322fd7de2f
commit 470e66db0d
25 files changed
+945 -93

No files matched your search

@@ -0,0 +1,31 @@
import { describe, expect, it } from "vitest";
import { githubWizardBrowserOrigin } from "./chat-github-wizard.js";
describe("GitHub wizard enrolled browser origin", () => {
it("uses the already approved loopback spelling on the same port", () => {
expect(githubWizardBrowserOrigin("http://127.0.0.1:3110", ["http://localhost:3110"]))
.toBe("http://localhost:3110");
});
it("preserves an exactly enrolled origin", () => {
expect(githubWizardBrowserOrigin("http://127.0.0.1:3110", ["http://localhost:3110", "http://127.0.0.1:3110"]))
.toBe("http://127.0.0.1:3110");
});
it.each([
["http://localhost:3109"],
["https://unrelated.example"],
])("does not substitute another port or a remote instance", (...origins) => {
expect(githubWizardBrowserOrigin("http://127.0.0.1:3110", origins))
.toBe("http://127.0.0.1:3110");
});
it("preserves the configured public origin", () => {
expect(githubWizardBrowserOrigin("https://instance.example", ["http://localhost:3110"]))
.toBe("https://instance.example");
});
it.each(["http://user@127.0.0.1:3110", "http://127.0.0.1:3110/path", "http://127.0.0.1:3110?query=1", "http://127.0.0.1:3110#fragment"])("does not normalize away invalid origin evidence: %s", (origin) => {
expect(githubWizardBrowserOrigin(origin, ["http://localhost:3110"])).toBe(origin);
});
});