From fdfb7c28c855784516079077da03a1ff806956ca Mon Sep 17 00:00:00 2001 From: "Santhosh Reddy Vootukuri (SUNNY) (from Dev Box)" Date: Thu, 8 Aug 2024 07:31:46 -0700 Subject: [PATCH] Improve Integration tests in the file stats.rs --- meilisearch/tests/index/stats.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/meilisearch/tests/index/stats.rs b/meilisearch/tests/index/stats.rs index d0b0a56b9..274a0ab17 100644 --- a/meilisearch/tests/index/stats.rs +++ b/meilisearch/tests/index/stats.rs @@ -3,13 +3,13 @@ use crate::json; #[actix_rt::test] async fn stats() { - let server = Server::new().await; - let index = server.index("test"); - let (_, code) = index.create(Some("id")).await; + let server = Server::new_shared().await; + let index = server.unique_index(); + let (task, code) = index.create(Some("id")).await; assert_eq!(code, 202); - index.wait_task(0).await; + index.wait_task(task.uid()).await.succeeded(); let (response, code) = index.stats().await; @@ -33,7 +33,7 @@ async fn stats() { assert_eq!(code, 202); assert_eq!(response["taskUid"], 1); - index.wait_task(1).await; + index.wait_task(response.uid()).await.succeeded(); let (response, code) = index.stats().await; @@ -47,8 +47,8 @@ async fn stats() { #[actix_rt::test] async fn error_get_stats_unexisting_index() { - let server = Server::new().await; - let (response, code) = server.index("test").stats().await; + let server = Server::new_shared().await; + let (response, code) = server.unique_index().stats().await; let expected_response = json!({ "message": "Index `test` not found.",