Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(desktop): r10-m1 unmount chat controller tests

Josué9be547e2cfe2
diff --git a/desktop-app/ui/src/hooks/domain/__tests__/useAgentChatController.test.tsx b/desktop-app/ui/src/hooks/domain/__tests__/useAgentChatController.test.tsx
index 98fd39c54..5c65fb51f 100644
--- a/desktop-app/ui/src/hooks/domain/__tests__/useAgentChatController.test.tsx
+++ b/desktop-app/ui/src/hooks/domain/__tests__/useAgentChatController.test.tsx
@@ -12,7 +12,7 @@
*/
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { makeTaskKey } from '@contexts/AgentTaskTrackerContext/types'
-import { act, waitFor } from '@testing-library/react'
+import { act, cleanup, waitFor } from '@testing-library/react'
import { renderController } from './__fixtures__/controllerHarness'
import { type MockClerum, installMockClerum, uninstallMockClerum } from './__fixtures__/mockClerum'
@@ -32,9 +32,11 @@ beforeEach(() => {
})
afterEach(() => {
+ cleanup()
vi.restoreAllMocks()
vi.useRealTimers()
uninstallMockClerum()
+ expect(document.body.childElementCount).toBe(0)
})
/** Wait until the controller's mount effect (loadChatList) has settled. */