690408:0909 Done Task BE-ERR-02
CI / CD Pipeline / build (push) Successful in 5m26s
CI / CD Pipeline / deploy (push) Successful in 8m19s

This commit is contained in:
2026-04-08 09:09:12 +07:00
parent 961ee72343
commit 4f34aeae6b
2 changed files with 13 additions and 9 deletions
@@ -4,7 +4,11 @@ import { getRepositoryToken } from '@nestjs/typeorm';
import { WorkflowDslParser } from './parser.service'; import { WorkflowDslParser } from './parser.service';
import { WorkflowDefinition } from '../entities/workflow-definition.entity'; import { WorkflowDefinition } from '../entities/workflow-definition.entity';
import { RFA_WORKFLOW_EXAMPLE } from './workflow-dsl.schema'; import { RFA_WORKFLOW_EXAMPLE } from './workflow-dsl.schema';
import { BadRequestException } from '@nestjs/common'; import {
ValidationException,
WorkflowException,
NotFoundException,
} from '../../../common/exceptions';
describe('WorkflowDslParser', () => { describe('WorkflowDslParser', () => {
let parser: WorkflowDslParser; let parser: WorkflowDslParser;
@@ -50,7 +54,7 @@ describe('WorkflowDslParser', () => {
const invalidJson = '{ invalid json }'; const invalidJson = '{ invalid json }';
await expect(parser.parse(invalidJson)).rejects.toThrow( await expect(parser.parse(invalidJson)).rejects.toThrow(
BadRequestException ValidationException
); );
}); });
@@ -71,7 +75,7 @@ describe('WorkflowDslParser', () => {
}; };
await expect(parser.parse(JSON.stringify(invalidDsl))).rejects.toThrow( await expect(parser.parse(JSON.stringify(invalidDsl))).rejects.toThrow(
BadRequestException WorkflowException
); );
}); });
@@ -86,7 +90,7 @@ describe('WorkflowDslParser', () => {
}; };
await expect(parser.parse(JSON.stringify(invalidDsl))).rejects.toThrow( await expect(parser.parse(JSON.stringify(invalidDsl))).rejects.toThrow(
BadRequestException WorkflowException
); );
}); });
@@ -101,7 +105,7 @@ describe('WorkflowDslParser', () => {
}; };
await expect(parser.parse(JSON.stringify(invalidDsl))).rejects.toThrow( await expect(parser.parse(JSON.stringify(invalidDsl))).rejects.toThrow(
BadRequestException WorkflowException
); );
}); });
@@ -119,7 +123,7 @@ describe('WorkflowDslParser', () => {
}; };
await expect(parser.parse(JSON.stringify(invalidDsl))).rejects.toThrow( await expect(parser.parse(JSON.stringify(invalidDsl))).rejects.toThrow(
BadRequestException WorkflowException
); );
}); });
@@ -130,7 +134,7 @@ describe('WorkflowDslParser', () => {
}; };
await expect(parser.parse(JSON.stringify(invalidDsl))).rejects.toThrow( await expect(parser.parse(JSON.stringify(invalidDsl))).rejects.toThrow(
BadRequestException WorkflowException
); );
}); });
}); });
@@ -185,7 +189,7 @@ describe('WorkflowDslParser', () => {
mockRepository.findOne = jest.fn().mockResolvedValue(null); mockRepository.findOne = jest.fn().mockResolvedValue(null);
await expect(parser.getParsedDsl('999')).rejects.toThrow( await expect(parser.getParsedDsl('999')).rejects.toThrow(
BadRequestException NotFoundException
); );
}); });
}); });
@@ -10,7 +10,7 @@ import {
import { WorkflowHistory } from './entities/workflow-history.entity'; import { WorkflowHistory } from './entities/workflow-history.entity';
import { WorkflowDslService } from './workflow-dsl.service'; import { WorkflowDslService } from './workflow-dsl.service';
import { WorkflowEventService } from './workflow-event.service'; import { WorkflowEventService } from './workflow-event.service';
import { NotFoundException } from '@nestjs/common'; import { NotFoundException } from '../../common/exceptions';
import { CreateWorkflowDefinitionDto } from './dto/create-workflow-definition.dto'; import { CreateWorkflowDefinitionDto } from './dto/create-workflow-definition.dto';
describe('WorkflowEngineService', () => { describe('WorkflowEngineService', () => {