]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Chore: fix some test warnings / errors
authorshamoon <4887959+shamoon@users.noreply.github.com>
Fri, 27 Jun 2025 22:03:10 +0000 (15:03 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Fri, 27 Jun 2025 22:03:10 +0000 (15:03 -0700)
src-ui/src/app/components/manage/mail/mail.component.spec.ts

index 4968f9d372b72d2636a57a62ee1806bedb97d76f..d1878d6d3b220a54f0c026d6640f24e6ce344a1f 100644 (file)
@@ -158,13 +158,14 @@ describe('MailComponent', () => {
 
   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', () => {
@@ -175,7 +176,7 @@ describe('MailComponent', () => {
         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', () => {