mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-6399] - ACA search properties facet clear button do not clear search filter (#9191)
This commit is contained in:
@@ -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', () => {
|
||||||
|
@@ -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('');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user