refactor(server): split api and jobs into separate e2e suites (#6307)

* refactor: domain and infra modules

* refactor(server): e2e tests
This commit is contained in:
Jason Rasmussen 2024-01-09 23:04:16 -05:00 committed by GitHub
parent e5786b200a
commit bf1dd36fa9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 852 additions and 439 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;
},
};