mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
feat: use mongo test db for unit tests
This commit is contained in:
committed by
Mohamed Marrouchi
parent
c7189758a9
commit
9642e823d0
@@ -201,18 +201,18 @@ describe('NlpEntityController', () => {
|
||||
describe('findOne', () => {
|
||||
it('should find a nlp entity', async () => {
|
||||
const firstNameEntity = await nlpEntityService.findOne({
|
||||
name: 'first_name',
|
||||
name: 'firstname',
|
||||
});
|
||||
const result = await nlpEntityController.findOne(firstNameEntity!.id, []);
|
||||
|
||||
expect(result).toEqualPayload(
|
||||
nlpEntityFixtures.find(({ name }) => name === 'first_name')!,
|
||||
nlpEntityFixtures.find(({ name }) => name === 'firstname')!,
|
||||
);
|
||||
});
|
||||
|
||||
it('should find a nlp entity, and populate its values', async () => {
|
||||
const firstNameEntity = await nlpEntityService.findOne({
|
||||
name: 'first_name',
|
||||
name: 'firstname',
|
||||
});
|
||||
const firstNameValues = await nlpValueService.findOne({ value: 'jhon' });
|
||||
const firstNameWithValues: NlpEntityFull = {
|
||||
@@ -242,7 +242,7 @@ describe('NlpEntityController', () => {
|
||||
describe('updateOne', () => {
|
||||
it('should update a nlp entity', async () => {
|
||||
const firstNameEntity = await nlpEntityService.findOne({
|
||||
name: 'first_name',
|
||||
name: 'firstname',
|
||||
});
|
||||
const updatedNlpEntity: NlpEntityCreateDto = {
|
||||
name: 'updated',
|
||||
|
||||
Reference in New Issue
Block a user