From b7ce1617cd960db778f628e6b17ae9ff263bc17f Mon Sep 17 00:00:00 2001 From: Bartosz Sypytkowski Date: Tue, 25 Jun 2024 08:47:40 +0200 Subject: [PATCH] chore: fix appflowy indexer tests --- services/appflowy-indexer/src/consumer.rs | 24 ++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/services/appflowy-indexer/src/consumer.rs b/services/appflowy-indexer/src/consumer.rs index 4ea3b76f..3c44823e 100644 --- a/services/appflowy-indexer/src/consumer.rs +++ b/services/appflowy-indexer/src/consumer.rs @@ -427,13 +427,18 @@ mod test { let document = Document::create_with_data(collab.clone(), doc_data).unwrap(); let encoded_collab = document.encode_collab().unwrap(); - let _workspace_id = setup_collab(&db, uid, object_id, &encoded_collab).await; + let workspace_id = setup_collab(&db, uid, object_id, &encoded_collab).await; { let mut tx = db.begin().await.unwrap(); - let status = get_index_status(&mut tx, &object_id.to_string()) - .await - .unwrap(); + let status = get_index_status( + &mut tx, + &workspace_id, + &object_id.to_string(), + CollabType::Document as i32, + ) + .await + .unwrap(); assert_eq!( status, Some(false), @@ -455,9 +460,14 @@ mod test { { let mut tx = db.begin().await.unwrap(); - let status = get_index_status(&mut tx, &object_id.to_string()) - .await - .unwrap(); + let status = get_index_status( + &mut tx, + &workspace_id, + &object_id.to_string(), + CollabType::Document as i32, + ) + .await + .unwrap(); assert_eq!(status, Some(true), "collab should be indexed after start"); } }