mirror of
https://github.com/logto-io/logto.git
synced 2025-01-20 21:32:31 -05:00
22 lines
801 B
TypeScript
22 lines
801 B
TypeScript
|
import { ApplicationType } from '@logto/schemas';
|
||
|
|
||
|
import { getApplicationTypeString, buildOidcClientMetadata } from './utils';
|
||
|
|
||
|
describe('oidc utils method', () => {
|
||
|
it('getApplicationTypeString', () => {
|
||
|
expect(getApplicationTypeString(ApplicationType.SPA)).toEqual('web');
|
||
|
expect(getApplicationTypeString(ApplicationType.Native)).toEqual('native');
|
||
|
expect(getApplicationTypeString(ApplicationType.Traditional)).toEqual('web');
|
||
|
});
|
||
|
|
||
|
it('buildOidcClientMetadata', () => {
|
||
|
const metadata = {
|
||
|
redirectUris: ['logto.dev'],
|
||
|
postLogoutRedirectUris: ['logto.dev'],
|
||
|
logoUri: 'logto.pnf',
|
||
|
};
|
||
|
expect(buildOidcClientMetadata()).toEqual({ redirectUris: [], postLogoutRedirectUris: [] });
|
||
|
expect(buildOidcClientMetadata(metadata)).toEqual(metadata);
|
||
|
});
|
||
|
});
|