Files
clawdbot/src/pairing/pairing-messages.test.ts
Peter Steinberger c379191f80 chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
2026-01-14 15:02:19 +00:00

43 lines
1.1 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { buildPairingReply } from "./pairing-messages.js";
describe("buildPairingReply", () => {
const cases = [
{
channel: "discord",
idLine: "Your Discord user id: 1",
code: "ABC123",
},
{
channel: "slack",
idLine: "Your Slack user id: U1",
code: "DEF456",
},
{
channel: "signal",
idLine: "Your Signal number: +15550001111",
code: "GHI789",
},
{
channel: "imessage",
idLine: "Your iMessage sender id: +15550002222",
code: "JKL012",
},
{
channel: "whatsapp",
idLine: "Your WhatsApp phone number: +15550003333",
code: "MNO345",
},
] as const;
for (const testCase of cases) {
it(`formats pairing reply for ${testCase.channel}`, () => {
const text = buildPairingReply(testCase);
expect(text).toContain(testCase.idLine);
expect(text).toContain(`Pairing code: ${testCase.code}`);
expect(text).toContain(`clawdbot pairing approve ${testCase.channel} <code>`);
});
}
});