From d7e0d4a5d6a6bc77ef82460ec46e1ea36a1f9422 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Tue, 17 Jun 2025 11:47:17 +0100 Subject: [PATCH] fix(api): enhance postUpdate unit tests --- api/src/nlp/repositories/nlp-entity.repository.spec.ts | 2 +- api/src/nlp/repositories/nlp-value.repository.spec.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/nlp/repositories/nlp-entity.repository.spec.ts b/api/src/nlp/repositories/nlp-entity.repository.spec.ts index ed4141be..e48ccf69 100644 --- a/api/src/nlp/repositories/nlp-entity.repository.spec.ts +++ b/api/src/nlp/repositories/nlp-entity.repository.spec.ts @@ -230,7 +230,7 @@ describe('NlpEntityRepository', () => { }); describe('postUpdate', () => { - it('should update an NlpValue and trigger a postUpdate event', async () => { + it('should update an NlpEntity and trigger a postUpdate event', async () => { nlpEntityRepository.eventEmitter.once( 'hook:nlpEntity:postUpdate', async (...[query, updated]) => { diff --git a/api/src/nlp/repositories/nlp-value.repository.spec.ts b/api/src/nlp/repositories/nlp-value.repository.spec.ts index dec67457..6256dea0 100644 --- a/api/src/nlp/repositories/nlp-value.repository.spec.ts +++ b/api/src/nlp/repositories/nlp-value.repository.spec.ts @@ -263,15 +263,15 @@ describe('NlpValueRepository', () => { }, ); - const updatedNlpEntity = await nlpValueRepository.updateOne( + const updatedNlpValue = await nlpValueRepository.updateOne( { value: 'test', }, { value: 'test2' }, ); - const result = await nlpValueRepository.findOne(updatedNlpEntity.id); + const result = await nlpValueRepository.findOne(updatedNlpValue.id); - expect(result).toEqualPayload(updatedNlpEntity); + expect(result).toEqualPayload(updatedNlpValue); }); }); });