mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-05-01 05:00:13 +00:00
enhance: update test
This commit is contained in:
parent
6637dde2b7
commit
14c968ad45
5 changed files with 74 additions and 18 deletions
|
|
@ -286,6 +286,9 @@ describe('useInstallationSetup Hook', () => {
|
|||
})
|
||||
|
||||
it('should handle installation status check failure', async () => {
|
||||
// Mock console.error to suppress expected error logs
|
||||
const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => {})
|
||||
|
||||
electronAPI.getInstallationStatus.mockRejectedValue(new Error('Status check failed'))
|
||||
|
||||
renderHook(() => useInstallationSetup())
|
||||
|
|
@ -294,6 +297,13 @@ describe('useInstallationSetup Hook', () => {
|
|||
await vi.waitFor(() => {
|
||||
expect(electronAPI.getInstallationStatus).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
// Wait for error to be logged
|
||||
await vi.waitFor(() => {
|
||||
expect(consoleErrorSpy).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
consoleErrorSpy.mockRestore()
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue