diff --git a/e2e/src/api/specs/album.e2e-spec.ts b/e2e/src/api/specs/album.e2e-spec.ts index b56a464d8c..608cf828dd 100644 --- a/e2e/src/api/specs/album.e2e-spec.ts +++ b/e2e/src/api/specs/album.e2e-spec.ts @@ -113,7 +113,6 @@ describe('/album', () => { updateAlbumUserDto: { role: AlbumUserRole.Editor }, }), ]); - albums[0].albumUsers[0].role = AlbumUserRole.Editor; albums[3].albumUsers[0].role = AlbumUserRole.Editor; albums[6].albumUsers[0].role = AlbumUserRole.Editor; @@ -334,7 +333,7 @@ describe('/album', () => { }); }); - it('should return album info for shared album', async () => { + it('should return album info for shared album (editor)', async () => { const { status, body } = await request(app) .get(`/album/${user2Albums[0].id}?withoutAssets=false`) .set('Authorization', `Bearer ${user1.accessToken}`); @@ -346,6 +345,19 @@ describe('/album', () => { }); }); + it('should return album info for shared album (viewer)', async () => { + const { status, body } = await request(app) + .get(`/album/${user1Albums[3].id}?withoutAssets=false`) + .set('Authorization', `Bearer ${user2.accessToken}`); + + expect(status).toBe(200); + console.log(body); + expect(body).toEqual({ + ...user1Albums[3], + assets: [expect.objectContaining({ id: user2Albums[0].assets[0].id })], + }); + }); + it('should return album info with assets when withoutAssets is undefined', async () => { const { status, body } = await request(app) .get(`/album/${user1Albums[0].id}`)