Enhancement: optimize tasks / stats reload (#7402)

This commit is contained in:
shamoon
2024-08-05 23:25:55 -07:00
committed by GitHub
parent 15554322dd
commit 8fa52046e4
5 changed files with 42 additions and 25 deletions

View File

@@ -71,6 +71,13 @@ describe('StatisticsWidgetComponent', () => {
expect(reloadSpy).toHaveBeenCalled()
})
it('should not call statistics endpoint on reload if already loading', () => {
httpTestingController.expectOne(`${environment.apiBaseUrl}statistics/`)
component.loading = true
component.reload()
httpTestingController.expectNone(`${environment.apiBaseUrl}statistics/`)
})
it('should display inbox link with count', () => {
const mockStats = {
documents_total: 200,