mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 12:11:41 +00:00
fix(web): improve WhatsApp Web listener errors (#612, thanks @YuriNachos)
This commit is contained in:
@@ -51,6 +51,19 @@ describe("web outbound", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("throws a helpful error when no active listener exists", async () => {
|
||||
setActiveWebListener(null);
|
||||
await expect(
|
||||
sendMessageWhatsApp("+1555", "hi", { verbose: false, accountId: "work" }),
|
||||
).rejects.toThrow(/No active WhatsApp Web listener/);
|
||||
await expect(
|
||||
sendMessageWhatsApp("+1555", "hi", { verbose: false, accountId: "work" }),
|
||||
).rejects.toThrow(/providers login/);
|
||||
await expect(
|
||||
sendMessageWhatsApp("+1555", "hi", { verbose: false, accountId: "work" }),
|
||||
).rejects.toThrow(/account: work/);
|
||||
});
|
||||
|
||||
it("maps audio to PTT with opus mime when ogg", async () => {
|
||||
const buf = Buffer.from("audio");
|
||||
loadWebMediaMock.mockResolvedValueOnce({
|
||||
|
||||
Reference in New Issue
Block a user