From 6641e7aa5000fd9d63f9aa6c72c69740a6fcaaba Mon Sep 17 00:00:00 2001 From: CuriousCorrelation Date: Wed, 27 Oct 2021 17:57:25 +0530 Subject: [PATCH] Add tests for mini-dashboard status and assets --- meilisearch-http/tests/dashboard/mod.rs | 24 ++++++++++++++++++++++++ meilisearch-http/tests/integration.rs | 1 + 2 files changed, 25 insertions(+) create mode 100644 meilisearch-http/tests/dashboard/mod.rs diff --git a/meilisearch-http/tests/dashboard/mod.rs b/meilisearch-http/tests/dashboard/mod.rs new file mode 100644 index 000000000..d097cfd4b --- /dev/null +++ b/meilisearch-http/tests/dashboard/mod.rs @@ -0,0 +1,24 @@ +use crate::common::Server; + +#[actix_rt::test] +async fn dashboard_assets_load() { + let server = Server::new().await; + + mod generated { + include!(concat!(env!("OUT_DIR"), "/generated.rs")); + } + + let generated = generated::generate(); + + for (path, _) in generated.into_iter() { + let path = if path == "index.html" { + // "index.html" redirects to "/" + "/".to_owned() + } else { + "/".to_owned() + path + }; + + let (_, status_code) = server.service.get(&path).await; + assert_eq!(status_code, 200); + } +} diff --git a/meilisearch-http/tests/integration.rs b/meilisearch-http/tests/integration.rs index b414072d4..d827e7ac8 100644 --- a/meilisearch-http/tests/integration.rs +++ b/meilisearch-http/tests/integration.rs @@ -1,4 +1,5 @@ mod common; +mod dashboard; mod documents; mod index; mod search;