mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
21 lines
520 B
TypeScript
21 lines
520 B
TypeScript
|
import { User } from '@db/entities/User';
|
||
|
|
||
|
describe('User Entity', () => {
|
||
|
describe('JSON.stringify', () => {
|
||
|
it('should not serialize sensitive data', () => {
|
||
|
const user = Object.assign(new User(), {
|
||
|
email: 'test@example.com',
|
||
|
firstName: 'Don',
|
||
|
lastName: 'Joe',
|
||
|
password: '123456789',
|
||
|
apiKey: '123',
|
||
|
mfaSecret: '123',
|
||
|
mfaRecoveryCodes: ['123'],
|
||
|
});
|
||
|
expect(JSON.stringify(user)).toEqual(
|
||
|
'{"email":"test@example.com","firstName":"Don","lastName":"Joe"}',
|
||
|
);
|
||
|
});
|
||
|
});
|
||
|
});
|