fix(api): enhance postUpdate unit tests

This commit is contained in:
yassinedorbozgithub 2025-06-17 11:47:17 +01:00
parent 2d133450f1
commit d7e0d4a5d6
2 changed files with 4 additions and 4 deletions

View File

@ -230,7 +230,7 @@ describe('NlpEntityRepository', () => {
}); });
describe('postUpdate', () => { 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( nlpEntityRepository.eventEmitter.once(
'hook:nlpEntity:postUpdate', 'hook:nlpEntity:postUpdate',
async (...[query, updated]) => { async (...[query, updated]) => {

View File

@ -263,15 +263,15 @@ describe('NlpValueRepository', () => {
}, },
); );
const updatedNlpEntity = await nlpValueRepository.updateOne( const updatedNlpValue = await nlpValueRepository.updateOne(
{ {
value: 'test', value: 'test',
}, },
{ value: 'test2' }, { value: 'test2' },
); );
const result = await nlpValueRepository.findOne(updatedNlpEntity.id); const result = await nlpValueRepository.findOne(updatedNlpValue.id);
expect(result).toEqualPayload(updatedNlpEntity); expect(result).toEqualPayload(updatedNlpValue);
}); });
}); });
}); });