Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ private void ShowOutput(string message)
Output.text = message;
}
}
}
}
11 changes: 7 additions & 4 deletions sample/Tests/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,17 @@ def test_2_imx_functions(self):
print(f"RegisterOffchainBtn output: {text}")
self.assertEqual("Registering off-chain...", text)
time.sleep(20)
if "Passport account already registered" in output.get_text():
output_text = output.get_text()
# Accept either success message or 409 error (account already registered)
if "Successfully registered" in output_text or ("409" in output_text and "USER_REGISTRATION_ERROR" in output_text):
break
attempts += 1

# Assert that the desired text is found after waiting
# Assert that registration completed (either success or 409 error for already registered)
output_text = output.get_text()
self.assertTrue(
"Passport account already registered" in output.get_text(),
f"Expected 'Passport account already registered' not found. Actual output: '{output.get_text()}'"
"Successfully registered" in output_text or ("409" in output_text and "USER_REGISTRATION_ERROR" in output_text),
f"Expected 'Successfully registered' or '409 (USER_REGISTRATION_ERROR)' not found. Actual output: '{output_text}'"
)

# Get address
Expand Down
406 changes: 356 additions & 50 deletions src/Packages/Passport/Runtime/Resources/index.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Immutable.Passport.Model
public enum MarketingConsentStatus
{
OptedIn,
Subscribed,
Unsubscribed
}

Expand All @@ -27,6 +28,7 @@ public static string ToApiString(this MarketingConsentStatus status)
return status switch
{
MarketingConsentStatus.OptedIn => "opted_in",
MarketingConsentStatus.Subscribed => "subscribed",
MarketingConsentStatus.Unsubscribed => "unsubscribed",
_ => throw new ArgumentOutOfRangeException(nameof(status), status, "Unknown MarketingConsentStatus value")
};
Expand Down
3 changes: 3 additions & 0 deletions src/Packages/Passport/Runtime/Scripts/Public/PassportUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,9 @@ private async void HandleLoginData(string jsonData)
case "opted_in":
loginOptions.marketingConsentStatus = MarketingConsentStatus.OptedIn;
break;
case "subscribed":
loginOptions.marketingConsentStatus = MarketingConsentStatus.Subscribed;
break;
case "unsubscribed":
loginOptions.marketingConsentStatus = MarketingConsentStatus.Unsubscribed;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ private void ShowOutput(string message)
Output.text = message;
}
}
}
}
Loading