mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 01:11:46 +03:00
chore: finishing unit tests for a couple of services (#13292)
This commit is contained in:
@@ -46,6 +46,15 @@ describe(APIKeyService.name, () => {
|
||||
expect(cryptoMock.newPassword).toHaveBeenCalled();
|
||||
expect(cryptoMock.hashSha256).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should throw an error if the api key does not have sufficient permissions', async () => {
|
||||
await expect(
|
||||
sut.create(
|
||||
{ ...authStub.admin, apiKey: { ...keyStub.admin, permissions: [] } },
|
||||
{ permissions: [Permission.ASSET_READ] },
|
||||
),
|
||||
).rejects.toBeInstanceOf(BadRequestException);
|
||||
});
|
||||
});
|
||||
|
||||
describe('update', () => {
|
||||
|
||||
Reference in New Issue
Block a user