mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-30 01:06:11 +00:00
Tests: make plugin ownership mismatch assertion root-safe
This commit is contained in:
@@ -343,9 +343,10 @@ describe("discoverOpenClawPlugins", () => {
|
||||
const result = await withStateDir(stateDir, async () => {
|
||||
return discoverOpenClawPlugins({ ownershipUid: actualUid + 1 });
|
||||
});
|
||||
expect(result.candidates).toHaveLength(0);
|
||||
const shouldBlockForMismatch = actualUid !== 0;
|
||||
expect(result.candidates).toHaveLength(shouldBlockForMismatch ? 0 : 1);
|
||||
expect(result.diagnostics.some((diag) => diag.message.includes("suspicious ownership"))).toBe(
|
||||
true,
|
||||
shouldBlockForMismatch,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user