Fixes after merge with master

This commit is contained in:
Giuseppe Digilio
2019-02-19 17:46:34 +01:00
parent 880d9ed069
commit f6fe2c3c3e
34 changed files with 164 additions and 238 deletions

View File

@@ -289,14 +289,6 @@ describe('RequestService', () => {
});
});
describe('when forceBypassCache is true', () => {
it('should call clearRequestsOnTheirWayToTheStore method', () => {
spyOn(serviceAsAny, 'clearRequestsOnTheirWayToTheStore');
service.configure(testPostRequest, true);
expect(serviceAsAny.clearRequestsOnTheirWayToTheStore).toHaveBeenCalledWith(testPostRequest.href);
});
});
});
describe('isCachedOrPending', () => {
@@ -467,37 +459,6 @@ describe('RequestService', () => {
});
});
describe('clearRequestsOnTheirWayToTheStore', () => {
let request: GetRequest;
beforeEach(() => {
request = testPatchRequest;
});
describe('when there is no request entry', () => {
it('should remove response from cache', () => {
spyOn(service, 'getByHref').and.returnValue(observableOf(undefined));
serviceAsAny.clearRequestsOnTheirWayToTheStore(request.href);
expect(responseCache.remove).toHaveBeenCalledWith(request.href);
});
});
describe('when there is a request entry and is not pending', () => {
it('should remove response from cache and stop tracking the request', () => {
spyOn(service, 'getByHref').and.returnValue(observableOf({responsePending: false}));
serviceAsAny.clearRequestsOnTheirWayToTheStore(request.href);
expect(responseCache.remove).toHaveBeenCalledWith(request.href);
expect(serviceAsAny.requestsOnTheirWayToTheStore.includes(request.href)).toBeFalsy();
});
});
});
describe('isReusable', () => {
describe('when the given UUID is has no value', () => {
let reusable;