Requirement: Send an Email alert using a custom lightning component for selected records under few circumstances(Business logic) for which
Messaging.sendEmail was used. Functionality working completely fine.
Challenge: Now the problem is when the test class gets executed.
I am creating a list of users and assigning the permission set in the test setup.
System.runAs(quriedUsers) to run a test block and getting following error:-
Insert Failed, Invalid Email Address and while debugging further I analyzed the email and name field are not exactly the same as I initialized under test class. I am getting like automatedclean@00d3o0000008cbiuai as an email that is not under the correct format.
Any workaround excluding