Skip to content

Commit

Permalink
fix: cognitive complexity reduction
Browse files Browse the repository at this point in the history
  • Loading branch information
GunaDinesh authored and JulesMaisonneuveAneo committed Dec 8, 2023
1 parent 6869d6d commit eb251b7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/app/services/storage.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit eb251b7

Please sign in to comment.