From 3de36ad1eda690a9a679cb1d9d5170e3098db217 Mon Sep 17 00:00:00 2001 From: Ankit Tiwari Date: Mon, 20 Nov 2023 18:25:38 +0530 Subject: [PATCH] fix: Fix testUpdateNumber test (#886) --- .../supertokens/test/passwordless/api/MultitenantAPITest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/io/supertokens/test/passwordless/api/MultitenantAPITest.java b/src/test/java/io/supertokens/test/passwordless/api/MultitenantAPITest.java index 632736e69..7b13a4990 100644 --- a/src/test/java/io/supertokens/test/passwordless/api/MultitenantAPITest.java +++ b/src/test/java/io/supertokens/test/passwordless/api/MultitenantAPITest.java @@ -571,7 +571,8 @@ public void testUpdateNumber() throws Exception { String newPhoneNumber = generateRandomNumber(8); updatePhoneNumber(tenant, user.getAsJsonPrimitive("id").getAsString(), newPhoneNumber); user.remove("phoneNumber"); - user.addProperty("phoneNumber", newPhoneNumber); + // We need to normalize the phone number before adding it to the user object, as the update API performs normalization. + user.addProperty("phoneNumber", io.supertokens.utils.Utils.normalizeIfPhoneNumber(newPhoneNumber)); assertEquals(user, signInUpNumberUsingUserInputCode(userTenant, newPhoneNumber)); }