Adapt local regression tests to new configuration queries

This commit is contained in:
Codex
2026-10-22 20:48:48 +03:00
parent ca4d8d5a7a
commit 9e889bd4dc
3 changed files with 50 additions and 22 deletions
+11
View File
@@ -39,6 +39,17 @@ describe('config visibility', () => {
expect(getKeysDeep(mapUserConfig(defaults))).toEqual(expect.arrayContaining(PUBLIC_PROPERTIES));
});
it('exposes the OAuth account link to users without exposing client secrets or the link publicly', () => {
const config = {
...defaults,
oauth: { ...defaults.oauth, accountManagementUrl: 'https://accounts.example.com', clientSecret: 'private' },
};
expect(mapUserConfig(config).oauth.accountManagementUrl).toBe('https://accounts.example.com');
expect(mapUserConfig(config).oauth).not.toHaveProperty('clientSecret');
expect(mapPublicConfig(config).oauth).not.toHaveProperty('accountManagementUrl');
expect(mapPublicConfig(config).oauth).not.toHaveProperty('clientSecret');
});
it('should accept the defaults with the admin schema', () => {
expect(AdminConfigDto.schema.safeParse(defaults)).toEqual(expect.objectContaining({ success: true }));
});