Tweak: more verbose toast messages

This commit is contained in:
shamoon
2025-02-01 21:57:57 -08:00
parent e877beea4e
commit 065724befb
10 changed files with 248 additions and 184 deletions

View File

@@ -214,7 +214,7 @@ describe('MailComponent', () => {
deleteSpy.mockReturnValueOnce(of(true))
deleteDialog.confirm()
expect(listAllSpy).toHaveBeenCalled()
expect(toastInfoSpy).toHaveBeenCalledWith('Deleted mail account')
expect(toastInfoSpy).toHaveBeenCalledWith('Deleted mail account "account1"')
})
it('should support process mail account, show error if needed', () => {
@@ -231,7 +231,9 @@ describe('MailComponent', () => {
expect(toastErrorSpy).toHaveBeenCalled()
processSpy.mockReturnValueOnce(of(true))
component.processAccount(mailAccounts[0] as MailAccount)
expect(toastInfoSpy).toHaveBeenCalledWith('Processing mail account')
expect(toastInfoSpy).toHaveBeenCalledWith(
'Processing mail account "account1"'
)
})
it('should support edit / create mail rule, show error if needed', () => {
@@ -274,14 +276,14 @@ describe('MailComponent', () => {
const toastInfoSpy = jest.spyOn(toastService, 'showInfo')
const listAllSpy = jest.spyOn(mailRuleService, 'listAll')
deleteSpy.mockReturnValueOnce(
throwError(() => new Error('error deleting mail rule'))
throwError(() => new Error('error deleting mail rule "rule1"'))
)
deleteDialog.confirm()
expect(toastErrorSpy).toBeCalled()
deleteSpy.mockReturnValueOnce(of(true))
deleteDialog.confirm()
expect(listAllSpy).toHaveBeenCalled()
expect(toastInfoSpy).toHaveBeenCalledWith('Deleted mail rule')
expect(toastInfoSpy).toHaveBeenCalledWith('Deleted mail rule "rule1"')
})
it('should support edit permissions on mail rule objects', () => {