From ff169708b3c52ea5394abff87a04d92696703052 Mon Sep 17 00:00:00 2001 From: niculescu-bogdan-constantin Date: Mon, 15 Apr 2024 13:12:26 +0200 Subject: [PATCH] fix: code review --- __tests__/identity.js | 5 +---- src/identity.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/__tests__/identity.js b/__tests__/identity.js index daad6c3..0ac7f31 100644 --- a/__tests__/identity.js +++ b/__tests__/identity.js @@ -599,10 +599,7 @@ describe('Identity', () => { const MOCK_TAB_ID = 1234; const spy = jest.spyOn(Identity.prototype, '_getTabId'); spy.mockImplementation(() => MOCK_TAB_ID); - - identity = new Identity(defaultOptions); - identity._sessionService.fetch = getSessionMock; - identity._clearVarnishCookie(); + identity._tabId = MOCK_TAB_ID; await identity.hasSession(); diff --git a/src/identity.js b/src/identity.js index 0e6e6f6..f9b53d3 100644 --- a/src/identity.js +++ b/src/identity.js @@ -234,7 +234,7 @@ export class Identity extends EventEmitter { * Checks if getting session is blocked * @private * - * @returns {number} + * @returns {number/null} */ _isSessionCallBlocked(){ return this.localStorageCache.get(SESSION_CALL_BLOCKED_CACHE_KEY);