mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-14 05:50:42 +00:00
test: clarify security audit assertions
This commit is contained in:
@@ -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",
|
||||
]),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user