diff --git a/libs/feature/search/src/lib/search-filters-summary/search-filters-summary.component.spec.ts b/libs/feature/search/src/lib/search-filters-summary/search-filters-summary.component.spec.ts index 8056ac459..f5854b17c 100644 --- a/libs/feature/search/src/lib/search-filters-summary/search-filters-summary.component.spec.ts +++ b/libs/feature/search/src/lib/search-filters-summary/search-filters-summary.component.spec.ts @@ -13,6 +13,7 @@ import { FieldFilters } from '@geonetwork-ui/common/domain/model/search' class SearchFacadeMock { searchFilters$ = new BehaviorSubject({ + any: 'search should be ignored', format: {}, isSpatial: {}, license: {}, @@ -94,7 +95,9 @@ describe('SearchFiltersSummaryComponent', () => { it('should clear filters', () => { component.clearFilters() - expect(searchService.setFilters).toHaveBeenCalledWith({}) + expect(searchService.setFilters).toHaveBeenCalledWith({ + any: 'search should be ignored', + }) }) }) @@ -139,6 +142,7 @@ describe('SearchFiltersSummaryComponent', () => { it('should clear filters except with keys from FILTER_SUMMARY_IGNORE_LIST', () => { const filters = { owner: { 1: true }, + any: 'search should be ignored', format: {}, isSpatial: {}, license: {}, @@ -150,6 +154,7 @@ describe('SearchFiltersSummaryComponent', () => { component.clearFilters() expect(searchService.setFilters).toHaveBeenCalledWith({ owner: { 1: true }, + any: 'search should be ignored', }) }) }) diff --git a/libs/feature/search/src/lib/search-filters-summary/search-filters-summary.component.ts b/libs/feature/search/src/lib/search-filters-summary/search-filters-summary.component.ts index c4318f8f7..590256704 100644 --- a/libs/feature/search/src/lib/search-filters-summary/search-filters-summary.component.ts +++ b/libs/feature/search/src/lib/search-filters-summary/search-filters-summary.component.ts @@ -31,7 +31,11 @@ export class SearchFiltersSummaryComponent implements OnInit { @Inject(FILTER_SUMMARY_IGNORE_LIST) filterSummaryIgnoreList: string[] ) { - this.filterSummaryIgnoreList = filterSummaryIgnoreList || [] + const defaultIgnoreList = ['any'] + this.filterSummaryIgnoreList = [ + ...defaultIgnoreList, + ...(filterSummaryIgnoreList ?? []), + ] } ngOnInit(): void {