Skip to content

Commit

Permalink
Add test for handling special characters in email fields
Browse files Browse the repository at this point in the history
  • Loading branch information
DhiraPT committed Dec 20, 2024
1 parent 6d4f9f4 commit d3ac452
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/java/teammates/logic/api/EmailSenderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,15 @@ public void testConvertToMailjet() {
assertEquals(wrapper.getContent(), email.get(Email.HTMLPART));
}

@Test
public void testSpecialCharactersInFields() {
EmailWrapper wrapper = getTypicalEmailWrapper();
wrapper.setSubject("Test 🚀 with special characters 🎉");
wrapper.setContent("<p>Content with emoji 😊 and symbols &copy;</p>");

Mail email = new SendgridService().parseToEmail(wrapper);
assertEquals("Test 🚀 with special characters 🎉", email.getSubject());
assertEquals("Content with emoji 😊 and symbols ©", email.getContent().get(0).getValue());
}

}

0 comments on commit d3ac452

Please sign in to comment.