Add auth tests
This commit is contained in:
parent
8ea0cc3f3f
commit
8f123c2054
|
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue