From 0991cb0de410b607b5736aed445ff34f6eb1af40 Mon Sep 17 00:00:00 2001 From: Timon Jurschitsch Date: Tue, 21 Jan 2025 17:01:45 +0100 Subject: [PATCH] change list_multiple_indexes test to single server --- crates/meilisearch/tests/index/get_index.rs | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/crates/meilisearch/tests/index/get_index.rs b/crates/meilisearch/tests/index/get_index.rs index 70acbcdb1..9ef089c78 100644 --- a/crates/meilisearch/tests/index/get_index.rs +++ b/crates/meilisearch/tests/index/get_index.rs @@ -52,25 +52,19 @@ async fn no_index_return_empty_list() { #[actix_rt::test] async fn list_multiple_indexes() { - let server = Server::new_shared(); - let index1 = server.unique_index(); - let index2 = server.unique_index(); + let server = Server::new().await; + server.index("test").create(None).await; + let (task, _status_code) = server.index("test1").create(Some("key")).await; - let (_task1, _) = index1.create(None).await; - let (task2, _) = index2.create(Some("key")).await; - - index1.wait_task(task2.uid()).await.succeeded(); + server.index("test").wait_task(task.uid()).await.succeeded(); let (response, code) = server.list_indexes(None, None).await; - dbg!(response.clone()); assert_eq!(code, 200); assert!(response["results"].is_array()); let arr = response["results"].as_array().unwrap(); - assert!(arr.len() >= 2); - assert!(arr - .iter() - .any(|entry| entry["uid"] == index1.uid && entry["primaryKey"] == Value::Null)); - assert!(arr.iter().any(|entry| entry["uid"] == index2.uid && entry["primaryKey"] == "key")); + assert_eq!(arr.len(), 2); + assert!(arr.iter().any(|entry| entry["uid"] == "test" && entry["primaryKey"] == Value::Null)); + assert!(arr.iter().any(|entry| entry["uid"] == "test1" && entry["primaryKey"] == "key")); } #[actix_rt::test]