mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
35 lines
1.1 KiB
Rust
35 lines
1.1 KiB
Rust
use crate::document::helper::{DocScript, DocumentTest};
|
|
|
|
#[actix_rt::test]
|
|
async fn edit_doc_insert_text() {
|
|
let test = DocumentTest::new().await;
|
|
test.run_scripts(vec![
|
|
DocScript::SendText(0, "abc"),
|
|
DocScript::SendText(3, "123"),
|
|
DocScript::SendText(6, "efg"),
|
|
DocScript::AssertClient(r#"[{"insert":"abc123efg\n"}]"#),
|
|
DocScript::AssertServer(r#"[{"insert":"abc123efg\n"}]"#),
|
|
])
|
|
.await;
|
|
}
|
|
|
|
#[actix_rt::test]
|
|
async fn edit_doc_insert_large_text() {
|
|
let test = DocumentTest::new().await;
|
|
|
|
test.run_scripts(vec![
|
|
DocScript::ConnectWs,
|
|
DocScript::SendText(0, "abc"),
|
|
DocScript::SendText(0, "abc"),
|
|
DocScript::SendText(0, "abc"),
|
|
DocScript::SendText(0, "abc"),
|
|
DocScript::SendText(0, "abc"),
|
|
DocScript::SendText(0, "abc"),
|
|
DocScript::SendText(0, "abc"),
|
|
DocScript::SendText(0, "abc"),
|
|
/* DocScript::AssertClient(r#"[{"insert":"abc123efg\n"}]"#),
|
|
* DocScript::AssertServer(r#"[{"insert":"abc123efg\n"}]"#), */
|
|
])
|
|
.await;
|
|
}
|