mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
test: fix unit tests
This commit is contained in:
@@ -82,7 +82,13 @@ describe('SettingController', () => {
|
||||
);
|
||||
|
||||
expect(settingService.find).toHaveBeenCalled();
|
||||
expect(result).toEqualPayload(settingFixtures);
|
||||
expect(result).toEqualPayload(settingFixtures, [
|
||||
'id',
|
||||
'createdAt',
|
||||
'updatedAt',
|
||||
'subgroup',
|
||||
'translatable',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -97,12 +103,15 @@ describe('SettingController', () => {
|
||||
const result = await settingController.updateOne(id, payload);
|
||||
|
||||
expect(settingService.updateOne).toHaveBeenCalledWith(id, payload);
|
||||
expect(result).toEqualPayload({
|
||||
...settingFixtures.find(
|
||||
(settingFixture) => settingFixture.value === 'admin@example.com',
|
||||
),
|
||||
value: payload.value,
|
||||
});
|
||||
expect(result).toEqualPayload(
|
||||
{
|
||||
...settingFixtures.find(
|
||||
(settingFixture) => settingFixture.value === 'admin@example.com',
|
||||
),
|
||||
value: payload.value,
|
||||
},
|
||||
['id', 'createdAt', 'updatedAt', 'subgroup', 'translatable'],
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -84,6 +84,7 @@ describe('SettingService', () => {
|
||||
expect(settingRepository.findAll).toHaveBeenCalled();
|
||||
expect(result).toEqualPayload(
|
||||
settingService.group(settingFixtures as Setting[]),
|
||||
['id', 'createdAt', 'updatedAt', 'subgroup', 'translatable'],
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user