mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Fix a random test error
This commit is contained in:
		
							parent
							
								
									e787055294
								
							
						
					
					
						commit
						8aa35540b5
					
				@ -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