diff --git a/tests/unit/mentor-welcome-email.test.ts b/tests/unit/mentor-welcome-email.test.ts index fbf601e..fb8f41d 100644 --- a/tests/unit/mentor-welcome-email.test.ts +++ b/tests/unit/mentor-welcome-email.test.ts @@ -16,13 +16,17 @@ describe('getMentorBulkAssignmentTemplate', () => { }, ], 'https://x/mentor', - 'Please reach out this week.', + 'Reach out now & soon', ) expect(t.html).toContain('bob@team.com') expect(t.html).toContain('How to mentor on MOPC') - expect(t.html).toContain('Please reach out this week.') + // The admin-supplied custom note must be HTML-escaped in the HTML body. + expect(t.html).toContain('<b>') + expect(t.html).not.toContain('now') expect(t.text).toContain('bob@team.com') expect(t.text).toContain('How to mentor on MOPC') + // The plain-text body keeps the raw note unescaped. + expect(t.text).toContain('Reach out now & soon') }) it('renders without team members or note (backward compatible)', () => { @@ -51,6 +55,10 @@ describe('getTeamMentorIntroductionTemplate', () => { expect(t.html).toContain('carol@team.com') expect(t.html).toContain('Working with your mentor') expect(t.html).toContain('Welcome aboard!') + // Mirror coverage on the plain-text path. + expect(t.text).toContain('alice@mentor.com') + expect(t.text).toContain('carol@team.com') + expect(t.text).toContain('Welcome aboard!') }) it('renders without teammates or note (backward compatible)', () => {