mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-01 11:19:32 -05:00
Fix a random test error
This commit is contained in:
parent
6b76847595
commit
7f04c6a09a
@ -539,15 +539,10 @@ describe('FilterableDropdownComponent & FilterableDropdownSelectionModel', () =>
|
|||||||
fixture.nativeElement
|
fixture.nativeElement
|
||||||
.querySelector('button')
|
.querySelector('button')
|
||||||
.dispatchEvent(new MouseEvent('click')) // open
|
.dispatchEvent(new MouseEvent('click')) // open
|
||||||
fixture.detectChanges()
|
|
||||||
tick(100)
|
tick(100)
|
||||||
component.filterText = 'FooBar'
|
component.filterText = 'FooBar'
|
||||||
fixture.detectChanges()
|
component.listFilterEnter()
|
||||||
component.listFilterTextInput.nativeElement.dispatchEvent(
|
|
||||||
new KeyboardEvent('keyup', { key: 'Enter' })
|
|
||||||
)
|
|
||||||
expect(component.selectionModel.getSelectedItems()).toEqual([])
|
expect(component.selectionModel.getSelectedItems()).toEqual([])
|
||||||
tick(300)
|
|
||||||
expect(createSpy).toHaveBeenCalled()
|
expect(createSpy).toHaveBeenCalled()
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
@ -483,7 +483,7 @@ export class FilterableDropdownComponent implements OnDestroy, OnInit {
|
|||||||
dropdownOpenChange(open: boolean): void {
|
dropdownOpenChange(open: boolean): void {
|
||||||
if (open) {
|
if (open) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.listFilterTextInput.nativeElement.focus()
|
this.listFilterTextInput?.nativeElement.focus()
|
||||||
}, 0)
|
}, 0)
|
||||||
if (this.editing) {
|
if (this.editing) {
|
||||||
this.selectionModel.reset()
|
this.selectionModel.reset()
|
||||||
@ -492,7 +492,7 @@ export class FilterableDropdownComponent implements OnDestroy, OnInit {
|
|||||||
this.opened.next(this)
|
this.opened.next(this)
|
||||||
} else {
|
} else {
|
||||||
if (this.creating) {
|
if (this.creating) {
|
||||||
this.dropdown.open()
|
this.dropdown?.open()
|
||||||
this.creating = false
|
this.creating = false
|
||||||
} else {
|
} else {
|
||||||
this.filterText = ''
|
this.filterText = ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user