mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
23 lines
654 B
Rust
23 lines
654 B
Rust
use crate::{helper::ViewTest, FlowySDKTest};
|
|
use flowy_document::services::doc::edit::ClientDocEditor;
|
|
use flowy_document_infra::entities::doc::DocIdentifier;
|
|
use std::sync::Arc;
|
|
|
|
pub struct EditorTest {
|
|
pub sdk: FlowySDKTest,
|
|
}
|
|
|
|
impl EditorTest {
|
|
pub async fn new() -> Self {
|
|
let sdk = FlowySDKTest::setup();
|
|
let _ = sdk.init_user().await;
|
|
Self { sdk }
|
|
}
|
|
|
|
pub async fn create_doc(&self) -> Arc<ClientDocEditor> {
|
|
let test = ViewTest::new(&self.sdk).await;
|
|
let doc_identifier: DocIdentifier = test.view.id.clone().into();
|
|
self.sdk.flowy_document.open(doc_identifier).await.unwrap()
|
|
}
|
|
}
|