feat(FN-4640): complete Step 6 — dashboard sandbox audit surface
Fusion-Task-Id: FN-4640 Fusion-Task-Lineage: 4a91265f-1714-4854-b08d-7ddb06074253
This commit is contained in:
committed by
gsxdsm
parent
e4769ea889
commit
ad73d76586
@@ -17,7 +17,7 @@ function makeBackend(runImpl?: (command: string, options: SandboxRunOptions) =>
|
||||
policy.onFallback?.({ fromBackendId: "sandbox-exec", toBackendId: "native", reason: "unavailable" });
|
||||
}),
|
||||
run: runImpl ?? vi.fn(async () => ({ stdout: "ok", stderr: "", exitCode: 0, signal: null, timedOut: false, bufferExceeded: false })),
|
||||
runStreaming: vi.fn(async () => ({ outcome: "success", stdout: "", stderr: "", bufferOverflow: false })),
|
||||
runStreaming: vi.fn(async () => ({ outcome: "success" as const, stdout: "", stderr: "", bufferOverflow: false })),
|
||||
dispose: vi.fn(async () => {}),
|
||||
};
|
||||
}
|
||||
@@ -39,8 +39,9 @@ describe("withSandboxAudit", () => {
|
||||
await backend.prepare({ allowNetwork: false });
|
||||
await backend.prepare({ allowNetwork: false });
|
||||
|
||||
const prepareEvents = auditor.sandbox.mock.calls.filter(([input]) => input.type === "sandbox:prepare");
|
||||
const fallbackEvents = auditor.sandbox.mock.calls.filter(([input]) => input.type === "sandbox:fallback");
|
||||
const sandboxCalls = auditor.sandbox.mock.calls as unknown as Array<[Parameters<RunAuditor["sandbox"]>[0]]>;
|
||||
const prepareEvents = sandboxCalls.filter(([input]) => input.type === "sandbox:prepare");
|
||||
const fallbackEvents = sandboxCalls.filter(([input]) => input.type === "sandbox:fallback");
|
||||
expect(prepareEvents).toHaveLength(1);
|
||||
expect(fallbackEvents).toHaveLength(2);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user