automerge/automerge-frontend/tests/test_wasm.rs
Andrew Jeffery fc45ff09a3
Allow change to return value from users closure (#84)
* Allow change to return value from users closure

* Add closure_result field to OptimisticChangeResult
2021-04-15 10:49:04 +01:00

15 lines
506 B
Rust

use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn test_simple_frontend_change_with_set_sequence() {
let mut f = automerge_frontend::Frontend::new_with_timestamper(Box::new(|| None));
f.change::<_, _, automerge_frontend::InvalidChangeRequest>(None, |doc| {
doc.add_change(automerge_frontend::LocalChange::set(
automerge_frontend::Path::root().key(""),
automerge_frontend::Value::Sequence(vec![]),
))
.unwrap();
Ok(())
})
.unwrap();
}