mongodb / atlas-app-services-examples

Example use cases for Atlas App Services
32 stars 4 forks source link

Integration Testing Email/Password Registration with Confirmation Email #5

Open trycatchdonothing opened 1 year ago

trycatchdonothing commented 1 year ago

Is there a way to use the email confirmation option with e-mail/password registration when writing integration tests?

In your example here, you have the following code:

  await app.emailPasswordAuth.registerUser({ email, password });
  user = await app.logIn(Realm.Credentials.emailPassword(email, password));

I assume registration is set to auto in order to make this work.

mongodben commented 1 year ago

thanks for the question. i think that'd be challenging to implement solely from an App Services-side perspective. you'd also need to implement acceptance handling from whatever email address you send the email to.

neha-yadav-nationwide commented 1 year ago

Is there a way to generate email on the failure of trigger?