Pin the blank-target refusal for every connection kind

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Heimdall 2026-11-08 21:45:15 +00:00
commit 7659f5b84d

View file

@ -1492,10 +1492,12 @@ describe("Heimdall service", () => {
const app = await buildApp({ config: createTestConfig() });
apps.push(app);
for (const targetId of [" ", "\t", "\n ", "\u200B", "\u00A0\uFEFF"]) {
const refused = await startFor(app, provider, { kind: "creator", targetId }, own);
expect([refused.statusCode, refused.json().error], JSON.stringify(targetId)).toEqual([400, "invalid_connection_target"]);
expect(refused.body).not.toContain("authorizationUrl");
for (const kind of ["creator", "account"]) {
for (const targetId of [" ", "\t", "\n ", "\u200B", "\u00A0\uFEFF"]) {
const refused = await startFor(app, provider, { kind, targetId }, own);
expect([refused.statusCode, refused.json().error], `${kind} ${JSON.stringify(targetId)}`).toEqual([400, "invalid_connection_target"]);
expect(refused.body).not.toContain("authorizationUrl");
}
}
expect((await startFor(app, provider, { kind: "creator", targetId: " creator-1 " }, own)).statusCode).toBe(201);
});