mirror of
https://github.com/bpatrik/pigallery2.git
synced 2026-06-20 00:15:49 +02:00
trying to make mysql tests a bit less flaky
This commit is contained in:
+3
-3
@@ -7,7 +7,7 @@ import {
|
||||
import {PhotoEntity, PhotoMetadataEntity} from '../src/backend/model/database/enitites/PhotoEntity';
|
||||
import {DirectoryEntity} from '../src/backend/model/database/enitites/DirectoryEntity';
|
||||
import {VideoEntity, VideoMetadataEntity} from '../src/backend/model/database/enitites/VideoEntity';
|
||||
import {MediaDimension, MediaDTO} from '../src/common/entities/MediaDTO';
|
||||
import {MediaDimension, MediaDTO, RatingTypes} from '../src/common/entities/MediaDTO';
|
||||
import {
|
||||
CameraMetadata,
|
||||
CoverPhotoDTO,
|
||||
@@ -363,7 +363,7 @@ export class TestHelper {
|
||||
return f;
|
||||
}
|
||||
|
||||
public static getRandomizedPhotoEntry(dir: DirectoryBaseDTO, forceStr: string = null, faces = 2, rating?: number): PhotoDTO {
|
||||
public static getRandomizedPhotoEntry(dir: DirectoryBaseDTO, forceStr: string = null, faces = 2, rating?: RatingTypes): PhotoDTO {
|
||||
|
||||
|
||||
const rndStr = (): string => {
|
||||
@@ -407,7 +407,7 @@ export class TestHelper {
|
||||
creationDateOffset: '+01:00',
|
||||
fileSize: rndInt(10000),
|
||||
caption: rndStr(),
|
||||
rating: rating ?? rndInt(5) as any
|
||||
...(!isNaN(rating) && {rating})
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -611,8 +611,8 @@ describe('IndexingManager', (sqlHelper: DBTestHelper) => {
|
||||
const session = DBTestHelper.defaultSession;
|
||||
|
||||
const parent = TestHelper.getRandomizedDirectoryEntry();
|
||||
const p1 = TestHelper.getRandomizedPhotoEntry(parent, 'Photo1');
|
||||
const p2 = TestHelper.getRandomizedPhotoEntry(parent, 'Photo2');
|
||||
const p1 = TestHelper.getRandomizedPhotoEntry(parent, 'Photo1', 2, 3);
|
||||
const p2 = TestHelper.getRandomizedPhotoEntry(parent, 'Photo2', 2, 4);
|
||||
|
||||
DirectoryDTOUtils.removeReferences(parent);
|
||||
await im.saveToDB(Utils.clone(parent) as ParentDirectoryDTO);
|
||||
|
||||
Reference in New Issue
Block a user