mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 23:35:22 +01:00
Enhancement: process mail button (#8466)
This commit is contained in:
parent
2ac2a6dec6
commit
dafb0b1f21
9 changed files with 196 additions and 49 deletions
|
|
@ -219,6 +219,23 @@ describe('MailComponent', () => {
|
|||
expect(toastInfoSpy).toHaveBeenCalledWith('Deleted mail account')
|
||||
})
|
||||
|
||||
it('should support process mail account, show error if needed', () => {
|
||||
completeSetup()
|
||||
const processSpy = jest.spyOn(mailAccountService, 'processAccount')
|
||||
const toastErrorSpy = jest.spyOn(toastService, 'showError')
|
||||
const toastInfoSpy = jest.spyOn(toastService, 'showInfo')
|
||||
component.processAccount(mailAccounts[0] as MailAccount)
|
||||
expect(processSpy).toHaveBeenCalled()
|
||||
processSpy.mockReturnValueOnce(
|
||||
throwError(() => new Error('error processing mail account'))
|
||||
)
|
||||
component.processAccount(mailAccounts[0] as MailAccount)
|
||||
expect(toastErrorSpy).toHaveBeenCalled()
|
||||
processSpy.mockReturnValueOnce(of(true))
|
||||
component.processAccount(mailAccounts[0] as MailAccount)
|
||||
expect(toastInfoSpy).toHaveBeenCalledWith('Processing mail account')
|
||||
})
|
||||
|
||||
it('should support edit / create mail rule, show error if needed', () => {
|
||||
completeSetup()
|
||||
let modal: NgbModalRef
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue