test: clarify gateway exposure audit assertions

This commit is contained in:
Peter Steinberger
2026-05-08 09:30:48 +01:00
parent 4b8717f14e
commit 5fccaa1e32

View File

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