Files
outline/server/models/User.test.js
Tom Moor ed7aa80a3a WIP
2017-07-15 15:14:01 -07:00

15 lines
403 B
JavaScript

import { flushdb, seed } from '../test/support';
beforeEach(flushdb);
it('should set JWT secret and password digest', async () => {
const { user } = await seed();
await user.save();
expect(user.passwordDigest).toBeTruthy();
expect(user.getJwtToken()).toBeTruthy();
expect(await user.verifyPassword('test123!')).toBe(true);
expect(await user.verifyPassword('badPasswd')).toBe(false);
});