0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-25 02:31:59 -05:00

Fixed MagicLink tests

no-issue

The JWTTokenProvider is now exported from the index
This commit is contained in:
Fabien O'Carroll 2020-09-18 13:21:46 +01:00
parent 97ceb13d42
commit 9c093c6beb

View file

@ -1,7 +1,6 @@
const should = require('should'); const should = require('should');
const sinon = require('sinon'); const sinon = require('sinon');
const MagicLink = require('../'); const MagicLink = require('../');
const JWTTokenProvider = require('../JWTTokenProvider');
const crypto = require('crypto'); const crypto = require('crypto');
const sandbox = sinon.createSandbox(); const sandbox = sinon.createSandbox();
@ -15,7 +14,7 @@ describe('MagicLink', function () {
describe('#sendMagicLink', function () { describe('#sendMagicLink', function () {
it('Sends an email to the user with a link generated from getSigninURL(token, type)', async function () { it('Sends an email to the user with a link generated from getSigninURL(token, type)', async function () {
const options = { const options = {
tokenProvider: new JWTTokenProvider(secret), tokenProvider: new MagicLink.JWTTokenProvider(secret),
getSigninURL: sandbox.stub().returns('FAKEURL'), getSigninURL: sandbox.stub().returns('FAKEURL'),
getText: sandbox.stub().returns('SOMETEXT'), getText: sandbox.stub().returns('SOMETEXT'),
getHTML: sandbox.stub().returns('SOMEHTML'), getHTML: sandbox.stub().returns('SOMEHTML'),