test: clarify security audit assertions

This commit is contained in:
Peter Steinberger
2026-05-08 09:17:15 +01:00
parent f9812e6cba
commit a8dcbb26f8
3 changed files with 8 additions and 8 deletions

View File

@@ -41,12 +41,12 @@ describe("security audit config symlink findings", () => {
expect(findings).toEqual(
expect.arrayContaining([expect.objectContaining({ checkId: "fs.config.symlink" })]),
);
expect(findings.some((finding) => finding.checkId === "fs.config.perms_writable")).toBe(false);
expect(findings.some((finding) => finding.checkId === "fs.config.perms_world_readable")).toBe(
false,
);
expect(findings.some((finding) => finding.checkId === "fs.config.perms_group_readable")).toBe(
false,
expect(findings.map((finding) => finding.checkId)).not.toEqual(
expect.arrayContaining([
"fs.config.perms_writable",
"fs.config.perms_world_readable",
"fs.config.perms_group_readable",
]),
);
});
});

View File

@@ -82,7 +82,7 @@ describe("security audit gateway HTTP auth findings", () => {
}
}
if (expectedNoFinding) {
expect(findings.some((entry) => entry.checkId === expectedNoFinding)).toBe(false);
expect(findings.map((entry) => entry.checkId)).not.toContain(expectedNoFinding);
}
});
});

View File

@@ -70,6 +70,6 @@ describe("security audit model hygiene findings", () => {
},
} satisfies OpenClawConfig);
expect(findings.some((finding) => finding.checkId === "models.weak_tier")).toBe(false);
expect(findings.map((finding) => finding.checkId)).not.toContain("models.weak_tier");
});
});