chore(web): improve type checking (#2644)

* fix(web): use id instead of assetId

* chore(web): improve type checking

* fix test jobs

* improve type checking and resolve errors
This commit is contained in:
Michel Heusschen
2023-06-02 15:55:08 +02:00
committed by GitHub
parent 47673dd773
commit 9807f76aff
33 changed files with 149 additions and 129 deletions

View File

@@ -1,6 +1,7 @@
import { AlbumResponseDto } from '@api';
import { Sync } from 'factory.ts';
import type { AlbumResponseDto } from '@api';
import { faker } from '@faker-js/faker';
import { Sync } from 'factory.ts';
import { userFactory } from './user-factory';
export const albumFactory = Sync.makeFactory<AlbumResponseDto>({
albumName: Sync.each(() => faker.commerce.product()),
@@ -8,8 +9,10 @@ export const albumFactory = Sync.makeFactory<AlbumResponseDto>({
assetCount: Sync.each((i) => i % 5),
assets: [],
createdAt: Sync.each(() => faker.date.past().toISOString()),
updatedAt: Sync.each(() => faker.date.past().toISOString()),
id: Sync.each(() => faker.datatype.uuid()),
ownerId: Sync.each(() => faker.datatype.uuid()),
owner: userFactory.build(),
shared: false,
sharedUsers: []
});

View File

@@ -0,0 +1,18 @@
import type { UserResponseDto } from '@api';
import { faker } from '@faker-js/faker';
import { Sync } from 'factory.ts';
export const userFactory = Sync.makeFactory<UserResponseDto>({
id: Sync.each(() => faker.datatype.uuid()),
email: Sync.each(() => faker.internet.email()),
firstName: Sync.each(() => faker.name.firstName()),
lastName: Sync.each(() => faker.name.lastName()),
storageLabel: Sync.each(() => faker.random.alphaNumeric()),
profileImagePath: '',
shouldChangePassword: Sync.each(() => faker.datatype.boolean()),
isAdmin: true,
createdAt: Sync.each(() => faker.date.past().toISOString()),
deletedAt: null,
updatedAt: Sync.each(() => faker.date.past().toISOString()),
oauthId: ''
});