From b7ed542dc1a8b13b6e0e12a286ecbf93f3cdf77b Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Mon, 10 Jul 2023 15:57:34 +0530 Subject: [PATCH] fix: tests --- test/passwordless/smsDelivery.test.js | 38 +++++++++++++++------------ 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/test/passwordless/smsDelivery.test.js b/test/passwordless/smsDelivery.test.js index 5a5afe333..55ad21cbe 100644 --- a/test/passwordless/smsDelivery.test.js +++ b/test/passwordless/smsDelivery.test.js @@ -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" }), @@ -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" }),