mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-25 16:12:13 +00:00
* test: dedupe extension-owned coverage * test: remove duplicate coverage files * test: move helper coverage into extensions * test: trim duplicate helper assertions * test: remove cloudflare helper import from agent test * test: align stale expectations with current main
32 lines
955 B
TypeScript
32 lines
955 B
TypeScript
import { describe, expect, test } from "vitest";
|
|
import { toSystemRunApprovalMismatchError } from "../infra/system-run-approval-binding.js";
|
|
|
|
describe("toSystemRunApprovalMismatchError", () => {
|
|
test("includes runId/code and preserves mismatch details", () => {
|
|
const result = toSystemRunApprovalMismatchError({
|
|
runId: "approval-123",
|
|
match: {
|
|
ok: false,
|
|
code: "APPROVAL_ENV_MISMATCH",
|
|
message: "approval id env binding mismatch",
|
|
details: {
|
|
envKeys: ["SAFE_A"],
|
|
expectedEnvHash: "expected-hash",
|
|
actualEnvHash: "actual-hash",
|
|
},
|
|
},
|
|
});
|
|
expect(result).toEqual({
|
|
ok: false,
|
|
message: "approval id env binding mismatch",
|
|
details: {
|
|
code: "APPROVAL_ENV_MISMATCH",
|
|
runId: "approval-123",
|
|
envKeys: ["SAFE_A"],
|
|
expectedEnvHash: "expected-hash",
|
|
actualEnvHash: "actual-hash",
|
|
},
|
|
});
|
|
});
|
|
});
|