Skip to content

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

TypeScript

test(desktop): assert visible logout and GFS recovery state (R13-L10)

Josué29a02e30b236
diff --git a/desktop-app/src/__tests__/appService.nativeLogoutRecovery.test.ts b/desktop-app/src/__tests__/appService.nativeLogoutRecovery.test.ts
index b81eae0f0..bca385fd3 100644
--- a/desktop-app/src/__tests__/appService.nativeLogoutRecovery.test.ts
+++ b/desktop-app/src/__tests__/appService.nativeLogoutRecovery.test.ts
@@ -24,8 +24,6 @@ describe('AppService logout recovery ownership', () => {
}),
} as never
await service.googleLogin('initial-login')
- const app = service as unknown as { activateGfsAuthScope: () => void }
- const restoreAuthScope = vi.spyOn(app, 'activateGfsAuthScope')
service.tokenStore.clearSessionToken = vi
.fn()
.mockRejectedValue(new Error('keychain unavailable'))
@@ -34,6 +32,6 @@ describe('AppService logout recovery ownership', () => {
expect(service.getCachedUserId()).toBe('user-a')
expect(service.sessionToken).toBe('synthetic-session-a')
- expect(restoreAuthScope).toHaveBeenCalledOnce()
+ await expect(service.listGfsUploadSessions()).resolves.toEqual([])
})
})
diff --git a/desktop-app/ui/src/hooks/__tests__/useAppController.desktopEnvironmentHandoff.test.tsx b/desktop-app/ui/src/hooks/__tests__/useAppController.desktopEnvironmentHandoff.test.tsx
index 0ca0675ed..d180eb752 100644
--- a/desktop-app/ui/src/hooks/__tests__/useAppController.desktopEnvironmentHandoff.test.tsx
+++ b/desktop-app/ui/src/hooks/__tests__/useAppController.desktopEnvironmentHandoff.test.tsx
@@ -94,6 +94,9 @@ describe('useAppController desktop environment handoff', () => {
expect(handle.selectRuntimeConfigForHandoff).not.toHaveBeenCalled()
expect(app.result.current.isAuthenticated).toBe(true)
expect(app.result.current.pendingDesktopEnvironmentSwitchConfirmation).toBeNull()
+ expect(app.result.current.toasts.map(toast => toast.text)).toContain(
+ 'Environment switch cancelled. Your current session remains active.'
+ )
})
it('signs out before selecting the saved environment with the logout generation', async () => {
@@ -108,9 +111,7 @@ describe('useAppController desktop environment handoff', () => {
handle.selectRuntimeConfigForHandoff.mock.invocationCallOrder[0]!
)
expect(app.result.current.isAuthenticated).toBe(false)
- await expect(handle.getRuntimeConfigState()).resolves.toMatchObject({
- activeOptionId: 'target-profile',
- })
+ expect(app.result.current.runtimeConfigState?.activeOptionId).toBe('target-profile')
})
it('keeps the committed logout when renderer session reload fails', async () => {