#156: add already have code for register panel

This commit is contained in:
SleepWalker
2016-07-24 11:32:54 +03:00
parent 2a9b83fe15
commit a2e8fbab95
14 changed files with 62 additions and 14 deletions

View File

@@ -133,7 +133,7 @@ describe('AuthFlow.functional', () => {
navigate('/register');
expect(flow.state).to.be.instanceof(RegisterState);
flow.state.reject(flow);
flow.state.reject(flow, {requestEmail: true});
expect(flow.state).to.be.instanceof(ResendActivationState);
flow.state.goBack(flow);

View File

@@ -1,5 +1,6 @@
import RegisterState from 'services/authFlow/RegisterState';
import CompleteState from 'services/authFlow/CompleteState';
import ActivationState from 'services/authFlow/ActivationState';
import ResendActivationState from 'services/authFlow/ResendActivationState';
import { bootstrap, expectState, expectNavigate, expectRun } from './helpers';
@@ -81,10 +82,16 @@ describe('RegisterState', () => {
});
describe('#reject', () => {
it('should transition to activation', () => {
expectState(mock, ActivationState);
state.reject(context, {});
});
it('should transition to resend-activation', () => {
expectState(mock, ResendActivationState);
state.reject(context);
state.reject(context, {requestEmail: true});
});
});
});

View File

@@ -97,6 +97,14 @@ describe('ResendActivationState', () => {
});
});
describe('#reject', () => {
it('should transition to activate state on reject', () => {
expectState(mock, ActivationState);
state.reject(context);
});
});
describe('#goBack', () => {
it('should transition to activation', () => {
expectState(mock, ActivationState);