mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor: asset e2e (#7769)
This commit is contained in:
parent
8eb9dad989
commit
30b0b2474e
18 changed files with 852 additions and 1617 deletions
|
|
@ -1,12 +1,4 @@
|
|||
import {
|
||||
CreateLibraryDto,
|
||||
LibraryResponseDto,
|
||||
LibraryStatsResponseDto,
|
||||
ScanLibraryDto,
|
||||
UpdateLibraryDto,
|
||||
ValidateLibraryDto,
|
||||
ValidateLibraryResponseDto,
|
||||
} from '@app/domain';
|
||||
import { CreateLibraryDto, LibraryResponseDto, ScanLibraryDto } from '@app/domain';
|
||||
import request from 'supertest';
|
||||
|
||||
export const libraryApi = {
|
||||
|
|
@ -38,34 +30,4 @@ export const libraryApi = {
|
|||
.send(dto);
|
||||
expect(status).toBe(204);
|
||||
},
|
||||
removeOfflineFiles: async (server: any, accessToken: string, id: string) => {
|
||||
const { status } = await request(server)
|
||||
.post(`/library/${id}/removeOffline`)
|
||||
.set('Authorization', `Bearer ${accessToken}`)
|
||||
.send();
|
||||
expect(status).toBe(204);
|
||||
},
|
||||
getLibraryStatistics: async (server: any, accessToken: string, id: string): Promise<LibraryStatsResponseDto> => {
|
||||
const { body, status } = await request(server)
|
||||
.get(`/library/${id}/statistics`)
|
||||
.set('Authorization', `Bearer ${accessToken}`);
|
||||
expect(status).toBe(200);
|
||||
return body;
|
||||
},
|
||||
update: async (server: any, accessToken: string, id: string, data: UpdateLibraryDto) => {
|
||||
const { body, status } = await request(server)
|
||||
.put(`/library/${id}`)
|
||||
.set('Authorization', `Bearer ${accessToken}`)
|
||||
.send(data);
|
||||
expect(status).toBe(200);
|
||||
return body as LibraryResponseDto;
|
||||
},
|
||||
validate: async (server: any, accessToken: string, id: string, data: ValidateLibraryDto) => {
|
||||
const { body, status } = await request(server)
|
||||
.post(`/library/${id}/validate`)
|
||||
.set('Authorization', `Bearer ${accessToken}`)
|
||||
.send(data);
|
||||
expect(status).toBe(200);
|
||||
return body as ValidateLibraryResponseDto;
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue