Skip to content

Commit 610e17a

Browse files
committed
fix type error and zod-to-json-schema import path
1 parent 59071e2 commit 610e17a

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

packages/devextreme/js/__internal/grids/grid_core/ai_assistant/__tests__/ai_assistant_controller.test.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type { CommandResult } from '../types';
2121

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

24-
const MockedGridCommands = jest.mocked(GridCommands);
24+
const MockedGridCommands = GridCommands as jest.MockedClass<typeof GridCommands>;
2525

2626
let sendRequestCallbacks: RequestCallbacks<ExecuteGridAssistantCommandResult> = {};
2727

@@ -67,10 +67,13 @@ describe('AIAssistantController', () => {
6767
jest.clearAllMocks();
6868

6969
// TODO: Rework the tests using updated GridCommands implementation
70-
MockedGridCommands.mockImplementation(() => ({
71-
validate: jest.fn().mockReturnValue(true),
72-
executeCommands: jest.fn<() => Promise<CommandResult[]>>().mockResolvedValue([{ status: 'success', message: 'sort' }]),
73-
}) as unknown as GridCommands);
70+
(MockedGridCommands.mockImplementation as jest.Mock).call(
71+
MockedGridCommands,
72+
() => ({
73+
validate: jest.fn().mockReturnValue(true),
74+
executeCommands: jest.fn<() => Promise<CommandResult[]>>().mockResolvedValue([{ status: 'success', message: 'sort' }]),
75+
}),
76+
);
7477
});
7578

7679
describe('getMessageDataSource', () => {

packages/devextreme/testing/runner/lib/pages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export function createPagesRenderer({
180180
'systemjs-babel-build': '/packages/devextreme/node_modules/systemjs-plugin-babel/systemjs-babel-browser.js',
181181
// eslint-disable-next-line spellcheck/spell-checker
182182
zod: '/packages/devextreme/node_modules/zod/lib/index.mjs',
183-
'zod-to-json-schema': '/packages/devextreme/node_modules/zod-to-json-schema/dist/cjs/zodToJsonSchema.js',
183+
'zod-to-json-schema': '/packages/devextreme/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js',
184184
...cspMap,
185185
};
186186

0 commit comments

Comments
 (0)