add feature flowy_unit_test

This commit is contained in:
appflowy
2021-12-08 21:51:06 +08:00
parent 7ac55f29db
commit 6b338d4cc5
12 changed files with 217 additions and 105 deletions

View File

@ -2,6 +2,7 @@ use crate::{helper::ViewTest, FlowySDKTest};
use flowy_document::services::doc::edit::ClientDocEditor;
use flowy_document_infra::entities::doc::DocIdentifier;
use std::sync::Arc;
use tokio::time::Interval;
pub struct EditorTest {
pub sdk: FlowySDKTest,
@ -20,3 +21,12 @@ impl EditorTest {
self.sdk.flowy_document.open(doc_identifier).await.unwrap()
}
}
pub enum EditAction {
InsertText(&'static str, usize),
Delete(Interval),
Replace(Interval, &'static str),
Undo(),
Redo(),
AssertJson(&'static str),
}