1. rename flowy_str functions

2. mv the document_test to flowy_document crate
This commit is contained in:
appflowy
2022-01-08 18:21:13 +08:00
parent 1e0cef41a9
commit c456687a18
23 changed files with 140 additions and 112 deletions

View File

@ -1,14 +1,11 @@
pub mod doc_script;
pub mod event_builder;
pub mod helper;
use crate::helper::*;
use backend_service::configuration::{get_client_server_configuration, ClientServerConfiguration};
use flowy_net::services::ws_conn::FlowyRawWebSocket;
use flowy_sdk::{FlowySDK, FlowySDKConfig};
use flowy_user::entities::UserProfile;
use lib_infra::uuid_string;
use std::sync::Arc;
pub mod prelude {
pub use crate::{event_builder::*, helper::*, *};
@ -18,7 +15,6 @@ pub mod prelude {
#[derive(Clone)]
pub struct FlowySDKTest {
pub inner: FlowySDK,
pub ws: Option<Arc<dyn FlowyRawWebSocket>>,
}
impl std::ops::Deref for FlowySDKTest {
@ -30,18 +26,18 @@ impl std::ops::Deref for FlowySDKTest {
impl std::default::Default for FlowySDKTest {
fn default() -> Self {
let server_config = get_client_server_configuration().unwrap();
let sdk = Self::new(server_config, None);
let sdk = Self::new(server_config);
std::mem::forget(sdk.dispatcher());
sdk
}
}
impl FlowySDKTest {
pub fn new(server_config: ClientServerConfiguration, ws: Option<Arc<dyn FlowyRawWebSocket>>) -> Self {
pub fn new(server_config: ClientServerConfiguration) -> Self {
let config = FlowySDKConfig::new(&root_dir(), server_config, &uuid_string()).log_filter("debug");
let sdk = FlowySDK::new(config);
std::mem::forget(sdk.dispatcher());
Self { inner: sdk, ws }
Self { inner: sdk }
}
pub async fn sign_up(&self) -> SignUpContext {