X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Flib%2Fsession-manager.js;h=16243d732daf04ae6ea7400f137a35752e0af044;hb=HEAD;hp=f0aca6d8e339ad1329d125c340ae47dd4425dea6;hpb=53ef948ea83106e82d55e60d6695a15e94bf725e;p=squeep-authentication-module diff --git a/test/lib/session-manager.js b/test/lib/session-manager.js index f0aca6d..83ccf58 100644 --- a/test/lib/session-manager.js +++ b/test/lib/session-manager.js @@ -1,10 +1,7 @@ -/* eslint-env mocha */ -/* eslint-disable capitalized-comments, sonarjs/no-duplicate-string, sonarjs/no-identical-functions */ - 'use strict'; -const assert = require('assert'); -const sinon = require('sinon'); // eslint-disable-line node/no-unpublished-require +const assert = require('node:assert'); +const sinon = require('sinon'); const SessionManager = require('../../lib/session-manager'); const Enum = require('../../lib/enum'); @@ -25,7 +22,7 @@ describe('SessionManager', function () { appendHeader: sinon.stub(), }; ctx = { - cookie: '', + cookie: {}, params: {}, queryParams: {}, parsedBody: {}, @@ -50,6 +47,8 @@ describe('SessionManager', function () { describe('constructor', function () { it('covers options', function () { delete options.dingus.proxyPrefix; + delete options.authenticator.secureAuthOnly; + options.authenticator.sessionCookieSameSite = 'None'; manager = new SessionManager(stubLogger, stubAuthenticator, options); }); }); // constructor @@ -81,7 +80,7 @@ describe('SessionManager', function () { it('covers', async function () { await manager._sessionCookieClear(res); assert(res.appendHeader.called); - }) + }); }); // _sessionCookieClear describe('getAdminLogin', function () { @@ -406,7 +405,7 @@ describe('SessionManager', function () { beforeEach(function () { state = '4ea7e936-3427-11ec-9f4b-0025905f714a'; me = 'https://example.com/profile'; - authorizationEndpoint = 'https://example.com/auth' + authorizationEndpoint = 'https://example.com/auth'; ctx.cookie = { squeepSession: 'sessionCookie', };