Adapt local regression tests to new configuration queries
This commit is contained in:
@@ -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 }));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user