mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-16 21:55:37 -05:00
Enhancement: process mail button (#8466)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user