mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Ensure ID is a positive integer when fetching execution (#9629)
This commit is contained in:
@@ -4,6 +4,7 @@ import { ExecutionsController } from '@/executions/executions.controller';
|
||||
import type { ExecutionRequest, ExecutionSummaries } from '@/executions/execution.types';
|
||||
import type { ExecutionService } from '@/executions/execution.service';
|
||||
import type { WorkflowSharingService } from '@/workflows/workflowSharing.service';
|
||||
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
|
||||
|
||||
describe('ExecutionsController', () => {
|
||||
const executionService = mock<ExecutionService>();
|
||||
@@ -20,6 +21,14 @@ describe('ExecutionsController', () => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
describe('getOne', () => {
|
||||
it('should 400 when execution is not a number', async () => {
|
||||
const req = mock<ExecutionRequest.GetOne>({ params: { id: 'test' } });
|
||||
|
||||
await expect(executionsController.getOne(req)).rejects.toThrow(BadRequestError);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getMany', () => {
|
||||
const NO_EXECUTIONS = { count: 0, estimated: false, results: [] };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user