-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NAS-133459 / 25.04 / Allow From Name and Email to be used with oAuth …
…email config (#11320)
- Loading branch information
Showing
5 changed files
with
33 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,7 @@ describe('EmailCardComponent with Gmail OAuth', () => { | |
|
||
expect(itemTexts).toEqual([ | ||
'Send Mail Method: GMail OAuth', | ||
'From: Test [email protected] via google.com', | ||
]); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,6 +159,8 @@ describe('EmailFormComponent', () => { | |
|
||
it('saves Gmail Oauth config when user authorizes via Gmail and saves the form', async () => { | ||
await form.fillForm({ | ||
'From Email': '[email protected]', | ||
'From Name': 'Johnny', | ||
'Send Mail Method': 'GMail OAuth', | ||
}); | ||
|
||
|
@@ -169,8 +171,8 @@ describe('EmailFormComponent', () => { | |
await saveButton.click(); | ||
|
||
expect(api.call).toHaveBeenCalledWith('mail.update', [{ | ||
fromemail: '', | ||
fromname: '', | ||
fromemail: '[email protected]', | ||
fromname: 'Johnny', | ||
oauth: { | ||
client_id: 'new_client_id', | ||
client_secret: 'new_secret', | ||
|
@@ -202,8 +204,8 @@ describe('EmailFormComponent', () => { | |
text: 'This is a test message from TrueNAS SCALE.', | ||
}, | ||
{ | ||
fromemail: '', | ||
fromname: '', | ||
fromemail: '[email protected]', | ||
fromname: 'John Smith', | ||
oauth: { | ||
client_id: 'new_client_id', | ||
client_secret: 'new_secret', | ||
|
@@ -253,6 +255,8 @@ describe('EmailFormComponent', () => { | |
|
||
it('saves Outlook Oauth config when user authorizes via Outlook and saves the form', async () => { | ||
await form.fillForm({ | ||
'From Email': '[email protected]', | ||
'From Name': 'Johnny', | ||
'Send Mail Method': 'Outlook OAuth', | ||
}); | ||
|
||
|
@@ -263,8 +267,8 @@ describe('EmailFormComponent', () => { | |
await saveButton.click(); | ||
|
||
expect(api.call).toHaveBeenCalledWith('mail.update', [{ | ||
fromemail: '', | ||
fromname: '', | ||
fromemail: '[email protected]', | ||
fromname: 'Johnny', | ||
outgoingserver: 'smtp-mail.outlook.com', | ||
port: 587, | ||
security: 'TLS', | ||
|
@@ -299,8 +303,8 @@ describe('EmailFormComponent', () => { | |
text: 'This is a test message from TrueNAS SCALE.', | ||
}, | ||
{ | ||
fromemail: '', | ||
fromname: '', | ||
fromemail: '[email protected]', | ||
fromname: 'John Smith', | ||
outgoingserver: 'smtp-mail.outlook.com', | ||
port: 587, | ||
security: 'TLS', | ||
|
@@ -426,6 +430,8 @@ describe('EmailFormComponent', () => { | |
const values = await form.getValues(); | ||
|
||
expect(values).toEqual({ | ||
'From Email': '[email protected]', | ||
'From Name': 'John Smith', | ||
'Send Mail Method': 'GMail OAuth', | ||
}); | ||
expect(spectator.query('.oauth-message')).toHaveText('Gmail credentials have been applied.'); | ||
|
@@ -458,6 +464,8 @@ describe('EmailFormComponent', () => { | |
const values = await form.getValues(); | ||
|
||
expect(values).toEqual({ | ||
'From Email': '[email protected]', | ||
'From Name': 'John Smith', | ||
'Send Mail Method': 'Outlook OAuth', | ||
}); | ||
expect(spectator.query('.oauth-message')).toHaveText('Outlook credentials have been applied.'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters