fix(settings): resume DingTalk space registration after login

This commit is contained in:
姚章浩
2026-09-15 00:08:40 +08:00
parent f82283abd4
commit 2005e4e7da
4 changed files with 44 additions and 22 deletions
+3 -1
View File
@@ -11,8 +11,10 @@ describe('DingTalk session client', () => {
}), { status: 201 }))
vi.stubGlobal('fetch', fetchMock)
await expect(startDingtalkSession()).resolves.toMatchObject({ id: 'session-1', state: 'starting' })
const target = 'https://alidocs.dingtalk.com/i/spaces/9JOGOQneRgkneX4Q/overview'
await expect(startDingtalkSession(target)).resolves.toMatchObject({ id: 'session-1', state: 'starting' })
expect(fetchMock).toHaveBeenCalledWith('/api/v1/dingtalk-session', expect.objectContaining({ method: 'POST' }))
expect(JSON.parse(String(fetchMock.mock.calls[0][1]?.body))).toEqual({ space: target })
})
it('preserves login_required as a machine-readable error for automatic QR fallback', async () => {