Files
openclaw/src/auto-reply/reply-payload.test.ts
Josh Avant 052dc59526 fix: /pair qr fails to show QR code in chat surfaces (#97933)
* fix(pair): render qr per chat surface

* test(plugin-sdk): update reply helper surface budget

* fix(pair): keep qr metadata internal
2026-06-29 18:17:21 -05:00

31 lines
903 B
TypeScript

// Reply payload tests cover internal reply metadata contracts.
import { describe, expect, it } from "vitest";
import { buildPairingQrReplyChannelData, readPairingQrReplyChannelData } from "./reply-payload.js";
describe("pairing QR reply channel data", () => {
it("builds and reads the private pairing QR payload metadata", () => {
const channelData = buildPairingQrReplyChannelData({
setupCode: "setup-code",
expiresAtMs: 1_800_000_000_000,
});
expect(readPairingQrReplyChannelData({ channelData })).toEqual({
setupCode: "setup-code",
expiresAtMs: 1_800_000_000_000,
});
});
it("ignores malformed pairing QR metadata", () => {
expect(
readPairingQrReplyChannelData({
channelData: {
openclawPairingQr: {
setupCode: "",
expiresAtMs: 0,
},
},
}),
).toBeUndefined();
});
});