refactor(server): e2e (#6632)

This commit is contained in:
Jason Rasmussen 2024-01-24 17:24:53 -05:00 committed by GitHub
parent 4424f3cb13
commit 852effa998
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 154 additions and 485 deletions

View file

@ -0,0 +1,20 @@
import { SharedLinkCreateDto, SharedLinkResponseDto } from '@app/domain';
import request from 'supertest';
export const sharedLinkApi = {
create: async (server: any, accessToken: string, dto: SharedLinkCreateDto) => {
const { status, body } = await request(server)
.post('/shared-link')
.set('Authorization', `Bearer ${accessToken}`)
.send(dto);
expect(status).toBe(201);
return body as SharedLinkResponseDto;
},
getMySharedLink: async (server: any, key: string) => {
const { status, body } = await request(server).get('/shared-link/me').query({ key });
expect(status).toBe(200);
return body as SharedLinkResponseDto;
},
};