beforeEach(() => {
idlService = new EgIdlService();
evtService = new EgEventService();
- storeService = new EgStoreService();
+ storeService = new EgStoreService(null /* CookieService */);
netService = new EgNetService(evtService);
authService = new EgAuthService(evtService, netService, storeService);
pcrudService = new EgPcrudService(idlService, netService, authService);
--- /dev/null
+import {EgStoreService} from './store.service';
+
+describe('EgStoreService', () => {
+ let service: EgStoreService;
+ beforeEach(() => {
+ service = new EgStoreService(null /* CookieService */);
+ });
+
+ it('should set/get a localStorage value', () => {
+ const str = 'hello, world';
+ service.setLocalItem('testKey', str);
+ expect(service.getLocalItem('testKey')).toBe(str);
+ });
+
+ it('should set/get a sessionStorage value', () => {
+ const str = 'hello, world again';
+ service.setLocalItem('testKey', str);
+ expect(service.getLocalItem('testKey')).toBe(str);
+ });
+
+});
+