From 52d7b58d1e6a7ec5d586307efe24425d2b8a5b4d Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Tue, 3 Dec 2024 19:30:53 +0200 Subject: [PATCH 1/3] PER-9916-exiting-onboarding-on-refresh Because of a user having no archive during onboarding, the onboarding process would throw an error each time the page would refresh, loggging the user out. I have fixed that problem and added the current steps of onboarding to the session storage so that the user can continue where they left off after refreshing, but if the tab is closed all the progress is being erased --- src/app/core/guards/auth.guard.ts | 60 ++++++++++++------- .../create-new-archive.component.ts | 47 ++++++++++++++- .../create-archive-for-me-screen.component.ts | 2 + ...-archive-creation-screen.component.spec.ts | 4 +- .../glam-goals-screen.component.spec.ts | 34 ++++++++++- .../glam-goals-screen.component.ts | 12 +++- .../glam-reasons-screen.component.spec.ts | 34 ++++++++++- .../glam-reasons-screen.component.ts | 12 +++- .../name-archive-screen.component.spec.ts | 38 +++++++++++- .../name-archive-screen.component.ts | 30 +++++++++- .../select-archive-type-screen.component.ts | 8 +++ .../guards/onboarding.auth.guard.ts | 1 + .../services/account/account.service.ts | 2 +- 13 files changed, 244 insertions(+), 40 deletions(-) diff --git a/src/app/core/guards/auth.guard.ts b/src/app/core/guards/auth.guard.ts index 6506198d3..e1b84841d 100644 --- a/src/app/core/guards/auth.guard.ts +++ b/src/app/core/guards/auth.guard.ts @@ -1,45 +1,59 @@ import { Injectable } from '@angular/core'; -import { ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; +import { + ActivatedRouteSnapshot, + RouterStateSnapshot, + Router, +} from '@angular/router'; import { Observable } from 'rxjs'; import { AccountService } from '@shared/services/account/account.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) -export class AuthGuard { - constructor (private account: AccountService, private router: Router) {} +export class AuthGuard { + constructor( + private account: AccountService, + private router: Router, + ) {} canActivate( next: ActivatedRouteSnapshot, - state: RouterStateSnapshot - ): Promise { - return this.account.checkSession() - .then((isSessionValid: boolean) => { - if (isSessionValid && this.account.isLoggedIn()) { - return true; - } else { - if (isSessionValid !== this.account.isLoggedIn()) { - this.account.clear(); + state: RouterStateSnapshot, + ): Promise { + return this.account + .checkSession() + .then((isSessionValid: boolean) => { + if (isSessionValid && this.account.isLoggedIn()) { + return true; + } else { + if (isSessionValid !== this.account.isLoggedIn()) { + this.account.clear(); + } + this.router.navigate(['/app', 'auth', 'login'], { + queryParams: next.queryParams, + }); + return false; } - this.router.navigate(['/app', 'auth', 'login'], { queryParams: next.queryParams }); + }) + .catch(() => { + this.account.clear(); + this.router.navigate(['/app', 'auth', 'login'], { + queryParams: next.queryParams, + }); return false; - } - }) - .catch(() => { - this.account.clear(); - this.router.navigate(['/app', 'auth', 'login'], { queryParams: next.queryParams }); - return false; - }); + }); } canActivateChild( next: ActivatedRouteSnapshot, - state: RouterStateSnapshot + state: RouterStateSnapshot, ): Observable | Promise | boolean { if (this.account.isLoggedIn()) { return true; } else { - this.router.navigate(['/app', 'auth', 'login'], { queryParams: next.queryParams }); + this.router.navigate(['/app', 'onboarding'], { + queryParams: next.queryParams, + }); return false; } } diff --git a/src/app/onboarding/components/create-new-archive/create-new-archive.component.ts b/src/app/onboarding/components/create-new-archive/create-new-archive.component.ts index d944ca5d0..822b9f11f 100644 --- a/src/app/onboarding/components/create-new-archive/create-new-archive.component.ts +++ b/src/app/onboarding/components/create-new-archive/create-new-archive.component.ts @@ -101,6 +101,13 @@ export class CreateNewArchiveComponent implements OnInit { if (!this.isGlam) { this.screen = 'create'; } + + const screen = sessionStorage.getItem('onboardingScreen'); + if (screen) { + this.screen = screen as NewArchiveScreen; + } else { + sessionStorage.setItem('onboardingScreen', this.screen); + } } ngOnInit(): void { @@ -119,6 +126,26 @@ export class CreateNewArchiveComponent implements OnInit { entity: 'account', action: 'start_onboarding', }); + + const storageGoals = sessionStorage.getItem('goals'); + if (storageGoals) { + this.selectedGoals = JSON.parse(storageGoals); + } + + const storageReasons = sessionStorage.getItem('reasons'); + if (storageReasons) { + this.selectedReasons = JSON.parse(storageReasons); + } + + const storageName = sessionStorage.getItem('archiveName'); + if (storageName) { + this.name = storageName; + } + + const storageType = sessionStorage.getItem('archiveType'); + if (storageType) { + this.archiveType = storageType; + } } public onBackPress(): void { @@ -132,6 +159,7 @@ export class CreateNewArchiveComponent implements OnInit { this.screen = 'goals'; this.progress.emit(1); } + sessionStorage.setItem('onboardingScreen', this.screen); } public setScreen(screen: NewArchiveScreen): void { @@ -147,6 +175,7 @@ export class CreateNewArchiveComponent implements OnInit { action: action, }); this.screen = screen; + sessionStorage.setItem('onboardingScreen', screen); if (screen === 'reasons') { this.progress.emit(2); this.chartPathClicked.emit(); @@ -250,10 +279,12 @@ export class CreateNewArchiveComponent implements OnInit { if (this.screen === 'goals') { this.screen = 'reasons'; this.progress.emit(2); + sessionStorage.setItem('onboardingScreen', this.screen); this.selectedGoals = []; } else if (this.screen === 'reasons') { this.selectedReasons = []; this.onSubmit(); + sessionStorage.removeItem('onboardingScreen'); } } @@ -264,8 +295,9 @@ export class CreateNewArchiveComponent implements OnInit { private setName(archiveTypeTag: OnboardingTypes): void { switch (archiveTypeTag) { case OnboardingTypes.unsure: - const name = this.accountService.getAccount().fullName; + const name = this.accountService.getAccount()?.fullName; this.name = name; + sessionStorage.setItem('archiveName', name); break; default: this.name = ''; @@ -284,8 +316,10 @@ export class CreateNewArchiveComponent implements OnInit { public handleCreationScreenEvents(event: Record): void { this.archiveTypeTag = event.tag as OnboardingTypes; this.archiveType = event.type; + sessionStorage.setItem('archiveType', this.archiveType); + sessionStorage.setItem('archiveTypeTag', this.archiveTypeTag); this.headerText = event.headerText; - this.screen = event.screen as NewArchiveScreen; + this.setScreen(event.screen as NewArchiveScreen); } public onValueChange(value: { @@ -300,6 +334,7 @@ export class CreateNewArchiveComponent implements OnInit { public navigateToGoals(event: string) { this.name = event; + sessionStorage.setItem('archiveName', this.name); this.setScreen('goals'); } @@ -319,4 +354,12 @@ export class CreateNewArchiveComponent implements OnInit { this.selectedReasons = event.reasons; this.setScreen(event.screen as NewArchiveScreen); } + + private clearSessionStorage(): void { + sessionStorage.removeItem('goals'); + sessionStorage.removeItem('reasons'); + sessionStorage.removeItem('archiveName'); + sessionStorage.removeItem('archiveType'); + sessionStorage.removeItem('archiveTypeTag'); + } } diff --git a/src/app/onboarding/components/glam/create-archive-for-me-screen/create-archive-for-me-screen.component.ts b/src/app/onboarding/components/glam/create-archive-for-me-screen/create-archive-for-me-screen.component.ts index 3542ce528..b01b2fff1 100644 --- a/src/app/onboarding/components/glam/create-archive-for-me-screen/create-archive-for-me-screen.component.ts +++ b/src/app/onboarding/components/glam/create-archive-for-me-screen/create-archive-for-me-screen.component.ts @@ -32,6 +32,8 @@ export class CreateArchiveForMeScreenComponent { this.onboardingService.registerArchive( new ArchiveVO({ fullName: this.name, accessRole: 'access.role.owner' }), ); + sessionStorage.setItem('archiveName', this.name); + sessionStorage.setItem('archiveType', this.TYPE); this.continueOutput.emit({ screen: 'goals', type: this.TYPE, diff --git a/src/app/onboarding/components/glam/finalize-archive-creation-screen/finalize-archive-creation-screen.component.spec.ts b/src/app/onboarding/components/glam/finalize-archive-creation-screen/finalize-archive-creation-screen.component.spec.ts index 2181996b6..319eb1218 100644 --- a/src/app/onboarding/components/glam/finalize-archive-creation-screen/finalize-archive-creation-screen.component.spec.ts +++ b/src/app/onboarding/components/glam/finalize-archive-creation-screen/finalize-archive-creation-screen.component.spec.ts @@ -28,9 +28,9 @@ describe('FinalizeArchiveCreationScreenComponent', () => { }); it('should display the archive name correctly', async () => { - const name = 'Test Archive'; + const name = 'John Doe'; onboardingService.registerArchive(new ArchiveVO({ fullName: name })); - const { find } = await shallow.render(); + const { fixture, find } = await shallow.render(); const archiveNameElement = find('.archive-info p'); expect(archiveNameElement.nativeElement.textContent).toContain( diff --git a/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts b/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts index 8463383bc..bc5cd497a 100644 --- a/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts +++ b/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts @@ -9,6 +9,17 @@ describe('GlamGoalsScreenComponent', () => { beforeEach(async () => { shallow = new Shallow(GlamGoalsScreenComponent, OnboardingModule); + + spyOn(sessionStorage, 'getItem').and.callFake((key) => { + const store = { + goals: JSON.stringify(['Mock Goal']), + }; + return store[key] || null; + }); + + spyOn(sessionStorage, 'setItem').and.callFake((key, value) => { + console.log(`Mock setItem called with key: ${key}, value: ${value}`); + }); }); it('should create', async () => { @@ -23,6 +34,25 @@ describe('GlamGoalsScreenComponent', () => { expect(instance.goals).toEqual(goals); }); + it('should initialize selectedGoals from sessionStorage', async () => { + const { instance } = await shallow.render(); + + expect(sessionStorage.getItem).toHaveBeenCalledWith('goals'); + expect(instance.selectedGoals).toEqual(['Mock Goal']); + }); + + it('should update sessionStorage when addGoal is called', async () => { + const { instance } = await shallow.render(); + const goal = 'Test Goal'; + + instance.addGoal(goal); + + expect(sessionStorage.setItem).toHaveBeenCalledWith( + 'goals', + JSON.stringify(['Mock Goal', 'Test Goal']), + ); + }); + it('should add goal to selectedGoals when addGoal is called', async () => { const { instance } = await shallow.render(); const goal = 'Test Goal'; @@ -46,7 +76,7 @@ describe('GlamGoalsScreenComponent', () => { expect(outputs.goalsOutput.emit).toHaveBeenCalledWith({ screen: 'name-archive', - goals: [], + goals: ['Mock Goal'], }); }); @@ -58,7 +88,7 @@ describe('GlamGoalsScreenComponent', () => { expect(outputs.goalsOutput.emit).toHaveBeenCalledWith({ screen: 'reasons', - goals: [goal], + goals: ['Mock Goal', goal], }); }); }); diff --git a/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.ts b/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.ts index 64dfc2028..4f0faf7e4 100644 --- a/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.ts +++ b/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.ts @@ -1,5 +1,5 @@ /* @format */ -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { goals } from '../../../shared/onboarding-screen'; interface OutputModel { @@ -12,7 +12,7 @@ interface OutputModel { templateUrl: './glam-goals-screen.component.html', styleUrl: './glam-goals-screen.component.scss', }) -export class GlamGoalsScreenComponent { +export class GlamGoalsScreenComponent implements OnInit { public goals = []; @Input() selectedGoals: string[] = []; @Output() goalsOutput = new EventEmitter(); @@ -21,6 +21,13 @@ export class GlamGoalsScreenComponent { this.goals = goals; } + ngOnInit(): void { + const storageGoals = sessionStorage.getItem('goals'); + if (storageGoals) { + this.selectedGoals = JSON.parse(storageGoals); + } + } + backToNameArchive() { this.goalsOutput.emit({ screen: 'name-archive', @@ -40,5 +47,6 @@ export class GlamGoalsScreenComponent { } else { this.selectedGoals.push(goal); } + sessionStorage.setItem('goals', JSON.stringify(this.selectedGoals)); } } diff --git a/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts b/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts index a9cfe4bb6..dff806a36 100644 --- a/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts +++ b/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts @@ -9,6 +9,17 @@ describe('GlamReasonsScreenComponent', () => { beforeEach(async () => { shallow = new Shallow(GlamReasonsScreenComponent, OnboardingModule); + + spyOn(sessionStorage, 'getItem').and.callFake((key) => { + const store = { + reasons: JSON.stringify(['Mock Reason']), + }; + return store[key] || null; + }); + + spyOn(sessionStorage, 'setItem').and.callFake((key, value) => { + console.log(`Mock setItem called with key: ${key}, value: ${value}`); + }); }); it('should create', async () => { @@ -23,6 +34,25 @@ describe('GlamReasonsScreenComponent', () => { expect(instance.reasons).toEqual(reasons); }); + it('should initialize selectedReasons from sessionStorage', async () => { + const { instance } = await shallow.render(); + + expect(sessionStorage.getItem).toHaveBeenCalledWith('reasons'); + expect(instance.selectedReasons).toEqual(['Mock Reason']); + }); + + it('should update sessionStorage when addReason is called', async () => { + const { instance } = await shallow.render(); + const reason = 'Test Reason'; + + instance.addReason(reason); + + expect(sessionStorage.setItem).toHaveBeenCalledWith( + 'reasons', + JSON.stringify(['Mock Reason', 'Test Reason']), + ); + }); + it('should add reason to selectedReasons when addReason is called', async () => { const { instance } = await shallow.render(); const reason = 'Test Reason'; @@ -48,7 +78,7 @@ describe('GlamReasonsScreenComponent', () => { expect(outputs.reasonsEmit.emit).toHaveBeenCalledWith({ screen: 'finalize', - reasons: [reason], + reasons: ['Mock Reason', reason], }); }); @@ -60,7 +90,7 @@ describe('GlamReasonsScreenComponent', () => { expect(outputs.reasonsEmit.emit).toHaveBeenCalledWith({ screen: 'goals', - reasons: [reason], + reasons: ['Mock Reason', reason], }); }); }); diff --git a/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.ts b/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.ts index 728cad988..94642a74b 100644 --- a/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.ts +++ b/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.ts @@ -1,5 +1,5 @@ /* @format */ -import { Component, Output, EventEmitter, Input } from '@angular/core'; +import { Component, Output, EventEmitter, Input, OnInit } from '@angular/core'; import { reasons } from '../../../shared/onboarding-screen'; interface ReasonsEmit { @@ -12,7 +12,7 @@ interface ReasonsEmit { templateUrl: './glam-reasons-screen.component.html', styleUrl: './glam-reasons-screen.component.scss', }) -export class GlamReasonsScreenComponent { +export class GlamReasonsScreenComponent implements OnInit { public reasons = []; @Input() selectedReasons = []; @Output() backToGoalsOutput = new EventEmitter(); @@ -22,6 +22,13 @@ export class GlamReasonsScreenComponent { this.reasons = reasons; } + ngOnInit(): void { + const storageReasons = sessionStorage.getItem('reasons'); + if (storageReasons) { + this.selectedReasons = JSON.parse(storageReasons); + } + } + backToGoals() { this.reasonsEmit.emit({ screen: 'goals', reasons: this.selectedReasons }); } @@ -39,5 +46,6 @@ export class GlamReasonsScreenComponent { } else { this.selectedReasons.push(reason); } + sessionStorage.setItem('reasons', JSON.stringify(this.selectedReasons)); } } diff --git a/src/app/onboarding/components/glam/name-archive-screen/name-archive-screen.component.spec.ts b/src/app/onboarding/components/glam/name-archive-screen/name-archive-screen.component.spec.ts index 9d71eda09..3fcf7ef84 100644 --- a/src/app/onboarding/components/glam/name-archive-screen/name-archive-screen.component.spec.ts +++ b/src/app/onboarding/components/glam/name-archive-screen/name-archive-screen.component.spec.ts @@ -8,12 +8,30 @@ import { NameArchiveScreenComponent } from './name-archive-screen.component'; describe('NameArchiveScreenComponent', () => { let shallow: Shallow; + const mockSessionStorage: { [key: string]: string } = {}; beforeEach(async () => { shallow = new Shallow(NameArchiveScreenComponent, OnboardingModule) .import(ReactiveFormsModule) .provide(OnboardingService) .dontMock(OnboardingService); + + spyOn(sessionStorage, 'getItem').and.callFake((key: string) => { + return mockSessionStorage[key] || null; + }); + spyOn(sessionStorage, 'setItem').and.callFake( + (key: string, value: string) => { + mockSessionStorage[key] = value; + }, + ); + spyOn(sessionStorage, 'removeItem').and.callFake((key: string) => { + delete mockSessionStorage[key]; + }); + + // Clear the mock session storage before each test + Object.keys(mockSessionStorage).forEach( + (key) => delete mockSessionStorage[key], + ); }); it('should create', async () => { @@ -33,7 +51,6 @@ describe('NameArchiveScreenComponent', () => { const { instance } = await shallow.render({ bind: { name: 'Test Archive' }, }); - instance.ngOnInit(); expect(instance.nameForm.controls['archiveName'].value).toBe( 'Test Archive', @@ -105,4 +122,23 @@ describe('NameArchiveScreenComponent', () => { expect(instance.createArchive).toHaveBeenCalled(); }); + + it('should initialize archiveName from sessionStorage if available', async () => { + mockSessionStorage['archiveName'] = 'Stored Archive Name'; + const { instance } = await shallow.render(); + + expect(instance.nameForm.controls['archiveName'].value).toBe( + 'Stored Archive Name', + ); + }); + + it('should update sessionStorage when archiveName value changes', async () => { + const { instance } = await shallow.render(); + instance.nameForm.controls['archiveName'].setValue('Updated Archive Name'); + + expect(sessionStorage.setItem).toHaveBeenCalledWith( + 'archiveName', + 'Updated Archive Name', + ); + }); }); diff --git a/src/app/onboarding/components/glam/name-archive-screen/name-archive-screen.component.ts b/src/app/onboarding/components/glam/name-archive-screen/name-archive-screen.component.ts index 9ccc02310..bcb3ca889 100644 --- a/src/app/onboarding/components/glam/name-archive-screen/name-archive-screen.component.ts +++ b/src/app/onboarding/components/glam/name-archive-screen/name-archive-screen.component.ts @@ -1,25 +1,33 @@ /* @format */ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { + Component, + EventEmitter, + Input, + OnDestroy, + OnInit, + Output, +} from '@angular/core'; import { UntypedFormBuilder, UntypedFormGroup, Validators, } from '@angular/forms'; -import { AccessRole } from '@models/access-role'; import { ArchiveVO } from '@models/index'; import { OnboardingService } from '@root/app/onboarding/services/onboarding.service'; +import { Subscription } from 'rxjs'; @Component({ selector: 'pr-name-archive-screen', templateUrl: './name-archive-screen.component.html', styleUrl: './name-archive-screen.component.scss', }) -export class NameArchiveScreenComponent implements OnInit { +export class NameArchiveScreenComponent implements OnInit, OnDestroy { public nameForm: UntypedFormGroup; @Input() name = ''; @Output() backToCreateEmitter = new EventEmitter(); @Output() archiveCreatedEmitter = new EventEmitter(); + private nameSubscription: Subscription; constructor( private fb: UntypedFormBuilder, @@ -31,7 +39,23 @@ export class NameArchiveScreenComponent implements OnInit { } ngOnInit(): void { + const storageName = sessionStorage.getItem('archiveName'); + if (storageName) { + this.name = storageName; + } this.nameForm.patchValue({ archiveName: this.name }); + + this.nameSubscription = this.nameForm + .get('archiveName') + .valueChanges.subscribe((value) => { + sessionStorage.setItem('archiveName', value); + }); + } + + ngOnDestroy(): void { + if (this.nameSubscription) { + this.nameSubscription.unsubscribe(); + } } public backToCreate(): void { diff --git a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts index ac6cd60a4..792f10ad3 100644 --- a/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts +++ b/src/app/onboarding/components/glam/select-archive-type-screen/select-archive-type-screen.component.ts @@ -22,6 +22,14 @@ export class SelectArchiveTypeScreenComponent implements OnInit { @Output() submitEmitter = new EventEmitter>(); ngOnInit(): void { + const storageTag = sessionStorage.getItem('archiveTypeTag'); + const storageType = sessionStorage.getItem('archiveType'); + + if (storageTag && storageType) { + this.tag = storageTag; + this.type = storageType; + } + if (this.tag) { this.buttonText = generateElementText( this.tag, diff --git a/src/app/onboarding/guards/onboarding.auth.guard.ts b/src/app/onboarding/guards/onboarding.auth.guard.ts index f69ef6bc4..001bf1944 100644 --- a/src/app/onboarding/guards/onboarding.auth.guard.ts +++ b/src/app/onboarding/guards/onboarding.auth.guard.ts @@ -24,6 +24,7 @@ export class OnboardingAuthGuard { } return true; }); + } return this.router.parseUrl('/app/auth'); } diff --git a/src/app/shared/services/account/account.service.ts b/src/app/shared/services/account/account.service.ts index bf2f0136c..412e99c35 100644 --- a/src/app/shared/services/account/account.service.ts +++ b/src/app/shared/services/account/account.service.ts @@ -210,7 +210,7 @@ export class AccountService { const account = this.getStorage('account'); newAccount.keepLoggedIn = account?.keepLoggedIn; this.account.update(newAccount); - this.archive.update(newArchive); + this.archive?.update(newArchive); this.setStorage(newAccount.keepLoggedIn, ARCHIVE_KEY, this.archive); } else { throw loggedIn; From 7477bcb256245b9f4d6da7ae3ce4f1bc7b071a52 Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Tue, 10 Dec 2024 10:57:00 +0200 Subject: [PATCH 2/3] remove console logs --- .../glam/glam-goals-screen/glam-goals-screen.component.spec.ts | 1 - .../glam-reasons-screen/glam-reasons-screen.component.spec.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts b/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts index bc5cd497a..29f01be36 100644 --- a/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts +++ b/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts @@ -18,7 +18,6 @@ describe('GlamGoalsScreenComponent', () => { }); spyOn(sessionStorage, 'setItem').and.callFake((key, value) => { - console.log(`Mock setItem called with key: ${key}, value: ${value}`); }); }); diff --git a/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts b/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts index dff806a36..345df7d14 100644 --- a/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts +++ b/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts @@ -18,7 +18,6 @@ describe('GlamReasonsScreenComponent', () => { }); spyOn(sessionStorage, 'setItem').and.callFake((key, value) => { - console.log(`Mock setItem called with key: ${key}, value: ${value}`); }); }); From 1f86c99d68c69ef6d0381577c263d2fc2a05edec Mon Sep 17 00:00:00 2001 From: crisnicandrei <62384997+crisnicandrei@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:00:58 +0200 Subject: [PATCH 3/3] prettier --- .../glam/glam-goals-screen/glam-goals-screen.component.spec.ts | 3 +-- .../glam-reasons-screen/glam-reasons-screen.component.spec.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts b/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts index 29f01be36..13d3c8741 100644 --- a/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts +++ b/src/app/onboarding/components/glam/glam-goals-screen/glam-goals-screen.component.spec.ts @@ -17,8 +17,7 @@ describe('GlamGoalsScreenComponent', () => { return store[key] || null; }); - spyOn(sessionStorage, 'setItem').and.callFake((key, value) => { - }); + spyOn(sessionStorage, 'setItem').and.callFake((key, value) => {}); }); it('should create', async () => { diff --git a/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts b/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts index 345df7d14..b97a64969 100644 --- a/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts +++ b/src/app/onboarding/components/glam/glam-reasons-screen/glam-reasons-screen.component.spec.ts @@ -17,8 +17,7 @@ describe('GlamReasonsScreenComponent', () => { return store[key] || null; }); - spyOn(sessionStorage, 'setItem').and.callFake((key, value) => { - }); + spyOn(sessionStorage, 'setItem').and.callFake((key, value) => {}); }); it('should create', async () => {