From c1005b747bd3d673707ea20b4c7718c9a86d4084 Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Sun, 29 Jan 2017 13:51:31 +0200 Subject: [PATCH] #245: cover prompt=consent with tests --- tests/services/authFlow/CompleteState.test.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/services/authFlow/CompleteState.test.js b/tests/services/authFlow/CompleteState.test.js index dbbc468..fdef0be 100644 --- a/tests/services/authFlow/CompleteState.test.js +++ b/tests/services/authFlow/CompleteState.test.js @@ -134,6 +134,25 @@ describe('CompleteState', () => { state.enter(context); }); + + it('should transition to permissions state if prompt=consent', () => { + context.getState.returns({ + user: { + isActive: true, + isGuest: false + }, + auth: { + oauth: { + clientId: 'ely.by', + prompt: ['consent'] + } + } + }); + + expectState(mock, PermissionsState); + + state.enter(context); + }); }); describe('when user completes oauth', () => {