feat(tenant-service): implement bootstrap request timeout and enhance request context resolution
This commit is contained in:
28
src/app/app.config.spec.ts
Normal file
28
src/app/app.config.spec.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { HttpRequest } from '@angular/common/http';
|
||||
|
||||
import { isStoreCatalogRequest } from './app.config';
|
||||
|
||||
describe('isStoreCatalogRequest', () => {
|
||||
it.each([
|
||||
'http://localhost:8000/api/tenants/demo/catalog',
|
||||
'http://localhost:8000/api/tenants/demo/catalog?currency=ARS',
|
||||
'http://localhost:8000/api/tenants/demo/catalog/featured-groups/7/items?page=2',
|
||||
'http://localhost:8000/api/tenants/demo/catalog-items?q=remera&page=1',
|
||||
'http://localhost:8000/api/tenants/demo/catalog-items/42?variant_id=3',
|
||||
])('includes GET %s in the hydration transfer cache', (url) => {
|
||||
expect(isStoreCatalogRequest(new HttpRequest('GET', url))).toBe(true);
|
||||
});
|
||||
|
||||
it.each([
|
||||
['POST', 'http://localhost:8000/api/tenants/demo/catalog-items'],
|
||||
['GET', 'http://localhost:8000/api/tenants/demo/productos'],
|
||||
['GET', 'http://localhost:8000/api/tenants/demo/categories/7'],
|
||||
['GET', 'http://localhost:8000/api/tenants/demo/catalog-items/42/variant-options'],
|
||||
['GET', 'http://localhost:8000/api/tenants/demo/catalogue'],
|
||||
])('excludes %s %s from the hydration transfer cache', (method, url) => {
|
||||
const request =
|
||||
method === 'GET' ? new HttpRequest('GET', url) : new HttpRequest('POST', url, null);
|
||||
|
||||
expect(isStoreCatalogRequest(request)).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user