diff --git a/api/tests/voiceRescheduleLane.test.ts b/api/tests/voiceRescheduleLane.test.ts index c9124d2..ab120d0 100644 --- a/api/tests/voiceRescheduleLane.test.ts +++ b/api/tests/voiceRescheduleLane.test.ts @@ -228,11 +228,14 @@ describe("voice hidden reschedule lane", () => { }); it("unadvertised digit 4 routes to hidden staff-controlled reschedule lane", async () => { + const rescheduleSpy = jest.spyOn(MockSchedulingProvider.prototype, "rescheduleAppointment"); const callSid = `${CALLSID_PREFIX}DIGIT_4`; const from = TEST_PHONES[0]; // First call inbound to get IVR menu - await postInbound(callSid, from); + const menuRes = await postInbound(callSid, from); + expect(menuRes.text).not.toContain("Press 4"); + expect(menuRes.text).not.toContain("reschedule"); // Press digit 4 via intent endpoint (simulates actual DTMF press) // The intent endpoint processes DTMF and routes to reschedule @@ -242,6 +245,10 @@ describe("voice hidden reschedule lane", () => { expect(res.type).toBe("text/xml"); expect(res.text).toContain("/api/voice/reschedule?stage=start"); expect(res.text).toContain("Your appointment is not moved yet; staff will confirm the change."); + expect(res.text).not.toContain("