mirror of
https://github.com/immich-app/immich.git
synced 2026-03-04 09:57:33 +03:00
chore: finishing unit tests for a couple of services (#13292)
This commit is contained in:
@@ -16,6 +16,19 @@ describe(SystemMetadataService.name, () => {
|
||||
expect(sut).toBeDefined();
|
||||
});
|
||||
|
||||
describe('getAdminOnboarding', () => {
|
||||
it('should get isOnboarded state', async () => {
|
||||
systemMock.get.mockResolvedValue({ isOnboarded: true });
|
||||
await expect(sut.getAdminOnboarding()).resolves.toEqual({ isOnboarded: true });
|
||||
expect(systemMock.get).toHaveBeenCalledWith('admin-onboarding');
|
||||
});
|
||||
|
||||
it('should default isOnboarded to false', async () => {
|
||||
await expect(sut.getAdminOnboarding()).resolves.toEqual({ isOnboarded: false });
|
||||
expect(systemMock.get).toHaveBeenCalledWith('admin-onboarding');
|
||||
});
|
||||
});
|
||||
|
||||
describe('updateAdminOnboarding', () => {
|
||||
it('should update isOnboarded to true', async () => {
|
||||
await expect(sut.updateAdminOnboarding({ isOnboarded: true })).resolves.toBeUndefined();
|
||||
@@ -27,4 +40,21 @@ describe(SystemMetadataService.name, () => {
|
||||
expect(systemMock.set).toHaveBeenCalledWith(SystemMetadataKey.ADMIN_ONBOARDING, { isOnboarded: false });
|
||||
});
|
||||
});
|
||||
|
||||
describe('getReverseGeocodingState', () => {
|
||||
it('should get reverse geocoding state', async () => {
|
||||
systemMock.get.mockResolvedValue({ lastUpdate: '2024-01-01', lastImportFileName: 'foo.bar' });
|
||||
await expect(sut.getReverseGeocodingState()).resolves.toEqual({
|
||||
lastUpdate: '2024-01-01',
|
||||
lastImportFileName: 'foo.bar',
|
||||
});
|
||||
});
|
||||
|
||||
it('should default reverse geocoding state to null', async () => {
|
||||
await expect(sut.getReverseGeocodingState()).resolves.toEqual({
|
||||
lastUpdate: null,
|
||||
lastImportFileName: null,
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user