Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Jul 10, 2023
1 parent b7ed542 commit 52203c5
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions test/passwordless/emailDelivery.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,15 @@ describe(`emailDelivery: ${printPath("[test/passwordless/emailDelivery.test.js]"
Passwordless.init({
contactMethod: "EMAIL",
flowType: "USER_INPUT_CODE_AND_MAGIC_LINK",
createAndSendCustomEmail: async (input) => {
email = input.email;
codeLifetime = input.codeLifetime;
urlWithLinkCode = input.urlWithLinkCode;
userInputCode = input.userInputCode;
emailDelivery: {
service: {
sendEmail: async (input) => {
email = input.email;
codeLifetime = input.codeLifetime;
urlWithLinkCode = input.urlWithLinkCode;
userInputCode = input.userInputCode;
},
},
},
}),
Session.init({ getTokenTransferMethod: () => "cookie" }),
Expand Down Expand Up @@ -523,18 +527,18 @@ describe(`emailDelivery: ${printPath("[test/passwordless/emailDelivery.test.js]"
Passwordless.init({
contactMethod: "EMAIL",
flowType: "USER_INPUT_CODE_AND_MAGIC_LINK",
createAndSendCustomEmail: async (input) => {
/**
* when the function is called for the first time,
* it will be for signinup
*/
if (sendCustomEmailCalled) {
email = input.email;
codeLifetime = input.codeLifetime;
urlWithLinkCode = input.urlWithLinkCode;
userInputCode = input.userInputCode;
}
sendCustomEmailCalled = true;
emailDelivery: {
service: {
sendEmail: async (input) => {
if (sendCustomEmailCalled) {
email = input.email;
codeLifetime = input.codeLifetime;
urlWithLinkCode = input.urlWithLinkCode;
userInputCode = input.userInputCode;
}
sendCustomEmailCalled = true;
},
},
},
}),
Session.init({ getTokenTransferMethod: () => "cookie" }),
Expand Down

0 comments on commit 52203c5

Please sign in to comment.