41 lines
820 B
Rust
Raw Normal View History

2021-07-17 08:24:17 +08:00
pub mod builder;
2021-07-16 23:18:12 +08:00
mod helper;
use crate::helper::*;
use flowy_sdk::FlowySDK;
use flowy_user::entities::UserDetail;
2021-07-06 14:14:47 +08:00
pub mod prelude {
2021-09-04 15:12:53 +08:00
pub use crate::{builder::*, helper::*, *};
2021-07-08 21:23:44 +08:00
pub use flowy_dispatch::prelude::*;
2021-07-06 14:14:47 +08:00
}
2021-09-04 15:12:53 +08:00
pub type FlowyTestSDK = FlowySDK;
#[derive(Clone)]
pub struct FlowyEnv {
pub sdk: FlowyTestSDK,
pub user: UserDetail,
pub password: String,
2021-09-04 15:12:53 +08:00
}
impl FlowyEnv {
pub fn setup() -> Self {
let sdk = init_test_sdk();
let result = sign_up(sdk.dispatch());
let env = Self {
sdk,
user: result.user_detail,
password: result.password,
};
env
2021-09-04 15:12:53 +08:00
}
pub fn sdk(&self) -> FlowyTestSDK { self.sdk.clone() }
2021-09-04 15:12:53 +08:00
}
pub fn init_test_sdk() -> FlowyTestSDK {
let root_dir = root_dir();
FlowySDK::new(&root_dir)
2021-07-06 14:14:47 +08:00
}