diff --git a/src/app/core/services/app-version.service.spec.ts b/src/app/core/services/app-version.service.spec.ts index 27f2d203ad..c3e320ab6c 100644 --- a/src/app/core/services/app-version.service.spec.ts +++ b/src/app/core/services/app-version.service.spec.ts @@ -19,7 +19,7 @@ describe('AppVersionService', () => { beforeEach(() => { const apiServiceSpy = jasmine.createSpyObj('ApiService', ['get', 'post']); - const authServiceSpy = jasmine.createSpyObj('AuthService', ['getEou']); + const authServiceSpy = jasmine.createSpyObj('AuthService', ['getEou', 'refreshEou']); const routerApiServiceSpy = jasmine.createSpyObj('RouterApiService', ['post']); const loginInfoServiceSpy = jasmine.createSpyObj('LoginInfoService', ['getLastLoggedInVersion']); TestBed.configureTestingModule({ @@ -161,14 +161,14 @@ describe('AppVersionService', () => { beforeEach(() => { spyOn(appVersionService, 'isSupported').and.returnValue(of({ supported: true })); loginInfoService.getLastLoggedInVersion.and.returnValue(of('5.50.0')); - authService.getEou.and.resolveTo(apiEouRes); + authService.refreshEou.and.returnValue(of(apiEouRes)); }); it("getUserAppVersionDetails(): should get user's app version details", (done) => { appVersionService.getUserAppVersionDetails(extendedDeviceInfoMockData).subscribe(() => { expect(appVersionService.isSupported).toHaveBeenCalledOnceWith(extendedDeviceInfoMockData); expect(loginInfoService.getLastLoggedInVersion).toHaveBeenCalledTimes(1); - expect(authService.getEou).toHaveBeenCalledTimes(1); + expect(authService.refreshEou).toHaveBeenCalledTimes(1); }); done(); }); @@ -178,7 +178,7 @@ describe('AppVersionService', () => { appVersionService.getUserAppVersionDetails(extendedDeviceInfoMockData).subscribe(() => { expect(appVersionService.isSupported).toHaveBeenCalledOnceWith(extendedDeviceInfoMockData); expect(loginInfoService.getLastLoggedInVersion).toHaveBeenCalledTimes(1); - expect(authService.getEou).toHaveBeenCalledTimes(1); + expect(authService.refreshEou).toHaveBeenCalledTimes(1); }); done(); }); diff --git a/src/app/core/services/app-version.service.ts b/src/app/core/services/app-version.service.ts index d6f327f78a..a7f6bf245c 100644 --- a/src/app/core/services/app-version.service.ts +++ b/src/app/core/services/app-version.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { filter, map, switchMap } from 'rxjs/operators'; import { ApiService } from './api.service'; -import { forkJoin, noop, of, from, Observable } from 'rxjs'; +import { forkJoin, noop, of, Observable } from 'rxjs'; import { RouterApiService } from './router-api.service'; import { AppVersion } from '../models/app_version.model'; import { environment } from 'src/environments/environment'; @@ -81,7 +81,7 @@ export class AppVersionService { return forkJoin({ appSupportDetails: this.isSupported(deviceInfo), lastLoggedInVersion: this.loginInfoService.getLastLoggedInVersion(), - eou: from(this.authService.getEou()), + eou: this.authService.refreshEou(), }).pipe( filter( (appVersionDetails: {