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:
Jaime Baez 2022-09-07 12:20:19 +02:00 committed by GitHub
parent 9a471d80f7
commit 645bd8a109
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 9167 additions and 102 deletions

View 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: []
});

View file

@ -0,0 +1 @@
export * from './factories/album-factory';