0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00
logto/packages/connectors/connector-saml/src/utils.test.ts
Gao Sun 6b322a537c
refactor: add connector packages
the initial commit to move all connector packages to the main
repo.
2023-04-01 15:53:14 +08:00

36 lines
805 B
TypeScript

import { userProfileMapping } from './utils.js';
const { jest } = import.meta;
describe('userProfileMapping', () => {
afterEach(() => {
jest.clearAllMocks();
});
it('should return right user profile', () => {
const userProfile = userProfileMapping(
{
sub: 'sub',
cell_phone: 'cell_phone',
phone: 'phone',
email: 'email',
verified_email: 'verified_email',
picture: 'picture.jpg',
full_name: 'full_name',
},
{
id: 'sub',
phone: 'cell_phone',
email: 'verified_email',
avatar: 'picture_url',
name: 'full_name',
}
);
expect(userProfile).toEqual({
id: 'sub',
phone: 'cell_phone',
email: 'verified_email',
name: 'full_name',
});
});
});