0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00
logto/packages/core/src/oidc/utils.test.ts

22 lines
801 B
TypeScript
Raw Normal View History

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);
});
});