From fdaebf587cd295ac4481c640c803d79315baf6ba Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 10 Apr 2026 21:55:28 +0100 Subject: [PATCH] test: remove redundant phone control conversions --- extensions/phone-control/index.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/extensions/phone-control/index.test.ts b/extensions/phone-control/index.test.ts index f2de1802fed..2a81ad212f6 100644 --- a/extensions/phone-control/index.test.ts +++ b/extensions/phone-control/index.test.ts @@ -115,7 +115,7 @@ describe("phone-control plugin", () => { channel: "webchat", gatewayClientScopes: ["operator.admin"], }); - const text = String(res?.text ?? ""); + const text = res?.text ?? ""; const nodes = ( getConfig().gateway as { nodes?: { allowCommands?: string[]; denyCommands?: string[] } } ).nodes; @@ -138,7 +138,7 @@ describe("phone-control plugin", () => { gatewayClientScopes: ["operator.write"], }); - expect(String(res?.text ?? "")).toContain("requires operator.admin"); + expect(res?.text ?? "").toContain("requires operator.admin"); expect(writeConfigFile).not.toHaveBeenCalled(); }); }); @@ -150,7 +150,7 @@ describe("phone-control plugin", () => { channel: "telegram", }); - expect(String(res?.text ?? "")).toContain("Phone control: armed"); + expect(res?.text ?? "").toContain("Phone control: armed"); expect(writeConfigFile).toHaveBeenCalledTimes(1); }); }); @@ -162,7 +162,7 @@ describe("phone-control plugin", () => { channel: "telegram", }); - expect(String(res?.text ?? "")).toContain("Phone control: disarmed."); + expect(res?.text ?? "").toContain("Phone control: disarmed."); expect(writeConfigFile).not.toHaveBeenCalled(); }); }); @@ -174,7 +174,7 @@ describe("phone-control plugin", () => { channel: "telegram", gatewayClientScopes: ["operator.write"], }); - expect(String(armRes?.text ?? "")).toContain("requires operator.admin"); + expect(armRes?.text ?? "").toContain("requires operator.admin"); expect(writeConfigFile).not.toHaveBeenCalled(); const disarmRes = await command.handler({ @@ -182,7 +182,7 @@ describe("phone-control plugin", () => { channel: "telegram", gatewayClientScopes: ["operator.write"], }); - expect(String(disarmRes?.text ?? "")).toContain("requires operator.admin"); + expect(disarmRes?.text ?? "").toContain("requires operator.admin"); expect(writeConfigFile).not.toHaveBeenCalled(); }); }); @@ -195,7 +195,7 @@ describe("phone-control plugin", () => { gatewayClientScopes: ["operator.admin"], }); - expect(String(res?.text ?? "")).toContain("sms.send"); + expect(res?.text ?? "").toContain("sms.send"); expect(writeConfigFile).toHaveBeenCalledTimes(1); }); }); @@ -214,7 +214,7 @@ describe("phone-control plugin", () => { gatewayClientScopes: ["operator.admin"], }); - expect(String(res?.text ?? "")).toContain("disarmed"); + expect(res?.text ?? "").toContain("disarmed"); expect(writeConfigFile).toHaveBeenCalledTimes(2); }); });