mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-20 09:31:54 -06:00
b76a7f453b
* refactor(auto-reply): trim internal export surface * chore(deadcode): update auto-reply export baseline
33 lines
868 B
TypeScript
33 lines
868 B
TypeScript
// Reply payload tests cover internal reply metadata contracts.
|
|
import { describe, expect, it } from "vitest";
|
|
import { readPairingQrReplyChannelData } from "./reply-payload.js";
|
|
|
|
describe("pairing QR reply channel data", () => {
|
|
it("reads the private pairing QR payload metadata", () => {
|
|
const channelData = {
|
|
openclawPairingQr: {
|
|
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();
|
|
});
|
|
});
|