AppFlowy/rust-lib/flowy-user/tests/event/user_status_test.rs

37 lines
775 B
Rust
Raw Normal View History

use crate::helper::*;
2021-07-16 15:18:12 +00:00
use flowy_user::{event::UserEvent::*, prelude::*};
use serial_test::*;
#[test]
2021-07-11 09:38:03 +00:00
#[should_panic]
#[serial]
fn user_status_get_failed_before_login() {
2021-07-14 15:00:58 +00:00
let _ = UserTestBuilder::new()
.logout()
.event(GetStatus)
2021-07-11 09:38:03 +00:00
.sync_send()
.parse::<UserDetail>();
}
#[test]
#[serial]
fn user_status_get_success_after_login() {
2021-07-11 09:38:03 +00:00
let request = SignInRequest {
email: valid_email(),
password: valid_password(),
};
2021-07-14 15:00:58 +00:00
let response = UserTestBuilder::new()
.logout()
.event(SignIn)
2021-07-11 09:38:03 +00:00
.request(request)
.sync_send()
.parse::<UserDetail>();
dbg!(&response);
2021-07-14 15:00:58 +00:00
let _ = UserTestBuilder::new()
.event(GetStatus)
2021-07-11 09:38:03 +00:00
.sync_send()
.parse::<UserDetail>();
}