2021-07-11 07:33:19 +00:00
|
|
|
use crate::helper::*;
|
2021-07-16 15:18:12 +00:00
|
|
|
use flowy_user::{event::UserEvent::*, prelude::*};
|
2021-07-11 13:54:55 +00:00
|
|
|
use serial_test::*;
|
2021-07-14 13:12:52 +00:00
|
|
|
|
2021-07-11 07:33:19 +00:00
|
|
|
#[test]
|
2021-07-11 09:38:03 +00:00
|
|
|
#[should_panic]
|
2021-07-11 13:54:55 +00:00
|
|
|
#[serial]
|
2021-07-15 00:46:16 +00:00
|
|
|
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]
|
2021-07-11 13:54:55 +00:00
|
|
|
#[serial]
|
2021-07-15 00:46:16 +00:00
|
|
|
fn user_status_get_success_after_login() {
|
2021-07-11 09:38:03 +00:00
|
|
|
let request = SignInRequest {
|
2021-07-17 02:26:05 +00:00
|
|
|
email: random_valid_email(),
|
2021-07-11 09:38:03 +00:00
|
|
|
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>();
|
|
|
|
}
|