mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 11:36:05 +00:00
Managed mode: keep the admin settings and addons ratchets green
- The phone's OIDC card moves into MAdminOidcCard, so the settings section is back within its complexity limit after the managed-mode conditions. - enabledPhotoProviderIds reads the enabled ids straight from the repository and has a test of its own, which brings the addons coverage back to its threshold.
This commit is contained in:
@@ -117,7 +117,7 @@ export class AddonsService {
|
||||
/** The photo providers users can connect: none while the journey addon is off. */
|
||||
async enabledPhotoProviderIds(): Promise<string[]> {
|
||||
if (!(await this.isAddonEnabled(ADDON_IDS.JOURNEY))) return [];
|
||||
return (await this.photoProviders.listEnabled()).flatMap((row) => (row.id ? [row.id] : []));
|
||||
return this.photoProviders.listEnabledIds();
|
||||
}
|
||||
|
||||
/** wanderer may be used: Tours is on and the admin allowed it under Tours. */
|
||||
|
||||
@@ -375,6 +375,15 @@ describe('AddonsService.list', () => {
|
||||
expect(listSpy).not.toHaveBeenCalled();
|
||||
listSpy.mockRestore();
|
||||
});
|
||||
|
||||
it('names the photo providers users can connect: the enabled ones, none while the journey addon is off', async () => {
|
||||
await insertProvider({ id: 'immich', name: 'Immich', icon: 'image', enabled: 1 });
|
||||
await insertProvider({ id: 'off-provider', name: 'Off', icon: 'image', enabled: 0 });
|
||||
expect(await svc.enabledPhotoProviderIds()).toEqual([]);
|
||||
|
||||
stubJourneyEnabled();
|
||||
expect(await svc.enabledPhotoProviderIds()).toEqual(['immich']);
|
||||
});
|
||||
});
|
||||
|
||||
// Direct coverage of the enablement reads/writers relocated from
|
||||
|
||||
Reference in New Issue
Block a user