mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-14 10:02:45 +00:00
We have to make this generic-er
This commit is contained in:
2 files changed
+9
-6
No files matched your search
@@ -231,7 +231,7 @@ describe('AppFrameComponent', () => {
|
||||
expect(refresh).toHaveBeenCalledWith(document.id)
|
||||
expect(maybeRefreshSpy).toHaveBeenCalledTimes(1)
|
||||
expect(tasksReload).toHaveBeenCalledTimes(1)
|
||||
expect(success).toHaveBeenCalledWith('Bulk operation completed.')
|
||||
expect(success).toHaveBeenCalledWith('Operation completed.')
|
||||
fixture.destroy()
|
||||
bulkEvents.next({
|
||||
task_id: 'bulk-task',
|
||||
@@ -263,9 +263,12 @@ describe('AppFrameComponent', () => {
|
||||
})
|
||||
}
|
||||
expect(reload).toHaveBeenCalledTimes(2)
|
||||
expect(error).toHaveBeenCalledWith(expect.any(String), 'Could not update')
|
||||
expect(error).toHaveBeenCalledWith(
|
||||
'Bulk operation revoked.',
|
||||
'Operation failed. Some changes may already have been applied.',
|
||||
'Could not update'
|
||||
)
|
||||
expect(error).toHaveBeenCalledWith(
|
||||
'Operation revoked.',
|
||||
'Task expired before execution.'
|
||||
)
|
||||
expect(success).not.toHaveBeenCalled()
|
||||
|
||||
@@ -204,12 +204,12 @@ export class AppFrameComponent
|
||||
this.trashService.handleDeleteTaskStatus(task_id, status)
|
||||
}
|
||||
if (status === PaperlessTaskStatus.Success && operation !== 'delete') {
|
||||
this.toastService.showSuccess($localize`Bulk operation completed.`)
|
||||
this.toastService.showSuccess($localize`Operation completed.`)
|
||||
} else if (status === PaperlessTaskStatus.Revoked) {
|
||||
this.toastService.showError($localize`Bulk operation revoked.`, error)
|
||||
this.toastService.showError($localize`Operation revoked.`, error)
|
||||
} else if (status === PaperlessTaskStatus.Failure) {
|
||||
this.toastService.showError(
|
||||
$localize`Bulk operation failed. Some changes may already have been applied.`,
|
||||
$localize`Operation failed. Some changes may already have been applied.`,
|
||||
error
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user