test(hooks): remove unsafe test assertions

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-05-12 14:22:05 +09:00
parent 11b3638493
commit 23211159c9
37 changed files with 242 additions and 232 deletions
@@ -37,7 +37,7 @@ function createFakeTimeouts(): FakeTimeouts {
callback,
args,
})
return id as unknown as ReturnType<typeof setTimeout>
return testCoerce<ReturnType<typeof setTimeout>>(id)
}) as typeof setTimeout
globalThis.clearTimeout = ((id?: number) => {
@@ -243,7 +243,7 @@ describe("executeCompact lock management", () => {
await executeCompact(sessionID, msg, autoCompactState, mockClient, directory, pluginConfig)
// then: Toast should be shown
const toastCalls = (mockClient.tui.showToast as any).mock.calls
const toastCalls = (testCoerce(mockClient.tui.showToast)).mock.calls
const blockedToast = toastCalls.find(
(call: any) => call[0]?.body?.title === "Compact In Progress",
)
@@ -276,7 +276,7 @@ describe("executeCompact lock management", () => {
await executeCompact(sessionID, msg, autoCompactState, mockClient, directory, pluginConfig)
// then: Should show failure toast
const toastCalls = (mockClient.tui.showToast as any).mock.calls
const toastCalls = (testCoerce(mockClient.tui.showToast)).mock.calls
const failureToast = toastCalls.find(
(call: any) => call[0]?.body?.title === "Auto Compact Failed",
)