Skip to content

Commit

Permalink
Remove conditional that will never happen
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon committed May 10, 2024
1 parent c55af28 commit 431860e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Expand Up @@ -249,10 +249,7 @@ describe('GlobalSearchComponent', () => {
expect(blurSpy).toHaveBeenCalled()

component.searchResults = { total: 1 } as any
component.resultsDropdown.close()
const openSpy = jest.spyOn(component.resultsDropdown, 'open')
component.searchInputKeyDown(new KeyboardEvent('keydown', { key: 'Enter' }))
expect(openSpy).toHaveBeenCalled()
component.resultsDropdown.open()

component.searchInputKeyDown(
new KeyboardEvent('keydown', { key: 'ArrowDown' })
Expand Down
Expand Up @@ -277,8 +277,6 @@ export class GlobalSearchComponent implements OnInit {
} else if (this.query?.length) {
this.runAdvanedSearch()
this.reset(true)
} else if (this.searchResults?.total && !this.resultsDropdown.isOpen()) {
this.resultsDropdown.open()
}
} else if (event.key === 'Escape' && !this.resultsDropdown.isOpen()) {
if (this.query?.length) {
Expand Down

0 comments on commit 431860e

Please sign in to comment.