test: clarify feishu validation assertions · openclaw/openclaw@2c7c57d
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -47,15 +47,13 @@ describe("Feishu security audit findings", () => {
|
47 | 47 | }, |
48 | 48 | ])("$name", ({ cfg, expectedFinding, expectedNoFinding }) => { |
49 | 49 | const findings = collectFeishuSecurityAuditFindings({ cfg }); |
| 50 | +const findingKeys = findings.map((finding) => `${finding.checkId}:${finding.severity}`); |
| 51 | +const checkIds = findings.map((finding) => finding.checkId); |
50 | 52 | if (expectedFinding) { |
51 | | -expect( |
52 | | -findings.some( |
53 | | -(finding) => finding.checkId === expectedFinding && finding.severity === "warn", |
54 | | -), |
55 | | -).toBe(true); |
| 53 | +expect(findingKeys).toContain(`${expectedFinding}:warn`); |
56 | 54 | } |
57 | 55 | if (expectedNoFinding) { |
58 | | -expect(findings.some((finding) => finding.checkId === expectedNoFinding)).toBe(false); |
| 56 | +expect(checkIds).not.toContain(expectedNoFinding); |
59 | 57 | } |
60 | 58 | }); |
61 | 59 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。