[AAE-14469] added constraint for typed value (#8611)

* [AAE-14469] added constraint for typed value

* [AAE-14469] removed obsolete input property
This commit is contained in:
tomasz hanaj
2023-06-06 10:41:13 +02:00
committed by GitHub
parent 2c5a6e50e2
commit f549a19fb9
2 changed files with 12 additions and 5 deletions

View File

@@ -262,6 +262,12 @@ describe('PeopleCloudComponent', () => {
const errorIcon = element.querySelector('.adf-error-icon').textContent;
expect(errorIcon).toEqual('error_outline');
});
it('should not search user if typed no character', async () => {
await searchUsers('');
expect(searchSpy).not.toHaveBeenCalled();
});
});
describe('No preselected users', () => {

View File

@@ -188,6 +188,7 @@ export class PeopleCloudComponent implements OnInit, OnChanges, OnDestroy {
private initSearch(): void {
this.initializeStream();
this.typingUniqueValueNotEmpty$.pipe(
filter((name: string) => name.length >= 1),
switchMap((name: string) =>
this.identityUserService.search(name, { roles: this.roles, withinApplication: this.appName, groups: this.groupsRestriction })
),