AppFlowy/rust-lib/flowy-sdk/tests/sdk/user_check.rs

21 lines
519 B
Rust
Raw Normal View History

2021-06-30 15:11:27 +00:00
use super::helper::*;
use flowy_sys::prelude::*;
use flowy_user::prelude::*;
2021-07-02 12:47:52 +00:00
use tokio::time::{sleep, Duration};
2021-06-30 15:11:27 +00:00
#[test]
2021-07-03 06:14:10 +00:00
#[should_panic]
2021-06-30 15:11:27 +00:00
fn auth_check_no_payload() {
2021-07-03 06:14:10 +00:00
let resp = EventTester::new(AuthCheck).sync_send();
assert_eq!(resp.status, StatusCode::Ok);
2021-06-30 15:11:27 +00:00
}
2021-07-02 12:47:52 +00:00
#[tokio::test]
async fn auth_check_with_user_name_email_payload() {
2021-06-30 15:11:27 +00:00
let user_data = UserData::new("jack".to_owned(), "helloworld@gmail.com".to_owned());
2021-07-03 06:14:10 +00:00
EventTester::new(AuthCheck)
2021-06-30 15:11:27 +00:00
.bytes_payload(user_data)
2021-07-02 12:47:52 +00:00
.sync_send();
2021-06-30 15:11:27 +00:00
}