mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-21 21:56:46 +00:00
test: freeze exec approval expiry
This commit is contained in:
@@ -129,7 +129,10 @@ describe("approval and confirmation modals", () => {
|
||||
});
|
||||
|
||||
it("renders exec approval as a labelled modal", async () => {
|
||||
vi.useFakeTimers();
|
||||
vi.setSystemTime(new Date("2026-04-29T00:00:00.000Z"));
|
||||
render(renderExecApprovalPrompt(createExecState()), container);
|
||||
vi.useRealTimers();
|
||||
|
||||
const { modal, dialog } = await getRenderedDialog();
|
||||
|
||||
@@ -140,11 +143,14 @@ describe("approval and confirmation modals", () => {
|
||||
"Exec approval needed",
|
||||
);
|
||||
expect(
|
||||
modal.shadowRoot?.querySelector("#openclaw-modal-dialog-description")?.textContent,
|
||||
).toContain("expires in");
|
||||
modal.shadowRoot?.querySelector("#openclaw-modal-dialog-description")?.textContent?.trim(),
|
||||
).toBe("expires in 1m");
|
||||
expect(container.querySelector("#exec-approval-title")?.textContent?.trim()).toBe(
|
||||
"Exec approval needed",
|
||||
);
|
||||
expect(container.querySelector("#exec-approval-description")?.textContent?.trim()).toBe(
|
||||
"expires in 1m",
|
||||
);
|
||||
});
|
||||
|
||||
it("renders command spans in exec approvals", async () => {
|
||||
|
||||
Reference in New Issue
Block a user