mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
Fix unit tests
This commit is contained in:
parent
21835c5287
commit
3c3a1bb1a5
1 changed files with 29 additions and 15 deletions
|
|
@ -36,10 +36,14 @@ describe(TimelineService.name, () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(mocks.access.album.checkOwnerAccess).toHaveBeenCalledWith(authStub.admin.user.id, new Set(['album-id']));
|
expect(mocks.access.album.checkOwnerAccess).toHaveBeenCalledWith(authStub.admin.user.id, new Set(['album-id']));
|
||||||
expect(mocks.asset.getTimeBucket).toHaveBeenCalledWith('bucket', {
|
expect(mocks.asset.getTimeBucket).toHaveBeenCalledWith(
|
||||||
timeBucket: 'bucket',
|
'bucket',
|
||||||
albumId: 'album-id',
|
{
|
||||||
});
|
timeBucket: 'bucket',
|
||||||
|
albumId: 'album-id',
|
||||||
|
},
|
||||||
|
authStub.admin,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return the assets for a archive time bucket if user has archive.read', async () => {
|
it('should return the assets for a archive time bucket if user has archive.read', async () => {
|
||||||
|
|
@ -60,6 +64,7 @@ describe(TimelineService.name, () => {
|
||||||
visibility: AssetVisibility.Archive,
|
visibility: AssetVisibility.Archive,
|
||||||
userIds: [authStub.admin.user.id],
|
userIds: [authStub.admin.user.id],
|
||||||
}),
|
}),
|
||||||
|
authStub.admin,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -76,12 +81,16 @@ describe(TimelineService.name, () => {
|
||||||
withPartners: true,
|
withPartners: true,
|
||||||
}),
|
}),
|
||||||
).resolves.toEqual(json);
|
).resolves.toEqual(json);
|
||||||
expect(mocks.asset.getTimeBucket).toHaveBeenCalledWith('bucket', {
|
expect(mocks.asset.getTimeBucket).toHaveBeenCalledWith(
|
||||||
timeBucket: 'bucket',
|
'bucket',
|
||||||
visibility: AssetVisibility.Timeline,
|
{
|
||||||
withPartners: true,
|
timeBucket: 'bucket',
|
||||||
userIds: [authStub.admin.user.id],
|
visibility: AssetVisibility.Timeline,
|
||||||
});
|
withPartners: true,
|
||||||
|
userIds: [authStub.admin.user.id],
|
||||||
|
},
|
||||||
|
authStub.admin,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should check permissions to read tag', async () => {
|
it('should check permissions to read tag', async () => {
|
||||||
|
|
@ -96,11 +105,15 @@ describe(TimelineService.name, () => {
|
||||||
tagId: 'tag-123',
|
tagId: 'tag-123',
|
||||||
}),
|
}),
|
||||||
).resolves.toEqual(json);
|
).resolves.toEqual(json);
|
||||||
expect(mocks.asset.getTimeBucket).toHaveBeenCalledWith('bucket', {
|
expect(mocks.asset.getTimeBucket).toHaveBeenCalledWith(
|
||||||
tagId: 'tag-123',
|
'bucket',
|
||||||
timeBucket: 'bucket',
|
{
|
||||||
userIds: [authStub.admin.user.id],
|
tagId: 'tag-123',
|
||||||
});
|
timeBucket: 'bucket',
|
||||||
|
userIds: [authStub.admin.user.id],
|
||||||
|
},
|
||||||
|
authStub.admin,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return the assets for a library time bucket if user has library.read', async () => {
|
it('should return the assets for a library time bucket if user has library.read', async () => {
|
||||||
|
|
@ -119,6 +132,7 @@ describe(TimelineService.name, () => {
|
||||||
timeBucket: 'bucket',
|
timeBucket: 'bucket',
|
||||||
userIds: [authStub.admin.user.id],
|
userIds: [authStub.admin.user.id],
|
||||||
}),
|
}),
|
||||||
|
authStub.admin,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue