From 4e1024b34a3b9468adcf4874c2151781e28d077b Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Sat, 27 May 2023 22:46:50 +0200 Subject: [PATCH] Add auth tests --- tests/auth.rs | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tests/auth.rs diff --git a/tests/auth.rs b/tests/auth.rs new file mode 100644 index 0000000..2b52cea --- /dev/null +++ b/tests/auth.rs @@ -0,0 +1,42 @@ +mod common; + +use chorus::types; + +#[tokio::test] +async fn test_registration() { + let mut bundle = common::setup().await; + let reg = types::RegisterSchema::new( + "Hiiii".to_string(), + None, + true, + None, + None, + None, + Some("2000-01-01".to_string()), + None, + None, + None, + ) + .unwrap(); + bundle.instance.register_account(®).await.unwrap(); + common::teardown(bundle).await; +} + +#[tokio::test] +async fn test_login() { + let mut bundle = common::setup().await; + let login_schema = types::LoginSchema::new( + "integrationtestuser".to_string(), + None, + Some(false), + None, + None, + None, + ); + bundle + .instance + .login_account(&login_schema.unwrap()) + .await + .unwrap(); + common::teardown(bundle).await; +}