87370: Update SearchFormComponent specs

This commit is contained in:
Yura Bondarenko
2022-02-09 18:56:48 +01:00
parent 28cc54e3f8
commit 1919f251a1

View File

@@ -47,21 +47,23 @@ describe('SearchFormComponent', () => {
el = de.nativeElement;
});
it('should not display scopes when empty', () => {
fixture.detectChanges();
const select = de.query(By.css('select'));
expect(select).toBeNull();
});
it('should not display scopes when scopeSelectable is false', () => {
comp.scopeSelectable = false;
comp.scopes = objects;
comp.scope = objects[1].id;
it('should not display scopes when showScopeSelector is false', fakeAsync(() => {
comp.showScopeSelector = false;
fixture.detectChanges();
const select = de.query(By.css('select'));
expect(select).toBeNull();
});
tick();
expect(de.query(By.css('.scope-button'))).toBeFalsy();
}));
it('should display scopes when showScopeSelector is true', fakeAsync(() => {
comp.showScopeSelector = true;
fixture.detectChanges();
tick();
expect(de.query(By.css('.scope-button'))).toBeTruthy();
}));
it('should display set query value in input field', fakeAsync(() => {
const testString = 'This is a test query';