mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-10-20 03:06:10 -05:00
Frontend better handle slow backend requests
This commit is contained in:
@@ -103,6 +103,7 @@ describe('DocumentListViewService', () => {
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
documentListViewService.cancelPending()
|
||||
httpTestingController.verify()
|
||||
sessionStorage.clear()
|
||||
})
|
||||
@@ -425,4 +426,13 @@ describe('DocumentListViewService', () => {
|
||||
})
|
||||
expect(documentListViewService.selected.size).toEqual(3)
|
||||
})
|
||||
|
||||
it('should cancel on reload the list', () => {
|
||||
const cancelSpy = jest.spyOn(documentListViewService, 'cancelPending')
|
||||
documentListViewService.reload()
|
||||
httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}documents/?page=1&page_size=50&ordering=-created&truncate_content=true&tags__id__all=9`
|
||||
)
|
||||
expect(cancelSpy).toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user