Skip to content

Commit

Permalink
Added test for sign_up_with_oauth
Browse files Browse the repository at this point in the history
Flagged with #[ignore] as it is a duplicate of login_with_oauth
  • Loading branch information
Proziam committed Nov 16, 2024
1 parent 7c14a54 commit 2151318
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/client_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,34 @@ async fn sign_in_with_oauth_test() {
assert!(response.unwrap().url.to_string().len() > 1);
}

#[ignore]
#[tokio::test]
async fn sign_up_with_oauth_test() {
let auth_client = create_test_client();

let mut params = HashMap::new();
params.insert("key".to_string(), "value".to_string());
params.insert("second_key".to_string(), "second_value".to_string());
params.insert("third_key".to_string(), "third_value".to_string());

let options = SignInWithOAuthOptions {
query_params: Some(params),
redirect_to: Some("localhost".to_string()),
scopes: Some("repo gist notifications".to_string()),
skip_brower_redirect: Some(true),
};

let response = auth_client
.sign_up_with_oauth(supabase_auth::models::Provider::Github, Some(options))
.await;

if response.is_err() {
println!("SIGN IN WITH OAUTH TEST RESPONSE -- \n{:?}", response);
}

assert!(response.unwrap().url.to_string().len() > 1);
}

#[tokio::test]
async fn sign_in_with_oauth_no_options_test() {
let auth_client = create_test_client();
Expand Down

0 comments on commit 2151318

Please sign in to comment.