Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class ExecuteGridAssistantCommand extends BaseCommand<
};
}

// TODO: check response more carefully
protected parseResult(
response: ExecuteGridAssistantCommandResponse,
): ExecuteGridAssistantCommandResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ import {
AI_ASSISTANT_AUTHOR_ID,
MessageStatus,
} from '../const';
import { GridCommands } from '../grid_commands';
import type { CommandResult } from '../types';

jest.mock('../grid_commands');

const MockedGridCommands = GridCommands as jest.MockedClass<typeof GridCommands>;

let sendRequestCallbacks: RequestCallbacks<ExecuteGridAssistantCommandResult> = {};

Expand Down Expand Up @@ -59,6 +65,15 @@ const getStore = (controller: AIAssistantController): ArrayStore<Message, string
describe('AIAssistantController', () => {
beforeEach(() => {
jest.clearAllMocks();

// TODO: Rework the tests using updated GridCommands implementation
(MockedGridCommands.mockImplementation as jest.Mock).call(
MockedGridCommands,
() => ({
validate: jest.fn().mockReturnValue(true),
executeCommands: jest.fn<() => Promise<CommandResult[]>>().mockResolvedValue([{ status: 'success', message: 'sort' }]),
}),
);
});

describe('getMessageDataSource', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
beforeTest,
createDataGrid,
} from '../../__tests__/__mock__/helpers/utils';
import { AIAssistantIntegrationController } from '../m_ai_assistant_integration_controller';
import { AIAssistantIntegrationController } from '../ai_assistant_integration_controller';

interface SendRequestResult {
promise: Promise<string>;
Expand Down
Loading
Loading