


























@@ -23,19 +23,16 @@ async function createTgz(params: { entries: Record<string, string>; root: string
23232424describe("WhatsApp QA live runtime", () => {
2525it("parses credential payloads and normalizes phone numbers", () => {
26-expect(
27-__testing.parseWhatsAppQaCredentialPayload({
28-driverPhoneE164: "15550000001",
29-sutPhoneE164: "+15550000002",
30-driverAuthArchiveBase64: "driver",
31-sutAuthArchiveBase64: "sut",
32-}),
33-).toMatchObject({
34-driverPhoneE164: "+15550000001",
26+const payload = __testing.parseWhatsAppQaCredentialPayload({
27+driverPhoneE164: "15550000001",
3528sutPhoneE164: "+15550000002",
3629driverAuthArchiveBase64: "driver",
3730sutAuthArchiveBase64: "sut",
3831});
32+expect(payload.driverPhoneE164).toBe("+15550000001");
33+expect(payload.sutPhoneE164).toBe("+15550000002");
34+expect(payload.driverAuthArchiveBase64).toBe("driver");
35+expect(payload.sutAuthArchiveBase64).toBe("sut");
3936});
40374138it("rejects credential payloads that reuse the same phone", () => {
@@ -128,10 +125,8 @@ describe("WhatsApp QA live runtime", () => {
128125});
129126130127it("registers the WhatsApp canary and pairing scenarios", () => {
131-expect(__testing.findScenarios(["whatsapp-canary", "whatsapp-pairing-block"])).toMatchObject([
132-{ id: "whatsapp-canary" },
133-{ id: "whatsapp-pairing-block" },
134-]);
128+const scenarios = __testing.findScenarios(["whatsapp-canary", "whatsapp-pairing-block"]);
129+expect(scenarios.map(({ id }) => id)).toEqual(["whatsapp-canary", "whatsapp-pairing-block"]);
135130});
136131137132it("uses automatic visible replies for WhatsApp group mention gating", () => {
@@ -157,26 +152,20 @@ describe("WhatsApp QA live runtime", () => {
157152it("fails explicitly requested group scenarios when group credentials are missing", () => {
158153const [scenario] = __testing.findScenarios(["whatsapp-mention-gating"]);
159154160-expect(
161-__testing.createMissingGroupJidScenarioResult({
162-explicitScenarioSelection: false,
163- scenario,
164-}),
165-).toMatchObject({
166-id: "whatsapp-mention-gating",
167-status: "skip",
155+const implicitResult = __testing.createMissingGroupJidScenarioResult({
156+explicitScenarioSelection: false,
157+ scenario,
168158});
159+expect(implicitResult.id).toBe("whatsapp-mention-gating");
160+expect(implicitResult.status).toBe("skip");
169161170-expect(
171-__testing.createMissingGroupJidScenarioResult({
172-explicitScenarioSelection: true,
173- scenario,
174-}),
175-).toMatchObject({
176-id: "whatsapp-mention-gating",
177-status: "fail",
178-details: expect.stringContaining("requested scenario requires groupJid"),
162+const explicitResult = __testing.createMissingGroupJidScenarioResult({
163+explicitScenarioSelection: true,
164+ scenario,
179165});
166+expect(explicitResult.id).toBe("whatsapp-mention-gating");
167+expect(explicitResult.status).toBe("fail");
168+expect(explicitResult.details).toContain("requested scenario requires groupJid");
180169});
181170182171it("attributes pre-scenario setup failures to the selected scenario", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。