Browse Source

fixed tests

mertalev 1 year ago
parent
commit
57fd3a32f3

+ 6 - 4
server/src/domain/smart-info/smart-info.service.spec.ts

@@ -195,10 +195,12 @@ describe(SmartInfoService.name, () => {
         { imagePath: 'path/to/resize.ext' },
         { enabled: true, modelName: 'ViT-B-32__openai' },
       );
-      expect(smartMock.upsert).toHaveBeenCalledWith({
-        assetId: 'asset-1',
-        clipEmbedding: [0.01, 0.02, 0.03],
-      });
+      expect(smartMock.upsert).toHaveBeenCalledWith(
+        {
+          assetId: 'asset-1',
+        },
+        [0.01, 0.02, 0.03],
+      );
     });
   });
 });

+ 0 - 1
server/test/fixtures/shared-link.stub.ts

@@ -209,7 +209,6 @@ export const sharedLinkStub = {
             tags: [],
             objects: ['a', 'b', 'c'],
             asset: null as any,
-            clipEmbedding: [0.12, 0.13, 0.14],
           },
           webpPath: '',
           thumbhash: null,

+ 1 - 0
server/test/repositories/asset.repository.mock.ts

@@ -32,6 +32,7 @@ export const newAssetRepositoryMock = (): jest.Mocked<IAssetRepository> => {
     getTimeBuckets: jest.fn(),
     restoreAll: jest.fn(),
     softDeleteAll: jest.fn(),
+    search: jest.fn(),
     getAssetIdByCity: jest.fn(),
     getAssetIdByTag: jest.fn(),
     searchMetadata: jest.fn(),