chore(server): shared link e2e for add/remove assets (#5052)

This commit is contained in:
Jason Rasmussen 2023-11-15 18:50:55 -05:00 committed by GitHub
parent 69030ea9a7
commit 87f02cc775
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 112 additions and 49 deletions

View file

@ -6,12 +6,20 @@ import request from 'supertest';
type UploadDto = Partial<CreateAssetDto> & { content?: Buffer };
const asset = {
deviceAssetId: 'test-1',
deviceId: 'test',
fileCreatedAt: new Date(),
fileModifiedAt: new Date(),
};
export const assetApi = {
create: async (
server: any,
accessToken: string,
dto: Omit<CreateAssetDto, 'assetData'>,
dto?: Omit<CreateAssetDto, 'assetData'>,
): Promise<AssetResponseDto> => {
dto = dto || asset;
const { status, body } = await request(server)
.post(`/asset/upload`)
.field('deviceAssetId', dto.deviceAssetId)