mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix(api): enhance postUpdate unit tests
This commit is contained in:
parent
2d133450f1
commit
d7e0d4a5d6
@ -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]) => {
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user