Skip to content

Commit

Permalink
Add test for passing organization to checkSession
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikprijck committed Sep 27, 2023
1 parent 9729252 commit c74184a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/web-auth/web-auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3044,6 +3044,22 @@ describe('auth0.WebAuth', function () {
});
this.auth0.checkSession({}, function (err, data) {});
});

it('inits IframeHandler with organization', function (done) {
sinon.stub(IframeHandler.prototype, 'init').callsFake(function () {
expect(this.url).to.be(
'https://me.auth0.com/authorize?client_id=...&response_type=token&redirect_uri=http%3A%2F%2Fpage.com%2Fcallback&organization=org_123&from=transaction-manager&response_mode=web_message&prompt=none'
);
expect(this.eventListenerType).to.be('message');
expect(this.timeout).to.be(60000);
done();
});
this.auth0.checkSession(
{ organization: 'org_123' },
function (err, data) {}
);
});

it('uses custom timeout when provided', function (done) {
var timeout = 1;
sinon.stub(IframeHandler.prototype, 'init').callsFake(function () {
Expand Down

0 comments on commit c74184a

Please sign in to comment.