test: require channel action buttons

This commit is contained in:
Shakker
2026-05-08 16:26:51 +01:00
parent 19ac69bba3
commit d4278fcaf7

View File

@@ -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);
});