mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 20:20:21 +00:00
fix: stabilize exec approval approver routing
This commit is contained in:
@@ -46,7 +46,7 @@ describe("exec approval reply helpers", () => {
|
||||
|
||||
it("returns the approver DM notice text", () => {
|
||||
expect(getExecApprovalApproverDmNoticeText()).toBe(
|
||||
"Approval required. I sent the allowed approvers DMs.",
|
||||
"Approval required. I sent approval DMs to the approvers for this account.",
|
||||
);
|
||||
});
|
||||
|
||||
@@ -129,6 +129,19 @@ describe("exec approval reply helpers", () => {
|
||||
expect(payload.text).toContain("Expires in: 0s");
|
||||
});
|
||||
|
||||
it("formats longer approval windows in minutes", () => {
|
||||
const payload = buildExecApprovalPendingReplyPayload({
|
||||
approvalId: "req-30m",
|
||||
approvalSlug: "slug-30m",
|
||||
command: "echo later",
|
||||
host: "gateway",
|
||||
expiresAtMs: 1_801_000,
|
||||
nowMs: 1_000,
|
||||
});
|
||||
|
||||
expect(payload.text).toContain("Expires in: 30m");
|
||||
});
|
||||
|
||||
it("builds unavailable payloads for approver DMs", () => {
|
||||
expect(
|
||||
buildExecApprovalUnavailableReplyPayload({
|
||||
@@ -137,7 +150,7 @@ describe("exec approval reply helpers", () => {
|
||||
sentApproverDms: true,
|
||||
}),
|
||||
).toEqual({
|
||||
text: "Careful.\n\nApproval required. I sent the allowed approvers DMs.",
|
||||
text: "Careful.\n\nApproval required. I sent approval DMs to the approvers for this account.",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user