2021-07-06 06:14:47 +00:00
|
|
|
use flowy_test::prelude::*;
|
|
|
|
use flowy_user::prelude::*;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[should_panic]
|
|
|
|
fn sign_in_without_password() {
|
|
|
|
let params = UserSignInParams {
|
|
|
|
email: "annie@appflowy.io".to_string(),
|
|
|
|
password: "".to_string(),
|
|
|
|
};
|
|
|
|
|
|
|
|
let result = EventTester::new(SignIn)
|
|
|
|
.payload(params)
|
|
|
|
.assert_status_code(StatusCode::Err)
|
|
|
|
.sync_send::<UserSignInResult>();
|
|
|
|
dbg!(&result);
|
|
|
|
}
|
|
|
|
|
2021-07-06 11:56:56 +00:00
|
|
|
#[test]
|
|
|
|
#[should_panic]
|
|
|
|
fn sign_in_with_invalid_password() {
|
|
|
|
let params = UserSignInParams {
|
|
|
|
email: "annie@appflowy.io".to_string(),
|
|
|
|
password: "123".to_string(),
|
|
|
|
};
|
|
|
|
|
|
|
|
let result = EventTester::new(SignIn)
|
|
|
|
.payload(params)
|
|
|
|
.assert_status_code(StatusCode::Err)
|
|
|
|
.sync_send::<UserSignInResult>();
|
|
|
|
dbg!(&result);
|
|
|
|
}
|
|
|
|
|
2021-07-06 06:14:47 +00:00
|
|
|
#[test]
|
|
|
|
#[should_panic]
|
|
|
|
fn sign_in_without_email() {
|
|
|
|
let params = UserSignInParams {
|
|
|
|
email: "".to_string(),
|
|
|
|
password: "HelloWorld!123".to_string(),
|
|
|
|
};
|
|
|
|
|
|
|
|
let result = EventTester::new(SignIn)
|
|
|
|
.payload(params)
|
|
|
|
.assert_status_code(StatusCode::Err)
|
|
|
|
.sync_send::<UserSignInResult>();
|
|
|
|
dbg!(&result);
|
|
|
|
}
|