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 8db1088 commit b7ed542
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions test/passwordless/smsDelivery.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,15 @@ describe(`smsDelivery: ${printPath("[test/passwordless/smsDelivery.test.js]")}`,
Passwordless.init({
contactMethod: "PHONE",
flowType: "USER_INPUT_CODE_AND_MAGIC_LINK",
createAndSendCustomTextMessage: async (input) => {
phoneNumber = input.phoneNumber;
codeLifetime = input.codeLifetime;
urlWithLinkCode = input.urlWithLinkCode;
userInputCode = input.userInputCode;
smsDelivery: {
service: {
sendSms: async (input) => {
phoneNumber = input.phoneNumber;
codeLifetime = input.codeLifetime;
urlWithLinkCode = input.urlWithLinkCode;
userInputCode = input.userInputCode;
},
},
},
}),
Session.init({ getTokenTransferMethod: () => "cookie" }),
Expand Down Expand Up @@ -680,18 +684,18 @@ describe(`smsDelivery: ${printPath("[test/passwordless/smsDelivery.test.js]")}`,
Passwordless.init({
contactMethod: "PHONE",
flowType: "USER_INPUT_CODE_AND_MAGIC_LINK",
createAndSendCustomTextMessage: async (input) => {
/**
* when the function is called for the first time,
* it will be for signinup
*/
if (sendCustomSMSCalled) {
phoneNumber = input.phoneNumber;
codeLifetime = input.codeLifetime;
urlWithLinkCode = input.urlWithLinkCode;
userInputCode = input.userInputCode;
}
sendCustomSMSCalled = true;
smsDelivery: {
service: {
sendSms: async (input) => {
if (sendCustomSMSCalled) {
phoneNumber = input.phoneNumber;
codeLifetime = input.codeLifetime;
urlWithLinkCode = input.urlWithLinkCode;
userInputCode = input.userInputCode;
}
sendCustomSMSCalled = true;
},
},
},
}),
Session.init({ getTokenTransferMethod: () => "cookie" }),
Expand Down

0 comments on commit b7ed542

Please sign in to comment.