Skip to content

Commit

Permalink
fix: update NLP module unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yassinedorbozgithub committed Jan 13, 2025
1 parent fb4c45d commit e8c6ff3
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 2 deletions.
4 changes: 4 additions & 0 deletions api/src/nlp/controllers/nlp-entity.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ describe('NlpEntityController', () => {
values: nlpValueFixtures.filter(
({ entity }) => parseInt(entity) === index,
) as NlpEntityFull['values'],
lookups: curr.lookups!,
builtin: curr.builtin!,
});
return acc;
},
Expand Down Expand Up @@ -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',
Expand Down
5 changes: 3 additions & 2 deletions api/src/nlp/controllers/nlp-sample.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -60,7 +60,8 @@ export class NlpSampleController extends BaseController<
NlpSample,
NlpSampleStub,
NlpSamplePopulate,
NlpSampleFull
NlpSampleFull,
TNlpSampleDto
> {
constructor(
private readonly nlpSampleService: NlpSampleService,
Expand Down
6 changes: 6 additions & 0 deletions api/src/nlp/controllers/nlp-value.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand All @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions api/src/nlp/repositories/nlp-sample-entity.repository.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions api/src/nlp/repositories/nlp-value.repository.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions api/src/nlp/services/nlp-sample-entity.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions api/src/nlp/services/nlp-value.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e8c6ff3

Please sign in to comment.