mirror of
https://github.com/logto-io/logto.git
synced 2024-12-23 20:33:16 -05:00
37 lines
805 B
TypeScript
37 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',
|
||
|
});
|
||
|
});
|
||
|
});
|