mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat(editor): Remove AI Error Debugging (#9337)
This commit is contained in:
committed by
GitHub
parent
f64a41d617
commit
cda062bde6
@@ -1,42 +0,0 @@
|
||||
import { Container } from 'typedi';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import { mockInstance } from '../../shared/mocking';
|
||||
import { AIService } from '@/services/ai.service';
|
||||
import { AIController } from '@/controllers/ai.controller';
|
||||
import type { AIRequest } from '@/requests';
|
||||
import type { INode, INodeType } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import { NodeTypes } from '@/NodeTypes';
|
||||
|
||||
describe('AIController', () => {
|
||||
const aiService = mockInstance(AIService);
|
||||
const nodeTypesService = mockInstance(NodeTypes);
|
||||
const controller = Container.get(AIController);
|
||||
|
||||
describe('debugError', () => {
|
||||
it('should retrieve nodeType based on error and call aiService.debugError', async () => {
|
||||
const nodeType = {
|
||||
description: {},
|
||||
} as INodeType;
|
||||
const error = new NodeOperationError(
|
||||
{
|
||||
type: 'n8n-nodes-base.error',
|
||||
typeVersion: 1,
|
||||
} as INode,
|
||||
'Error message',
|
||||
);
|
||||
|
||||
const req = mock<AIRequest.DebugError>({
|
||||
body: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
nodeTypesService.getByNameAndVersion.mockReturnValue(nodeType);
|
||||
|
||||
await controller.debugError(req);
|
||||
|
||||
expect(aiService.debugError).toHaveBeenCalledWith(error, nodeType);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user