mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 08:40:44 +00:00
test: clarify gateway exposure audit assertions
This commit is contained in:
@@ -128,7 +128,7 @@ describe("security audit gateway exposure findings", () => {
|
||||
const findings = collectGatewayConfigFindings(cfg, cfg, {});
|
||||
expect(findings).toEqual(expect.arrayContaining([expect.objectContaining(expectedFinding)]));
|
||||
if (expectedNoFinding) {
|
||||
expect(findings.some((finding) => finding.checkId === expectedNoFinding)).toBe(false);
|
||||
expect(findings.map((finding) => finding.checkId)).not.toContain(expectedNoFinding);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -410,10 +410,9 @@ describe("security audit gateway exposure findings", () => {
|
||||
testCase.name,
|
||||
).toBe(true);
|
||||
if (testCase.suppressesGenericSharedSecretFindings) {
|
||||
expect(findings.some((finding) => finding.checkId === "gateway.bind_no_auth")).toBe(false);
|
||||
expect(findings.some((finding) => finding.checkId === "gateway.auth_no_rate_limit")).toBe(
|
||||
false,
|
||||
);
|
||||
const checkIds = findings.map((finding) => finding.checkId);
|
||||
expect(checkIds).not.toContain("gateway.bind_no_auth");
|
||||
expect(checkIds).not.toContain("gateway.auth_no_rate_limit");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user