mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 18:44:30 -07:00
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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user