24 lines
506 B
JavaScript
Raw Normal View History

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