MCPcopy Create free account
hub / github.com/AppFlowy-IO/AppFlowy-Collab / assert_collab

Method assert_collab

collab/tests/plugins/disk/script.rs:210–233  ·  view source on GitHub ↗
(&mut self, id: &str, expected: JsonValue)

Source from the content-addressed store, hash-verified

208 }
209
210 pub async fn assert_collab(&mut self, id: &str, expected: JsonValue) {
211 let object_id =
212 Uuid::parse_str(id).unwrap_or_else(|_| Uuid::new_v5(&Uuid::NAMESPACE_OID, id.as_bytes()));
213 let disk_plugin = disk_plugin_with_db(
214 self.uid,
215 self.workspace_id.clone(),
216 self.db.clone(),
217 &object_id.to_string(),
218 CollabType::Document,
219 );
220 let data_source = KVDBCollabPersistenceImpl {
221 db: Arc::downgrade(&self.db),
222 uid: self.uid,
223 workspace_id: self.workspace_id.clone(),
224 };
225
226 let options =
227 CollabOptions::new(object_id, default_client_id()).with_data_source(data_source.into());
228 let mut collab = Collab::new_with_options(CollabOrigin::Empty, options).unwrap();
229 collab.add_plugin(Box::new(disk_plugin));
230 collab.initialize();
231 let json = collab.to_json_value();
232 assert_json_diff::assert_json_eq!(json, expected);
233 }
234
235 pub async fn undo(&mut self, id: &str) {
236 self

Callers 3

Calls 7

disk_plugin_with_dbFunction · 0.85
default_client_idFunction · 0.85
as_bytesMethod · 0.80
with_data_sourceMethod · 0.80
add_pluginMethod · 0.80
initializeMethod · 0.80
to_json_valueMethod · 0.45

Tested by

no test coverage detected