Fix tests

This commit is contained in:
Louis Dureuil 2025-01-13 13:31:48 +01:00
parent 03097e65e8
commit cb8f033130
No known key found for this signature in database
2 changed files with 16 additions and 2 deletions

View File

@ -78,6 +78,7 @@ async fn import_dump_v1_movie_raw() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -243,6 +244,7 @@ async fn import_dump_v1_movie_with_settings() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -394,6 +396,7 @@ async fn import_dump_v1_rubygems_with_settings() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -531,6 +534,7 @@ async fn import_dump_v2_movie_raw() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -680,6 +684,7 @@ async fn import_dump_v2_movie_with_settings() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -828,6 +833,7 @@ async fn import_dump_v2_rubygems_with_settings() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -965,6 +971,7 @@ async fn import_dump_v3_movie_raw() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -1114,6 +1121,7 @@ async fn import_dump_v3_movie_with_settings() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -1262,6 +1270,7 @@ async fn import_dump_v3_rubygems_with_settings() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -1399,6 +1408,7 @@ async fn import_dump_v4_movie_raw() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -1548,6 +1558,7 @@ async fn import_dump_v4_movie_with_settings() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -1696,6 +1707,7 @@ async fn import_dump_v4_rubygems_with_settings() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,
@ -1944,6 +1956,7 @@ async fn import_dump_v6_containing_experimental_features() {
"pagination": { "pagination": {
"maxTotalHits": 1000 "maxTotalHits": 1000
}, },
"embedders": {},
"searchCutoffMs": null, "searchCutoffMs": null,
"localizedAttributes": null, "localizedAttributes": null,
"facetSearch": true, "facetSearch": true,

View File

@ -152,7 +152,7 @@ test_setting_routes!(
{ {
setting: embedders, setting: embedders,
update_verb: patch, update_verb: patch,
default_value: null default_value: {}
}, },
{ {
setting: facet_search, setting: facet_search,
@ -197,7 +197,7 @@ async fn get_settings() {
let (response, code) = index.settings().await; let (response, code) = index.settings().await;
assert_eq!(code, 200); assert_eq!(code, 200);
let settings = response.as_object().unwrap(); let settings = response.as_object().unwrap();
assert_eq!(settings.keys().len(), 19); assert_eq!(settings.keys().len(), 20);
assert_eq!(settings["displayedAttributes"], json!(["*"])); assert_eq!(settings["displayedAttributes"], json!(["*"]));
assert_eq!(settings["searchableAttributes"], json!(["*"])); assert_eq!(settings["searchableAttributes"], json!(["*"]));
assert_eq!(settings["filterableAttributes"], json!([])); assert_eq!(settings["filterableAttributes"], json!([]));
@ -230,6 +230,7 @@ async fn get_settings() {
assert_eq!(settings["searchCutoffMs"], json!(null)); assert_eq!(settings["searchCutoffMs"], json!(null));
assert_eq!(settings["prefixSearch"], json!("indexingTime")); assert_eq!(settings["prefixSearch"], json!("indexingTime"));
assert_eq!(settings["facetSearch"], json!(true)); assert_eq!(settings["facetSearch"], json!(true));
assert_eq!(settings["embedders"], json!({}));
} }
#[actix_rt::test] #[actix_rt::test]