From 7643cee86202d2579834a86e55b482fc92fa347e Mon Sep 17 00:00:00 2001 From: Vivek Kasture <vivek_kasture@techjoomla.com> Date: Wed, 23 Sep 2020 22:03:17 +0530 Subject: [PATCH] Issue #SH-1249 fix: Reverted toast message changes --- .../consent-pii/consent-pii.component.spec.ts | 15 --------------- .../consent-pii/consent-pii.component.ts | 6 +----- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/app/client/src/app/modules/learn/components/course-consumption/consent-pii/consent-pii.component.spec.ts b/src/app/client/src/app/modules/learn/components/course-consumption/consent-pii/consent-pii.component.spec.ts index cdcfedc275..403d9f9735 100644 --- a/src/app/client/src/app/modules/learn/components/course-consumption/consent-pii/consent-pii.component.spec.ts +++ b/src/app/client/src/app/modules/learn/components/course-consumption/consent-pii/consent-pii.component.spec.ts @@ -193,21 +193,6 @@ describe('ConsentPiiComponent', () => { expect(component.getUserConsent).toHaveBeenCalled(); expect(component.showConsentPopup).toBe(false); }); - it('should update User Consent', () => { - const userService = TestBed.get(UserService); - const toastService = TestBed.get(ToasterService); - userService._userProfile = MockData.userProfile; - component.collection = MockData.collection; - const csUserService = TestBed.get('CS_USER_SERVICE'); - spyOn(csUserService, 'updateConsent').and.returnValue(of(MockData.updateConsentResponse)); - spyOn(toastService, 'error'); - spyOn(component, 'getUserConsent'); - component.updateUserConsent(false); - expect(csUserService.updateConsent).toHaveBeenCalled(); - expect(toastService.error).toHaveBeenCalledWith('Your data settings are not submitted!'); - expect(component.getUserConsent).toHaveBeenCalled(); - expect(component.showConsentPopup).toBe(false); - }); it('should not update User Consent', () => { const userService = TestBed.get(UserService); diff --git a/src/app/client/src/app/modules/learn/components/course-consumption/consent-pii/consent-pii.component.ts b/src/app/client/src/app/modules/learn/components/course-consumption/consent-pii/consent-pii.component.ts index cc84749974..0794a28c57 100644 --- a/src/app/client/src/app/modules/learn/components/course-consumption/consent-pii/consent-pii.component.ts +++ b/src/app/client/src/app/modules/learn/components/course-consumption/consent-pii/consent-pii.component.ts @@ -151,11 +151,7 @@ export class ConsentPiiComponent implements OnInit { this.csUserService.updateConsent(request, { apiPath: '/learner/user/v1' }) .pipe(takeUntil(this.unsubscribe)) .subscribe(() => { - if (isActive) { - this.toasterService.success(_.get(this.resourceService, 'messages.smsg.dataSettingSubmitted')); - } else { - this.toasterService.error(_.get(this.resourceService, 'messages.fmsg.dataSettingNotSubmitted')); - } + this.toasterService.success(_.get(this.resourceService, 'messages.smsg.dataSettingSubmitted')); this.getUserConsent(); }, error => { this.toasterService.error(_.get(this.resourceService, 'messages.emsg.m0005')); -- GitLab