mirror of
https://github.com/strapi/strapi.git
synced 2025-09-20 05:52:08 +00:00
24 lines
506 B
JavaScript
24 lines
506 B
JavaScript
'use strict';
|
|
|
|
const { sanitizeUser } = require('../user');
|
|
|
|
describe('User', () => {
|
|
describe('sanitizeUser', () => {
|
|
test('Removes password and resetPasswordToken', () => {
|
|
const res = sanitizeUser({
|
|
id: 1,
|
|
firstname: 'Test',
|
|
otherField: 'Hello',
|
|
password: '$5IAZUDB871',
|
|
resetPasswordToken: '3456-5678-6789-789',
|
|
});
|
|
|
|
expect(res).toEqual({
|
|
id: 1,
|
|
firstname: 'Test',
|
|
otherField: 'Hello',
|
|
});
|
|
});
|
|
});
|
|
});
|