From 71c5401f60a80caac64edbee745e1c57b3d4890f Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 13 Dec 2019 14:13:40 -0500 Subject: [PATCH] LP1830391 Angular test spec updates for Hatch store updates The store service now leverages Hatch for workstation storage. Update unit tests which load the store service to also load and propagate the Hatch service. Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/src/app/core/format.spec.ts | 5 ++++- Open-ILS/src/eg2/src/app/core/org.spec.ts | 5 ++++- Open-ILS/src/eg2/src/app/core/store.spec.ts | 5 ++++- .../app/share/validators/patron_barcode_validator.directive.spec.ts | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/core/format.spec.ts b/Open-ILS/src/eg2/src/app/core/format.spec.ts index cd5feaa107..8a4877f1dc 100644 --- a/Open-ILS/src/eg2/src/app/core/format.spec.ts +++ b/Open-ILS/src/eg2/src/app/core/format.spec.ts @@ -9,6 +9,7 @@ import {OrgService} from './org.service'; import {LocaleService} from './locale.service'; import {Location} from '@angular/common'; import {FormatService} from './format.service'; +import {HatchService} from './hatch.service'; import {SpyLocation} from '@angular/common/testing'; import localeArJO from '@angular/common/locales/ar-JO'; import localeCs from '@angular/common/locales/cs'; @@ -26,6 +27,7 @@ describe('FormatService', () => { let evtService: EventService; let storeService: StoreService; let localeService: LocaleService; + let hatchService: HatchService; // tslint:disable-next-line:prefer-const let location: SpyLocation; let service: FormatService; @@ -35,7 +37,8 @@ describe('FormatService', () => { datePipe = new DatePipe('en'); idlService = new IdlService(); evtService = new EventService(); - storeService = new StoreService(null /* CookieService */); + hatchService = new HatchService(); + storeService = new StoreService(null /* CookieService */, hatchService); netService = new NetService(evtService); authService = new AuthService(evtService, netService, storeService); pcrudService = new PcrudService(idlService, netService, authService); diff --git a/Open-ILS/src/eg2/src/app/core/org.spec.ts b/Open-ILS/src/eg2/src/app/core/org.spec.ts index 78c2f26657..90c5ac599f 100644 --- a/Open-ILS/src/eg2/src/app/core/org.spec.ts +++ b/Open-ILS/src/eg2/src/app/core/org.spec.ts @@ -5,6 +5,7 @@ import {AuthService} from './auth.service'; import {PcrudService} from './pcrud.service'; import {StoreService} from './store.service'; import {OrgService} from './org.service'; +import {HatchService} from './hatch.service'; describe('OrgService', () => { let idlService: IdlService; @@ -14,11 +15,13 @@ describe('OrgService', () => { let orgService: OrgService; let evtService: EventService; let storeService: StoreService; + let hatchService: HatchService; beforeEach(() => { idlService = new IdlService(); evtService = new EventService(); - storeService = new StoreService(null /* CookieService */); + hatchService = new HatchService(); + storeService = new StoreService(null /* CookieService */, hatchService); netService = new NetService(evtService); authService = new AuthService(evtService, netService, storeService); pcrudService = new PcrudService(idlService, netService, authService); diff --git a/Open-ILS/src/eg2/src/app/core/store.spec.ts b/Open-ILS/src/eg2/src/app/core/store.spec.ts index ae6c27fbf5..011ecb2c51 100644 --- a/Open-ILS/src/eg2/src/app/core/store.spec.ts +++ b/Open-ILS/src/eg2/src/app/core/store.spec.ts @@ -1,9 +1,12 @@ import {StoreService} from './store.service'; +import {HatchService} from './hatch.service'; describe('StoreService', () => { let service: StoreService; + let hatchService: HatchService; beforeEach(() => { - service = new StoreService(null /* CookieService */); + hatchService = new HatchService(); + service = new StoreService(null /* CookieService */, hatchService); }); it('should set/get a localStorage value', () => { diff --git a/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.spec.ts b/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.spec.ts index 1e1208e0cf..814160355e 100644 --- a/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.spec.ts +++ b/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.spec.ts @@ -4,15 +4,18 @@ import {NetService} from '@eg/core/net.service'; import {AuthService} from '@eg/core/auth.service'; import {EventService} from '@eg/core/event.service'; import {StoreService} from '@eg/core/store.service'; +import {HatchService} from '@eg/core/hatch.service'; let netService: NetService; let authService: AuthService; let evtService: EventService; let storeService: StoreService; +let hatchService: HatchService; beforeEach(() => { evtService = new EventService(); - storeService = new StoreService(null /* CookieService */); + hatchService = new HatchService(); + storeService = new StoreService(null /* CookieService */, hatchService); netService = new NetService(evtService); authService = new AuthService(evtService, netService, storeService); }); -- 2.11.0