mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 07:50:43 +00:00
test: clarify feishu validation assertions
This commit is contained in:
@@ -315,9 +315,7 @@ describe("FeishuConfigSchema defaultAccount", () => {
|
||||
|
||||
expect(result.success).toBe(false);
|
||||
if (!result.success) {
|
||||
expect(result.error.issues.some((issue) => issue.path.join(".") === "defaultAccount")).toBe(
|
||||
true,
|
||||
);
|
||||
expect(result.error.issues.map((issue) => issue.path.join("."))).toContain("defaultAccount");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -47,15 +47,13 @@ describe("Feishu security audit findings", () => {
|
||||
},
|
||||
])("$name", ({ cfg, expectedFinding, expectedNoFinding }) => {
|
||||
const findings = collectFeishuSecurityAuditFindings({ cfg });
|
||||
const findingKeys = findings.map((finding) => `${finding.checkId}:${finding.severity}`);
|
||||
const checkIds = findings.map((finding) => finding.checkId);
|
||||
if (expectedFinding) {
|
||||
expect(
|
||||
findings.some(
|
||||
(finding) => finding.checkId === expectedFinding && finding.severity === "warn",
|
||||
),
|
||||
).toBe(true);
|
||||
expect(findingKeys).toContain(`${expectedFinding}:warn`);
|
||||
}
|
||||
if (expectedNoFinding) {
|
||||
expect(findings.some((finding) => finding.checkId === expectedNoFinding)).toBe(false);
|
||||
expect(checkIds).not.toContain(expectedNoFinding);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user