2017-05-22 03:45:54 +07:00
|
|
|
|
|
|
|
import sinon = require("sinon");
|
2017-07-16 19:55:01 +07:00
|
|
|
import { IdentityValidable } from "../../../../src/server/lib/IdentityCheckMiddleware";
|
2017-05-22 03:45:54 +07:00
|
|
|
import express = require("express");
|
|
|
|
import BluebirdPromise = require("bluebird");
|
2017-07-16 19:55:01 +07:00
|
|
|
import { Identity } from "../../../../src/types/Identity";
|
2017-05-22 03:45:54 +07:00
|
|
|
|
|
|
|
|
|
|
|
export interface IdentityValidableMock {
|
|
|
|
challenge: sinon.SinonStub;
|
2017-05-25 20:09:29 +07:00
|
|
|
preValidationInit: sinon.SinonStub;
|
|
|
|
preValidationResponse: sinon.SinonStub | sinon.SinonSpy;
|
|
|
|
postValidationInit: sinon.SinonStub;
|
|
|
|
postValidationResponse: sinon.SinonStub | sinon.SinonSpy;
|
2017-05-22 03:45:54 +07:00
|
|
|
mailSubject: sinon.SinonStub;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function IdentityValidableMock() {
|
|
|
|
return {
|
|
|
|
challenge: sinon.stub(),
|
2017-05-25 20:09:29 +07:00
|
|
|
preValidationInit: sinon.stub(),
|
|
|
|
preValidationResponse: sinon.stub(),
|
|
|
|
postValidationInit: sinon.stub(),
|
|
|
|
postValidationResponse: sinon.stub(),
|
2017-05-22 03:45:54 +07:00
|
|
|
mailSubject: sinon.stub()
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IdentityValidatorMock {
|
|
|
|
consume_token: sinon.SinonStub;
|
|
|
|
issue_token: sinon.SinonStub;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function IdentityValidatorMock() {
|
|
|
|
return {
|
|
|
|
consume_token: sinon.stub(),
|
|
|
|
issue_token: sinon.stub()
|
|
|
|
};
|
|
|
|
}
|