mirror of
https://github.com/hexastack/hexabot
synced 2025-04-10 15:55:55 +00:00
fix: update NLP module unit tests
This commit is contained in:
parent
fb4c45d5e0
commit
e8c6ff3406
@ -111,6 +111,8 @@ describe('NlpEntityController', () => {
|
||||
values: nlpValueFixtures.filter(
|
||||
({ entity }) => parseInt(entity) === index,
|
||||
) as NlpEntityFull['values'],
|
||||
lookups: curr.lookups!,
|
||||
builtin: curr.builtin!,
|
||||
});
|
||||
return acc;
|
||||
},
|
||||
@ -214,6 +216,8 @@ describe('NlpEntityController', () => {
|
||||
id: firstNameEntity!.id,
|
||||
createdAt: firstNameEntity!.createdAt,
|
||||
updatedAt: firstNameEntity!.updatedAt,
|
||||
lookups: firstNameEntity!.lookups,
|
||||
builtin: firstNameEntity!.builtin,
|
||||
};
|
||||
const result = await nlpEntityController.findOne(firstNameEntity!.id, [
|
||||
'values',
|
||||
|
@ -42,7 +42,7 @@ import { PopulatePipe } from '@/utils/pipes/populate.pipe';
|
||||
import { SearchFilterPipe } from '@/utils/pipes/search-filter.pipe';
|
||||
import { TFilterQuery } from '@/utils/types/filter.types';
|
||||
|
||||
import { NlpSampleDto } from '../dto/nlp-sample.dto';
|
||||
import { NlpSampleDto, TNlpSampleDto } from '../dto/nlp-sample.dto';
|
||||
import {
|
||||
NlpSample,
|
||||
NlpSampleFull,
|
||||
@ -60,7 +60,8 @@ export class NlpSampleController extends BaseController<
|
||||
NlpSample,
|
||||
NlpSampleStub,
|
||||
NlpSamplePopulate,
|
||||
NlpSampleFull
|
||||
NlpSampleFull,
|
||||
TNlpSampleDto
|
||||
> {
|
||||
constructor(
|
||||
private readonly nlpSampleService: NlpSampleService,
|
||||
|
@ -100,6 +100,9 @@ describe('NlpValueController', () => {
|
||||
entity: nlpEntityFixtures[
|
||||
parseInt(curr.entity)
|
||||
] as NlpValueFull['entity'],
|
||||
builtin: curr.builtin!,
|
||||
expressions: curr.expressions!,
|
||||
metadata: curr.metadata!,
|
||||
});
|
||||
return acc;
|
||||
},
|
||||
@ -123,6 +126,9 @@ describe('NlpValueController', () => {
|
||||
const ValueWithEntities = {
|
||||
...curr,
|
||||
entity: nlpEntities[parseInt(curr.entity)].id,
|
||||
expressions: curr.expressions!,
|
||||
metadata: curr.metadata!,
|
||||
builtin: curr.builtin!,
|
||||
};
|
||||
acc.push(ValueWithEntities);
|
||||
return acc;
|
||||
|
@ -113,6 +113,9 @@ describe('NlpSampleEntityRepository', () => {
|
||||
const ValueWithEntities = {
|
||||
...curr,
|
||||
entity: nlpEntities[0].id,
|
||||
expressions: curr.expressions!,
|
||||
builtin: curr.builtin!,
|
||||
metadata: curr.metadata!,
|
||||
};
|
||||
acc.push(ValueWithEntities);
|
||||
return acc;
|
||||
|
@ -89,6 +89,9 @@ describe('NlpValueRepository', () => {
|
||||
entity: nlpEntityFixtures[
|
||||
parseInt(curr.entity)
|
||||
] as NlpValueFull['entity'],
|
||||
builtin: curr.builtin!,
|
||||
expressions: curr.expressions!,
|
||||
metadata: curr.metadata!,
|
||||
};
|
||||
acc.push(ValueWithEntities);
|
||||
return acc;
|
||||
|
@ -133,6 +133,9 @@ describe('NlpSampleEntityService', () => {
|
||||
const ValueWithEntities = {
|
||||
...curr,
|
||||
entity: nlpEntities[0].id,
|
||||
expressions: curr.expressions!,
|
||||
builtin: curr.builtin!,
|
||||
metadata: curr.metadata!,
|
||||
};
|
||||
acc.push(ValueWithEntities);
|
||||
return acc;
|
||||
|
@ -97,6 +97,9 @@ describe('NlpValueService', () => {
|
||||
entity: nlpEntityFixtures[
|
||||
parseInt(curr.entity)
|
||||
] as NlpValueFull['entity'],
|
||||
expressions: curr.expressions!,
|
||||
metadata: curr.metadata!,
|
||||
builtin: curr.builtin!,
|
||||
};
|
||||
acc.push(ValueWithEntities);
|
||||
return acc;
|
||||
|
Loading…
Reference in New Issue
Block a user