mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-16 23:01:38 +00:00
* fix(pair): render qr per chat surface * test(plugin-sdk): update reply helper surface budget * fix(pair): keep qr metadata internal
31 lines
903 B
TypeScript
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();
|
|
});
|
|
});
|