mirror of
https://github.com/immich-app/immich.git
synced 2025-11-22 03:50:50 +09:00
refactor(server): e2e (#6632)
This commit is contained in:
16
server/e2e/client/api-key-api.ts
Normal file
16
server/e2e/client/api-key-api.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { APIKeyCreateResponseDto } from '@app/domain';
|
||||
import { apiKeyCreateStub } from '@test';
|
||||
import request from 'supertest';
|
||||
|
||||
export const apiKeyApi = {
|
||||
createApiKey: async (server: any, accessToken: string) => {
|
||||
const { status, body } = await request(server)
|
||||
.post('/api-key')
|
||||
.set('Authorization', `Bearer ${accessToken}`)
|
||||
.send(apiKeyCreateStub);
|
||||
|
||||
expect(status).toBe(201);
|
||||
|
||||
return body as APIKeyCreateResponseDto;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user