From eb251b72148d5b727f680d7d4442572c408e5bf2 Mon Sep 17 00:00:00 2001 From: "Dinesh GUNASEKARAN (ANEO)" Date: Tue, 5 Dec 2023 15:20:29 +0100 Subject: [PATCH] fix: cognitive complexity reduction --- src/app/services/storage.service.spec.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/services/storage.service.spec.ts b/src/app/services/storage.service.spec.ts index 27a2d41cf..648d37ee6 100644 --- a/src/app/services/storage.service.spec.ts +++ b/src/app/services/storage.service.spec.ts @@ -136,9 +136,19 @@ describe('StorageService', () => { it('Should export properly', () => { mockStorage.getItem.mockImplementationOnce((key: Key, parse) => { const result = mockItemData[key]; - if (!parse) return result ? {'12': 'sessions'} : undefined; - else return result ? JSON.stringify({'12': 'sessions'}) : undefined; + if(result) { + if(!parse) { + return {'12': 'sessions'}; + } + else { + return JSON.stringify({'12': 'sessions'}); + } + } + else { + return undefined; + } }); + expect(service.exportData()['navigation-sidebar']) .toEqual({ '0': 'profile',