mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 19:00:42 +00:00
test: tighten acp security helpers
This commit is contained in:
@@ -113,7 +113,9 @@ async function createHarness(
|
||||
const promptPromise = promptAgent(agent, SESSION_ID);
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(runId).toBeDefined();
|
||||
if (!runId) {
|
||||
throw new Error("expected ACP permission relay run id");
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@@ -27,7 +27,6 @@ function requireFinding(
|
||||
label: string,
|
||||
) {
|
||||
const finding = findings.find((entry) => entry.checkId === checkId);
|
||||
expect(finding, label).toBeDefined();
|
||||
if (!finding) {
|
||||
throw new Error(`Expected ${checkId} finding for ${label}`);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,6 @@ describe("security fix", () => {
|
||||
const whatsapp = channels.whatsapp;
|
||||
const accounts = whatsapp.accounts as Record<string, Record<string, unknown>>;
|
||||
const account = accounts[accountId];
|
||||
expect(account).toBeDefined();
|
||||
if (!account) {
|
||||
throw new Error(`Expected WhatsApp account ${accountId}`);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,6 @@ function expectInspectSuccess(
|
||||
function expectIcaclsResetCommand(
|
||||
result: ReturnType<typeof createIcaclsResetCommand>,
|
||||
): NonNullable<ReturnType<typeof createIcaclsResetCommand>> {
|
||||
expect(result).toBeDefined();
|
||||
if (!result) {
|
||||
throw new Error("Expected icacls reset command");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user