mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-19 21:16:56 +01:00
Enhancement: add background to consumer statuses
This commit is contained in:
parent
5842944d1e
commit
ea1eb551a7
5 changed files with 120 additions and 101 deletions
|
|
@ -26,6 +26,7 @@ import { UploadDocumentsService } from 'src/app/services/upload-documents.servic
|
|||
import { WidgetFrameComponent } from '../widget-frame/widget-frame.component'
|
||||
import { UploadFileWidgetComponent } from './upload-file-widget.component'
|
||||
import { DragDropModule } from '@angular/cdk/drag-drop'
|
||||
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
|
||||
|
||||
const FAILED_STATUSES = [new FileStatus()]
|
||||
const WORKING_STATUSES = [new FileStatus(), new FileStatus()]
|
||||
|
|
@ -73,6 +74,7 @@ describe('UploadFileWidgetComponent', () => {
|
|||
RouterTestingModule.withRoutes(routes),
|
||||
NgbAlertModule,
|
||||
DragDropModule,
|
||||
NgxBootstrapIconsModule.pick(allIcons),
|
||||
],
|
||||
}).compileComponents()
|
||||
|
||||
|
|
@ -147,12 +149,16 @@ describe('UploadFileWidgetComponent', () => {
|
|||
|
||||
it('should allow dismissing all alerts', fakeAsync(() => {
|
||||
mockConsumerStatuses(consumerStatusService)
|
||||
component.alertsExpanded = true
|
||||
fixture.detectChanges()
|
||||
jest
|
||||
.spyOn(component, 'getStatusCompleted')
|
||||
.mockImplementation(() => SUCCESS_STATUSES)
|
||||
const dismissSpy = jest.spyOn(consumerStatusService, 'dismiss')
|
||||
component.dismissCompleted()
|
||||
tick(1000)
|
||||
fixture.detectChanges()
|
||||
expect(dismissSpy).toHaveBeenCalledTimes(6)
|
||||
expect(dismissSpy).toHaveBeenCalledTimes(10)
|
||||
}))
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue