refactor: dedicated query for asset migration job (#17631)

This commit is contained in:
Daniel Dietzler
2025-04-15 21:49:15 +02:00
committed by GitHub
parent 26f0ea4cb5
commit 21becbf1b0
6 changed files with 54 additions and 9 deletions
+2 -1
View File
@@ -191,13 +191,14 @@ describe(MediaService.name, () => {
describe('handleAssetMigration', () => {
it('should fail if asset does not exist', async () => {
mocks.assetJob.getForMigrationJob.mockResolvedValue(void 0);
await expect(sut.handleAssetMigration({ id: assetStub.image.id })).resolves.toBe(JobStatus.FAILED);
expect(mocks.move.getByEntity).not.toHaveBeenCalled();
});
it('should move asset files', async () => {
mocks.asset.getByIds.mockResolvedValue([assetStub.image]);
mocks.assetJob.getForMigrationJob.mockResolvedValue(assetStub.image);
mocks.move.create.mockResolvedValue({
entityId: assetStub.image.id,
id: 'move-id',