chore: update test file

This commit is contained in:
Wendong-Fan 2025-11-08 15:46:21 +08:00
parent 34cc128d1a
commit 746064aebe
6 changed files with 475 additions and 352 deletions

View file

@ -360,51 +360,4 @@ describe('useInstallationSetup Hook', () => {
})
})
describe('Console Logging', () => {
it('should log installation status check', async () => {
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => {})
renderHook(() => useInstallationSetup())
await vi.waitFor(() => {
expect(consoleLogSpy).toHaveBeenCalledWith(
'[useInstallationSetup] Installation status check:',
expect.any(Object)
)
})
consoleLogSpy.mockRestore()
})
it('should log when installation listeners are registered', () => {
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => {})
renderHook(() => useInstallationSetup())
expect(consoleLogSpy).toHaveBeenCalledWith(
'[useInstallationSetup] Installation listeners registered'
)
consoleLogSpy.mockRestore()
})
it('should log install complete events', () => {
const consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => {})
renderHook(() => useInstallationSetup())
const completeCallback = electronAPI.onInstallDependenciesComplete.mock.calls[0][0]
act(() => {
completeCallback({ success: true })
})
expect(consoleLogSpy).toHaveBeenCalledWith(
'[useInstallationSetup] Install complete event received:',
{ success: true }
)
consoleLogSpy.mockRestore()
})
})
})