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