test(arr): read available_engines from the build
Second test that assumed the empty default feature set. It asserted available_engines was literally [], which --all-features makes false.
This commit is contained in:
@@ -255,7 +255,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn the_seeded_row_reads_back_with_no_engines_compiled() {
|
async fn the_seeded_row_reads_back_with_the_engines_this_build_compiled() {
|
||||||
let (_dir, base) = application().await;
|
let (_dir, base) = application().await;
|
||||||
let settings: serde_json::Value = reqwest::get(format!("{base}/api/settings/subtitles"))
|
let settings: serde_json::Value = reqwest::get(format!("{base}/api/settings/subtitles"))
|
||||||
.await
|
.await
|
||||||
@@ -272,7 +272,12 @@ mod tests {
|
|||||||
serde_json::json!(["opensubtitles", "podnapisi"])
|
serde_json::json!(["opensubtitles", "podnapisi"])
|
||||||
);
|
);
|
||||||
assert!(settings["translation_engine"].is_null());
|
assert!(settings["translation_engine"].is_null());
|
||||||
assert_eq!(settings["available_engines"], serde_json::json!([]));
|
// `available_engines` is a fact about the build, not about the seed
|
||||||
|
// row, so it tracks the `translate-*` features rather than a literal.
|
||||||
|
assert_eq!(
|
||||||
|
settings["available_engines"],
|
||||||
|
serde_json::json!(arr_subs::compiled_engines())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|||||||
Reference in New Issue
Block a user