690408:0909 Done Task BE-ERR-02
This commit is contained in:
@@ -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', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user