[AAE-5392] - Make search text input more configurable & add an event … (#7188)

* [AAE-5392] - Make search text input more configurable & add an event emitter to indicate the states of it

* Remove fdescribe

* Emit empty search term when the search gets cleared

* Emit the empty search term when the search gets collapsed by the Search icon

* Same onBlur, emit the empty search term

* Add unit tests for emitters resetting the search term

* Fix comments, use reset event emitter instead of emitting an empty search term

* Update documentation

* Revert reset to boolean

* Fix flaky unit test
This commit is contained in:
arditdomi
2021-07-30 11:30:20 +03:00
committed by GitHub
parent cab016046a
commit 94d908e51a
5 changed files with 184 additions and 16 deletions

View File

@@ -321,17 +321,17 @@ describe('SearchControlComponent', () => {
});
});
it('should NOT display a autocomplete list control when configured not to', (done) => {
it('should NOT display a autocomplete list control when configured not to', async () => {
searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results))));
component.liveSearchEnabled = false;
fixture.detectChanges();
await fixture.whenStable();
typeWordIntoSearchInput('TEST');
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(element.querySelector('#autocomplete-search-result-list')).toBeNull();
done();
});
fixture.detectChanges();
await fixture.whenStable();
expect(element.querySelector('#autocomplete-search-result-list')).toBeNull();
});
});