From d3c796af380be64548c5957067d22584772ac9c2 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 18 Jan 2023 15:50:36 +0100 Subject: [PATCH] Add a new test to check that invalid canceledBy works correctly --- meilisearch/tests/tasks/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/meilisearch/tests/tasks/mod.rs b/meilisearch/tests/tasks/mod.rs index d44381729..2b429f798 100644 --- a/meilisearch/tests/tasks/mod.rs +++ b/meilisearch/tests/tasks/mod.rs @@ -151,6 +151,21 @@ async fn list_tasks_type_filtered() { assert_eq!(response["results"].as_array().unwrap().len(), 2); } +#[actix_rt::test] +async fn list_tasks_invalid_canceled_by_filter() { + let server = Server::new().await; + let index = server.index("test"); + index.create(None).await; + index.wait_task(0).await; + index + .add_documents(serde_json::from_str(include_str!("../assets/test_set.json")).unwrap(), None) + .await; + + let (response, code) = index.filtered_tasks(&[], &[], &["0"]).await; + assert_eq!(code, 200, "{}", response); + assert_eq!(response["results"].as_array().unwrap().len(), 0); +} + #[actix_rt::test] async fn list_tasks_status_and_type_filtered() { let server = Server::new().await;