This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
2017-11-16 06:56:40 +00:00
|
|
|
/* eslint-disable flowtype/require-valid-file-annotation */
|
2017-07-15 22:14:01 +00:00
|
|
|
import { flushdb, seed } from '../test/support';
|
2016-09-12 00:47:22 +00:00
|
|
|
|
|
|
|
beforeEach(flushdb);
|
|
|
|
|
|
|
|
it('should set JWT secret and password digest', async () => {
|
2017-07-15 22:14:01 +00:00
|
|
|
const { user } = await seed();
|
2016-09-12 00:47:22 +00:00
|
|
|
expect(user.passwordDigest).toBeTruthy();
|
|
|
|
expect(user.getJwtToken()).toBeTruthy();
|
|
|
|
|
|
|
|
expect(await user.verifyPassword('test123!')).toBe(true);
|
|
|
|
expect(await user.verifyPassword('badPasswd')).toBe(false);
|
|
|
|
});
|