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; el = de.nativeElement;
}); });
it('should not display scopes when empty', () => { it('should not display scopes when showScopeSelector is false', fakeAsync(() => {
fixture.detectChanges(); comp.showScopeSelector = false;
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;
fixture.detectChanges(); fixture.detectChanges();
const select = de.query(By.css('select')); tick();
expect(select).toBeNull();
}); 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(() => { it('should display set query value in input field', fakeAsync(() => {
const testString = 'This is a test query'; const testString = 'This is a test query';