Skip to content

The agent that grows with you

fix(desktop): assert the draft identity in the cloud sign-in IPC contract test

Brooklyn Nicholson1e1e47373c3c
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index f75faaf0b94..2f79838b353 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -548,7 +548,6 @@ import { decodeWebText } from './web-text-decoder'
import { windowAcceleratorAction } from './window-accelerator'
import { enumerateWindowsFrontToBack, enumerationFailed, readWindowBelow } from './window-below'
import { bindWindowChromeEvents } from './window-chrome-events'
-import { liveWindowState, overlayWindowState } from './connection-window-state'
import {
registrySshPoolScopeByConnectionId,
registrySshScopeForWindowRoute,
diff --git a/apps/desktop/src/app/settings/connections-registry.test.tsx b/apps/desktop/src/app/settings/connections-registry.test.tsx
index ee1595dd49f..ba2f4acd645 100644
--- a/apps/desktop/src/app/settings/connections-registry.test.tsx
+++ b/apps/desktop/src/app/settings/connections-registry.test.tsx
@@ -214,7 +214,15 @@ describe('ConnectionsRegistrySection', () => {
// Cloud never takes a pasted token: no token box, a sign-in button instead.
expect(screen.queryByPlaceholderText('Paste session token')).toBeNull()
fireEvent.click(await screen.findByRole('button', { name: /sign in/i }))
- await waitFor(() => expect(oauthLoginConnectionConfig).toHaveBeenCalledWith('https://team.hermes.cloud'))
+ // The draft identity rides along (#99989): a pre-save sign-in must name the
+ // connection whose jar the login writes into — connectionId null (unset draft)
+ // plus the draft label here.
+ await waitFor(() =>
+ expect(oauthLoginConnectionConfig).toHaveBeenCalledWith('https://team.hermes.cloud', {
+ connectionId: null,
+ label: 'Team cloud'
+ })
+ )
fireEvent.click(screen.getByText('Save connection').closest('button')!)