From c74184ac3e9c22aba977bc672db8753416b31949 Mon Sep 17 00:00:00 2001 From: frederikprijck Date: Wed, 27 Sep 2023 15:58:12 +0200 Subject: [PATCH] Add test for passing organization to checkSession --- test/web-auth/web-auth.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/web-auth/web-auth.test.js b/test/web-auth/web-auth.test.js index 96f7b436..69af33a3 100644 --- a/test/web-auth/web-auth.test.js +++ b/test/web-auth/web-auth.test.js @@ -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 () {