[ACS-6399] - ACA search properties facet clear button do not clear search filter (#9191)

This commit is contained in:
DominikIwanek
2023-12-22 11:50:29 +01:00
committed by GitHub
parent b9d3065810
commit e9c769bc30
2 changed files with 16 additions and 0 deletions

View File

@@ -365,6 +365,18 @@ describe('SearchPropertiesComponent', () => {
component.reset(); component.reset();
expect(component.displayValue$.next).toHaveBeenCalledWith(''); expect(component.displayValue$.next).toHaveBeenCalledWith('');
}); });
it('should clear the queryFragments for the component id and call update', () => {
component.context = TestBed.inject(SearchQueryBuilderService);
component.id = 'test-id';
component.context.queryFragments[component.id] = 'test-query';
fixture.detectChanges();
spyOn(component.context, 'update');
component.reset();
expect(component.context.queryFragments[component.id]).toBe('');
expect(component.context.update).toHaveBeenCalled();
});
}); });
describe('setValue', () => { describe('setValue', () => {

View File

@@ -150,6 +150,10 @@ export class SearchPropertiesComponent implements OnInit, AfterViewChecked, Sear
reset() { reset() {
this.form.reset(); this.form.reset();
if (this.id && this.context) {
this.context.queryFragments[this.id] = '';
this.context.update();
}
this.reset$.next(); this.reset$.next();
this.displayValue$.next(''); this.displayValue$.next('');
} }