Skip to content

AI Assistant: error handling integration tests#33666

Open
dmirgaev wants to merge 10 commits into
DevExpress:26_1from
dmirgaev:26_1__ai_assistant_error_handling
Open

AI Assistant: error handling integration tests#33666
dmirgaev wants to merge 10 commits into
DevExpress:26_1from
dmirgaev:26_1__ai_assistant_error_handling

Conversation

@dmirgaev
Copy link
Copy Markdown
Contributor

No description provided.

@dmirgaev dmirgaev self-assigned this May 21, 2026
Copilot AI review requested due to automatic review settings May 21, 2026 17:25
@dmirgaev dmirgaev requested a review from a team as a code owner May 21, 2026 17:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@dmirgaev dmirgaev force-pushed the 26_1__ai_assistant_error_handling branch from 3441527 to 6ae8ed0 Compare May 21, 2026 21:31
@dmirgaev dmirgaev force-pushed the 26_1__ai_assistant_error_handling branch from 6ae8ed0 to f839f16 Compare May 21, 2026 21:32
Alyar666
Alyar666 previously approved these changes May 22, 2026
Copilot AI review requested due to automatic review settings May 22, 2026 10:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment on lines +1 to +6
import type DataGrid from '@js/ui/data_grid';
import type { Controllers } from '@ts/grids/grid_core/m_types';

export interface DataGridWithControllers extends DataGrid {
getController: <T extends keyof Controllers>(name: T) => Controllers[T];
}
if ($message.hasClass(CLASSES.messageError)) {
return MessageStatus.Failure;
}
return '' as never;
Comment on lines +288 to +307
const { model, getLastCallbacks } = await createDataGridWithAiAndPopup();

model.sendAiRequest('Sort by name');
jest.runAllTimers();

const actions = [{ name: 'sort', args: { column: 'Name' } }];
getLastCallbacks().onComplete?.({ actions });
await flushAsync();
await flushAsync();

const messages = await model.loadMessages();

expect(messages).toEqual([
expect.objectContaining({
status: MessageStatus.Failure,
errorText: 'Execution already in progress. Please wait.',
}),
]);

isExecutingSpy.mockRestore();
Comment on lines +74 to +88
const createDataGridWithAi = async (
overrides: Record<string, unknown> = {},
): Promise<{
model: AIAssistantDataGridModel;
getLastCallbacks: () => RequestCallbacks<ExecuteGridAssistantCommandResult>;
getAbortSpy: () => jest.Mock;
}> => {
const { aiIntegration, getLastCallbacks, getAbortSpy } = createMockAIIntegration();

await createDataGrid({
dataSource: LOCAL_DATA,
columns: DEFAULT_COLUMNS,
aiAssistant: { enabled: true, aiIntegration, title: 'AI Assistant' },
...overrides,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants