mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-18 00:46:25 +00:00
Chore: fix some test warnings / errors
This commit is contained in:
@@ -158,13 +158,14 @@ describe('MailComponent', () => {
|
|||||||
|
|
||||||
it('should show errors on load if load mailAccounts failure', () => {
|
it('should show errors on load if load mailAccounts failure', () => {
|
||||||
const toastErrorSpy = jest.spyOn(toastService, 'showError')
|
const toastErrorSpy = jest.spyOn(toastService, 'showError')
|
||||||
|
jest.spyOn(mailAccountService, 'getCached').mockReturnValue(of(null))
|
||||||
jest
|
jest
|
||||||
.spyOn(mailAccountService, 'listAll')
|
.spyOn(mailAccountService, 'listAll')
|
||||||
.mockImplementation(() =>
|
.mockImplementation(() =>
|
||||||
throwError(() => new Error('failed to load mail accounts'))
|
throwError(() => new Error('failed to load mail accounts'))
|
||||||
)
|
)
|
||||||
completeSetup(mailAccountService)
|
completeSetup(mailAccountService)
|
||||||
expect(toastErrorSpy).toBeCalled()
|
expect(toastErrorSpy).toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should show errors on load if load mailRules failure', () => {
|
it('should show errors on load if load mailRules failure', () => {
|
||||||
@@ -175,7 +176,7 @@ describe('MailComponent', () => {
|
|||||||
throwError(() => new Error('failed to load mail rules'))
|
throwError(() => new Error('failed to load mail rules'))
|
||||||
)
|
)
|
||||||
completeSetup(mailRuleService)
|
completeSetup(mailRuleService)
|
||||||
expect(toastErrorSpy).toBeCalled()
|
expect(toastErrorSpy).toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should support edit / create mail account, show error if needed', () => {
|
it('should support edit / create mail account, show error if needed', () => {
|
||||||
|
Reference in New Issue
Block a user