Skip to content

Commit

Permalink
added login steps
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmnd committed Sep 14, 2016
1 parent be2ca32 commit e7ea56d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test-e2e-gherkin/steps/client-definition-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ module.exports = function () {
clients[ client ].client.login( {
username: username,
password: password
}, () => {
clients[ client ].login.apply(arguments);
console.log('login response', arguments);
}, ( success, data ) => {
clients[ client ].login( success, data );
console.log( 'login response', success, data );
done();
} );
});
Expand All @@ -79,6 +79,14 @@ module.exports = function () {
} );
} );

this.Then(/^(?:subscriber|publisher|client) (\S*) is notified of too many login attempts$/, ( client ) => {
const loginSpy = clients[ client ].login;
sinon.assert.callCount( loginSpy, 2 );
sinon.assert.calledWith( loginSpy, false, undefined );
sinon.assert.calledWith( loginSpy, false, 'too many authentication attempts' );
loginSpy.reset();
});

this.Then(/^(?:subscriber|publisher|client) (\S*) receives (no|an (un)?authenticated) login response$/, ( client, no, unauth ) => {
const loginSpy = clients[ client ].login;
if ( no.match(/^no$/) ) {
Expand Down

0 comments on commit e7ea56d

Please sign in to comment.