mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Add web test setup (#597)
* Extract logic from Albums page - move "albums" page logic to `albums-bloc` - add types to AlbumCard custom events * Implement some album-bloc unit-tests - add libraries for testing - add album factory - changes in albums-bloc API * Add rest of albums-bloc test Cleanup and remove console logs * Refactor `isShowContextMenu` writable to derived
This commit is contained in:
parent
9a471d80f7
commit
645bd8a109
11 changed files with 9167 additions and 102 deletions
15
web/src/test-data/factories/album-factory.ts
Normal file
15
web/src/test-data/factories/album-factory.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { AlbumResponseDto } from '@api';
|
||||
import { Sync } from 'factory.ts';
|
||||
import { faker } from '@faker-js/faker';
|
||||
|
||||
export const albumFactory = Sync.makeFactory<AlbumResponseDto>({
|
||||
albumName: Sync.each(() => faker.commerce.product()),
|
||||
albumThumbnailAssetId: null,
|
||||
assetCount: Sync.each((i) => i % 5),
|
||||
assets: [],
|
||||
createdAt: Sync.each(() => faker.date.past().toISOString()),
|
||||
id: Sync.each(() => faker.datatype.uuid()),
|
||||
ownerId: Sync.each(() => faker.datatype.uuid()),
|
||||
shared: false,
|
||||
sharedUsers: []
|
||||
});
|
||||
1
web/src/test-data/index.ts
Normal file
1
web/src/test-data/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './factories/album-factory';
|
||||
Loading…
Add table
Add a link
Reference in a new issue