test: require channel action buttons · openclaw/openclaw@d4278fc
shakkernerd
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -173,7 +173,9 @@ describe("WhatsApp card actions", () => {
|
173 | 173 | expect(labels).not.toContain("Relink"); |
174 | 174 | expect(labels).not.toContain("Wait for scan"); |
175 | 175 | |
176 | | -buttons.find((button) => button.textContent?.trim() === "Show QR")?.click(); |
| 176 | +const showQr = buttons.find((button) => button.textContent?.trim() === "Show QR"); |
| 177 | +expect(showQr).toBeInstanceOf(HTMLButtonElement); |
| 178 | +showQr!.click(); |
177 | 179 | expect(onWhatsAppStart).toHaveBeenCalledWith(false); |
178 | 180 | }); |
179 | 181 | |
@@ -187,7 +189,9 @@ describe("WhatsApp card actions", () => {
|
187 | 189 | expect(labels).toContain("Relink"); |
188 | 190 | expect(labels).not.toContain("Show QR"); |
189 | 191 | |
190 | | -buttons.find((button) => button.textContent?.trim() === "Relink")?.click(); |
| 192 | +const relink = buttons.find((button) => button.textContent?.trim() === "Relink"); |
| 193 | +expect(relink).toBeInstanceOf(HTMLButtonElement); |
| 194 | +relink!.click(); |
191 | 195 | expect(onWhatsAppStart).toHaveBeenCalledWith(true); |
192 | 196 | }); |
193 | 197 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。