Fix for ACA upstream (#11642)

This commit is contained in:
Dominik Iwanek
2026-02-11 18:46:57 +01:00
committed by GitHub
parent 823a147656
commit 1fa683e2a9
2 changed files with 7 additions and 6 deletions
@@ -341,13 +341,13 @@ describe('BaseQueryBuilderService', () => {
); );
}); });
it('should update URL params even when query is null', async () => { it('should not update URL params even when query is null', async () => {
spyOn(router, 'navigate').and.returnValue(Promise.resolve(true)); spyOn(router, 'navigate').and.returnValue(Promise.resolve(true));
service.userQuery = ''; service.userQuery = '';
await service.execute(); await service.execute();
expect(router.navigate).toHaveBeenCalled(); expect(router.navigate).not.toHaveBeenCalled();
}); });
}); });
@@ -446,11 +446,12 @@ describe('BaseQueryBuilderService', () => {
it('should call execute when updating configuration', async () => { it('should call execute when updating configuration', async () => {
spyOn(router, 'navigate').and.returnValue(Promise.resolve(true)); spyOn(router, 'navigate').and.returnValue(Promise.resolve(true));
spyOn(service.searchApi, 'search').and.returnValue(Promise.resolve({ list: { entries: [] } } as ResultSetPaging)); spyOn(service.searchApi, 'search').and.returnValue(Promise.resolve({ list: { entries: [] } } as ResultSetPaging));
spyOn(service, 'execute')
service.userQuery = 'test'; service.userQuery = 'test';
service.updateSelectedConfiguration('config-2'); service.updateSelectedConfiguration('config-2');
expect(router.navigate).toHaveBeenCalled(); expect(service.execute).toHaveBeenCalled();
}); });
}); });
@@ -374,11 +374,11 @@ export abstract class BaseQueryBuilderService {
*/ */
async execute(updateQueryParams = true, queryBody?: SearchRequest) { async execute(updateQueryParams = true, queryBody?: SearchRequest) {
try { try {
const query = queryBody ? queryBody : this.buildQuery();
if (query) {
if (updateQueryParams) { if (updateQueryParams) {
this.updateSearchQueryParams(); this.updateSearchQueryParams();
} }
const query = queryBody ? queryBody : this.buildQuery();
if (query) {
const resultSetPaging: ResultSetPaging = await this.searchApi.search(query); const resultSetPaging: ResultSetPaging = await this.searchApi.search(query);
this.executed.next(resultSetPaging); this.executed.next(resultSetPaging);
} }