From 71154bf3bff0ef9f06a68574fca64b0129c4153a Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 21 Apr 2026 00:51:37 +0100 Subject: [PATCH] test: use synthetic approval pairing fixtures --- src/infra/channel-approval-auth.test.ts | 16 ++++++++-------- src/infra/session-maintenance-warning.test.ts | 4 ++-- src/pairing/pairing-challenge.test.ts | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/infra/channel-approval-auth.test.ts b/src/infra/channel-approval-auth.test.ts index e502b5f8b97..1e5fd8c0ab1 100644 --- a/src/infra/channel-approval-auth.test.ts +++ b/src/infra/channel-approval-auth.test.ts @@ -24,7 +24,7 @@ describe("resolveApprovalCommandAuthorization", () => { expect( resolveApprovalCommandAuthorization({ cfg: {} as never, - channel: "slack", + channel: "workspace", senderId: "U123", kind: "exec", }), @@ -49,7 +49,7 @@ describe("resolveApprovalCommandAuthorization", () => { expect( resolveApprovalCommandAuthorization({ cfg: {} as never, - channel: "discord", + channel: "guildchat", accountId: "work", senderId: "123", kind: "exec", @@ -59,7 +59,7 @@ describe("resolveApprovalCommandAuthorization", () => { expect( resolveApprovalCommandAuthorization({ cfg: {} as never, - channel: "discord", + channel: "guildchat", accountId: "work", senderId: "123", kind: "plugin", @@ -104,7 +104,7 @@ describe("resolveApprovalCommandAuthorization", () => { expect( resolveApprovalCommandAuthorization({ cfg: {} as never, - channel: "slack", + channel: "workspace", accountId: "work", senderId: "U123", kind: "exec", @@ -121,7 +121,7 @@ describe("resolveApprovalCommandAuthorization", () => { it("keeps empty approver fallback implicit without bypassing channel sender auth", () => { getChannelPluginMock.mockReturnValue({ approvalCapability: createResolvedApproverActionAuthAdapter({ - channelLabel: "Signal", + channelLabel: "QuietChat", resolveApprovers: () => [], }), }); @@ -129,7 +129,7 @@ describe("resolveApprovalCommandAuthorization", () => { expect( resolveApprovalCommandAuthorization({ cfg: {} as never, - channel: "signal", + channel: "quietchat", accountId: "work", senderId: "uuid:attacker", kind: "exec", @@ -140,7 +140,7 @@ describe("resolveApprovalCommandAuthorization", () => { it("keeps configured approvers explicit when sender matches", () => { getChannelPluginMock.mockReturnValue({ approvalCapability: createResolvedApproverActionAuthAdapter({ - channelLabel: "Signal", + channelLabel: "QuietChat", resolveApprovers: () => ["uuid:owner"], }), }); @@ -148,7 +148,7 @@ describe("resolveApprovalCommandAuthorization", () => { expect( resolveApprovalCommandAuthorization({ cfg: {} as never, - channel: "signal", + channel: "quietchat", accountId: "work", senderId: "uuid:owner", kind: "exec", diff --git a/src/infra/session-maintenance-warning.test.ts b/src/infra/session-maintenance-warning.test.ts index 83bb0a0f7ad..ae2bcfc196f 100644 --- a/src/infra/session-maintenance-warning.test.ts +++ b/src/infra/session-maintenance-warning.test.ts @@ -4,7 +4,7 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vite const mocks = vi.hoisted(() => ({ resolveSessionAgentId: vi.fn(() => "agent-from-key"), deliveryContextFromSession: vi.fn(() => ({ - channel: "whatsapp", + channel: "mobilechat", to: "+15550001", accountId: "acct-1", threadId: "thread-1", @@ -101,7 +101,7 @@ describe("deliverSessionMaintenanceWarning", () => { expect(mocks.deliverOutboundPayloads).toHaveBeenCalledWith( expect.objectContaining({ - channel: "whatsapp", + channel: "mobilechat", to: "+15550001", session: { key: "agent:main:main", agentId: "agent-from-key" }, }), diff --git a/src/pairing/pairing-challenge.test.ts b/src/pairing/pairing-challenge.test.ts index 68beca4ae9f..0c72ff4cee4 100644 --- a/src/pairing/pairing-challenge.test.ts +++ b/src/pairing/pairing-challenge.test.ts @@ -4,9 +4,9 @@ import { issuePairingChallenge } from "./pairing-challenge.js"; describe("issuePairingChallenge", () => { function createBaseChallengeParams() { return { - channel: "telegram", + channel: "forum", senderId: "123", - senderIdLine: "Your Telegram user id: 123", + senderIdLine: "Your forum user id: 123", } as const; } @@ -114,9 +114,9 @@ describe("issuePairingChallenge", () => { const upsert = vi.fn(async () => ({ code: "1111", created: true })); return { issueParams: { - channel: "discord", + channel: "guildchat", senderId: "42", - senderIdLine: "Your Discord user id: 42", + senderIdLine: "Your guildchat user id: 42", meta: { name: "alice" }, upsertPairingRequest: upsert, onCreated, @@ -136,9 +136,9 @@ describe("issuePairingChallenge", () => { const onReplyError = vi.fn(); return { issueParams: { - channel: "signal", + channel: "quietchat", senderId: "+1555", - senderIdLine: "Your Signal sender id: +1555", + senderIdLine: "Your quietchat sender id: +1555", upsertPairingRequest: async () => ({ code: "9999", created: true }), onReplyError, },