Use GetOperation to poll for OnboardUser completion (#15827)

Co-authored-by: Vedant Mahajan <vedant.04.mahajan@gmail.com>
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
Ishaan Gupta
2026-01-07 00:38:59 +05:30
committed by GitHub
parent 9172e28315
commit cce4574143
4 changed files with 133 additions and 9 deletions
@@ -432,6 +432,31 @@ describe('CodeAssistServer', () => {
expect(response.name).toBe('operations/123');
});
it('should call the getOperation endpoint', async () => {
const { server } = createTestServer();
const mockResponse = {
name: 'operations/123',
done: true,
response: {
cloudaicompanionProject: {
id: 'test-project',
name: 'projects/test-project',
},
},
};
vi.spyOn(server, 'requestGetOperation').mockResolvedValue(mockResponse);
const response = await server.getOperation('operations/123');
expect(server.requestGetOperation).toHaveBeenCalledWith('operations/123');
expect(response.name).toBe('operations/123');
expect(response.response?.cloudaicompanionProject?.id).toBe('test-project');
expect(response.response?.cloudaicompanionProject?.name).toBe(
'projects/test-project',
);
});
it('should call the loadCodeAssist endpoint', async () => {
const { server } = createTestServer();
const mockResponse = {