Pin the year boundary, the typed exchange failure and the start refusal's code

Closes StrykerJS survivors on the diff: the cap at exactly 365 days against a
second over, the rotating-exchange failure's typed code (and that a
non-rotating provider is unaffected), and the start refusal's error word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-19 14:45:35 +02:00
commit 6db84bfae8
2 changed files with 33 additions and 5 deletions

View file

@ -1367,14 +1367,15 @@ describe("Heimdall service", () => {
}
it.each([
["no connection", {}],
["an account connection", { connection: { kind: "account", targetId: "victim-1" } }],
["an empty targetId", { connection: { kind: "creator", targetId: "" } }],
])("refuses a joystick connect with %s at start, before any redirect", async (_name, extra) => {
["no connection", {}, "creator_connection_required"],
["an account connection", { connection: { kind: "account", targetId: "victim-1" } }, "creator_connection_required"],
["an empty targetId", { connection: { kind: "creator", targetId: "" } }, "invalid_request"],
])("refuses a joystick connect with %s at start, before any redirect", async (_name, extra, error) => {
const app = await buildApp({ config: createTestConfig() });
apps.push(app);
const start = await connect(app, extra);
expect(start.statusCode).toBe(400);
expect(start.json().error).toBe(error);
expect(start.json().authorizationUrl).toBeUndefined();
expect(start.json().stateToken).toBeUndefined();
});