diff --git a/src/app/shared/search-form/search-form.component.spec.ts b/src/app/shared/search-form/search-form.component.spec.ts index 20c9435eb4..36e83d9fc5 100644 --- a/src/app/shared/search-form/search-form.component.spec.ts +++ b/src/app/shared/search-form/search-form.component.spec.ts @@ -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';