expect(dismissSpy).toHaveBeenCalled()
})
- it('should allow dismissing all alerts', fakeAsync(() => {
+ it('should allow dismissing completed alerts', fakeAsync(() => {
mockConsumerStatuses(consumerStatusService)
component.alertsExpanded = true
fixture.detectChanges()
component.dismissCompleted()
tick(1000)
fixture.detectChanges()
- expect(dismissSpy).toHaveBeenCalledTimes(10)
+ expect(dismissSpy).toHaveBeenCalledTimes(4)
}))
})
}
dismissCompleted() {
- this.alerts.forEach((a) => a.close())
- if (this.alertsExpanded) {
- this.getStatusCompleted().forEach((status) =>
- this.consumerStatusService.dismiss(status)
- )
- }
+ this.getStatusCompleted().forEach((status) =>
+ this.consumerStatusService.dismiss(status)
+ )
}
public onFileSelected(event: Event) {