mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Resend activation from register state
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import RegisterState from 'services/authFlow/RegisterState';
|
||||
import CompleteState from 'services/authFlow/CompleteState';
|
||||
import ResendActivationState from 'services/authFlow/ResendActivationState';
|
||||
|
||||
import { bootstrap, expectState, expectNavigate, expectRun } from './helpers';
|
||||
|
||||
@@ -78,4 +79,12 @@ describe('RegisterState', () => {
|
||||
return promise.catch(mock.verify.bind(mock));
|
||||
});
|
||||
});
|
||||
|
||||
describe('#reject', () => {
|
||||
it('should transition to resend-activation', () => {
|
||||
expectState(mock, ResendActivationState);
|
||||
|
||||
state.reject(context);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import ResendActivationState from 'services/authFlow/ResendActivationState';
|
||||
import CompleteState from 'services/authFlow/CompleteState';
|
||||
import ActivationState from 'services/authFlow/ActivationState';
|
||||
import RegisterState from 'services/authFlow/RegisterState';
|
||||
|
||||
import { bootstrap, expectState, expectNavigate, expectRun } from './helpers';
|
||||
|
||||
@@ -35,6 +36,19 @@ describe('ResendActivationState', () => {
|
||||
state.enter(context);
|
||||
});
|
||||
|
||||
it('should navigate to /resend-activation for guests', () => {
|
||||
context.getState.returns({
|
||||
user: {
|
||||
isGuest: true,
|
||||
isActive: true
|
||||
}
|
||||
});
|
||||
|
||||
expectNavigate(mock, '/resend-activation');
|
||||
|
||||
state.enter(context);
|
||||
});
|
||||
|
||||
it('should transition to complete state if account activated', () => {
|
||||
context.getState.returns({
|
||||
user: {
|
||||
@@ -86,10 +100,28 @@ describe('ResendActivationState', () => {
|
||||
});
|
||||
|
||||
describe('#goBack', () => {
|
||||
it('should transition to resend-activation', () => {
|
||||
it('should transition to activation', () => {
|
||||
context.getState.returns({
|
||||
user: {
|
||||
isGuest: false
|
||||
}
|
||||
});
|
||||
|
||||
expectState(mock, ActivationState);
|
||||
|
||||
state.goBack(context);
|
||||
});
|
||||
|
||||
it('should transition to register if guest', () => {
|
||||
context.getState.returns({
|
||||
user: {
|
||||
isGuest: true
|
||||
}
|
||||
});
|
||||
|
||||
expectState(mock, RegisterState);
|
||||
|
||||
state.goBack(context);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user