it('should show errors on load if load mailAccounts failure', () => {
const toastErrorSpy = jest.spyOn(toastService, 'showError')
+ jest.spyOn(mailAccountService, 'getCached').mockReturnValue(of(null))
jest
.spyOn(mailAccountService, 'listAll')
.mockImplementation(() =>
throwError(() => new Error('failed to load mail accounts'))
)
completeSetup(mailAccountService)
- expect(toastErrorSpy).toBeCalled()
+ expect(toastErrorSpy).toHaveBeenCalled()
})
it('should show errors on load if load mailRules failure', () => {
throwError(() => new Error('failed to load mail rules'))
)
completeSetup(mailRuleService)
- expect(toastErrorSpy).toBeCalled()
+ expect(toastErrorSpy).toHaveBeenCalled()
})
it('should support edit / create mail account, show error if needed', () => {