diff --git a/alfa-client/libs/tech-shared/src/lib/resource/list-resource.service.spec.ts b/alfa-client/libs/tech-shared/src/lib/resource/list-resource.service.spec.ts index fd9d99e0604f8e8e14a482821bd5c025a407831d..5238a23c74cd94b4b5a4004bcc2d46e7b7eb3e18 100644 --- a/alfa-client/libs/tech-shared/src/lib/resource/list-resource.service.spec.ts +++ b/alfa-client/libs/tech-shared/src/lib/resource/list-resource.service.spec.ts @@ -85,23 +85,23 @@ describe('ListResourceService', () => { isInvalidResourceCombinationSpy = jest.spyOn(ResourceUtil, 'isInvalidResourceCombination').mockReturnValue(true); }); - it('should handle config resource changed after debounce time', fakeAsync(() => { + it('should handle config resource changed', fakeAsync(() => { service.getList().subscribe(); - tick(300); + tick(); expect(service.handleChanges).toHaveBeenCalledWith(listStateResource, baseResource); })); - it('should handle null configresource after debounce time', fakeAsync(() => { + it('should handle null configresource', fakeAsync(() => { service.getList().subscribe(); - tick(300); + tick(); expect(service.handleNullConfigResource).toHaveBeenCalledWith(baseResource); })); - it('should call isInvalidResourceCombinationSpy after debounce time', fakeAsync(() => { + it('should call isInvalidResourceCombinationSpy', fakeAsync(() => { service.getList().subscribe(); - tick(300); + tick(); expect(isInvalidResourceCombinationSpy).toHaveBeenCalled(); })); diff --git a/alfa-client/libs/tech-shared/src/lib/resource/list-resource.service.ts b/alfa-client/libs/tech-shared/src/lib/resource/list-resource.service.ts index 52668215e40c661256f37fa78ee4ff7da7d96a62..8dba0ba6790fe0a0eab24eb04299722e787e5809 100644 --- a/alfa-client/libs/tech-shared/src/lib/resource/list-resource.service.ts +++ b/alfa-client/libs/tech-shared/src/lib/resource/list-resource.service.ts @@ -23,7 +23,7 @@ */ import { Resource, ResourceUri, getUrl, hasLink } from '@ngxp/rest'; import { isEqual, isNil, isNull } from 'lodash-es'; -import { BehaviorSubject, Observable, combineLatest, debounce, filter, first, interval, map, startWith, tap } from 'rxjs'; +import { BehaviorSubject, Observable, combineLatest, filter, first, map, startWith, tap } from 'rxjs'; import { isNotNull, isNotUndefined } from '../tech.util'; import { CreateResourceData, ListItemResource, ListResourceServiceConfig } from './resource.model'; import { ResourceRepository } from './resource.repository'; @@ -64,7 +64,6 @@ export class ResourceListService<B extends Resource, T extends ListResource, I e public getList(): Observable<StateResource<T>> { return combineLatest([this.listResource.asObservable(), this.getConfigResource()]).pipe( - debounce(() => interval(300)), tap(([stateResource, configResource]) => { this.handleChanges(stateResource, configResource); }),