From d4278fcaf7e000a64a9bd4d33b3a68abde08359f Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 8 May 2026 16:26:51 +0100 Subject: [PATCH] test: require channel action buttons --- ui/src/ui/views/channels.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/ui/views/channels.test.ts b/ui/src/ui/views/channels.test.ts index 1db3175b419..d353aabe277 100644 --- a/ui/src/ui/views/channels.test.ts +++ b/ui/src/ui/views/channels.test.ts @@ -173,7 +173,9 @@ describe("WhatsApp card actions", () => { expect(labels).not.toContain("Relink"); expect(labels).not.toContain("Wait for scan"); - buttons.find((button) => button.textContent?.trim() === "Show QR")?.click(); + const showQr = buttons.find((button) => button.textContent?.trim() === "Show QR"); + expect(showQr).toBeInstanceOf(HTMLButtonElement); + showQr!.click(); expect(onWhatsAppStart).toHaveBeenCalledWith(false); }); @@ -187,7 +189,9 @@ describe("WhatsApp card actions", () => { expect(labels).toContain("Relink"); expect(labels).not.toContain("Show QR"); - buttons.find((button) => button.textContent?.trim() === "Relink")?.click(); + const relink = buttons.find((button) => button.textContent?.trim() === "Relink"); + expect(relink).toBeInstanceOf(HTMLButtonElement); + relink!.click(); expect(onWhatsAppStart).toHaveBeenCalledWith(true); });