Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mertalev committed Nov 25, 2024
1 parent 7cbb781 commit b16dfbe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion server/src/services/person.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ describe(PersonService.name, () => {
assetMock.getByIds.mockResolvedValue([assetStub.image]);
await sut.handleDetectFaces({ id: assetStub.image.id });
expect(machineLearningMock.detectFaces).toHaveBeenCalledWith(
'http://immich-machine-learning:3003',
['http://immich-machine-learning:3003'],
'/uploads/user-id/thumbs/path.jpg',
expect.objectContaining({ minScore: 0.7, modelName: 'buffalo_l' }),
);
Expand Down
4 changes: 2 additions & 2 deletions server/src/services/smart-info.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ describe(SmartInfoService.name, () => {
expect(await sut.handleEncodeClip({ id: assetStub.image.id })).toEqual(JobStatus.SUCCESS);

expect(machineLearningMock.encodeImage).toHaveBeenCalledWith(
'http://immich-machine-learning:3003',
['http://immich-machine-learning:3003'],
'/uploads/user-id/thumbs/path.jpg',
expect.objectContaining({ modelName: 'ViT-B-32__openai' }),
);
Expand Down Expand Up @@ -322,7 +322,7 @@ describe(SmartInfoService.name, () => {

expect(databaseMock.wait).toHaveBeenCalledWith(512);
expect(machineLearningMock.encodeImage).toHaveBeenCalledWith(
'http://immich-machine-learning:3003',
['http://immich-machine-learning:3003'],
'/uploads/user-id/thumbs/path.jpg',
expect.objectContaining({ modelName: 'ViT-B-32__openai' }),
);
Expand Down
6 changes: 3 additions & 3 deletions server/src/services/system-config.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const updatedConfig = Object.freeze<SystemConfig>({
},
machineLearning: {
enabled: true,
url: 'http://immich-machine-learning:3003',
url: ['http://immich-machine-learning:3003'],
clip: {
enabled: true,
modelName: 'ViT-B-32__openai',
Expand Down Expand Up @@ -329,11 +329,11 @@ describe(SystemConfigService.name, () => {

it('should allow underscores in the machine learning url', async () => {
configMock.getEnv.mockReturnValue(mockEnvData({ configFile: 'immich-config.json' }));
const partialConfig = { machineLearning: { url: 'immich_machine_learning' } };
const partialConfig = { machineLearning: { url: ['immich_machine_learning'] } };
systemMock.readFile.mockResolvedValue(JSON.stringify(partialConfig));

const config = await sut.getSystemConfig();
expect(config.machineLearning.url).toEqual('immich_machine_learning');
expect(config.machineLearning.url).toEqual(['immich_machine_learning']);
});

const externalDomainTests = [
Expand Down

0 comments on commit b16dfbe

Please sign in to comment.