Home: read the German Recent Files heading from the catalog in its test

The test compares the German heading with the catalog's translation of
"Recent Files" instead of a fixed phrase, so a change to the German row
does not fail it. Without a German row, it checks that the framework's
heading stays.
This commit is contained in:
dotCooCoo committed 2026-12-03 10:01:44 -08:00
1 parent bf8c0978a5
commit 4ecd645b2a
1 file changed
+7 -1
+7 -1
View File
@@ -167,6 +167,7 @@ fn home_lists_recent_files_and_a_click_opens_one() {
/// The Home screen heads its recent files "Recent Files", in the interface language where the catalog translates it.
#[test]
fn home_heads_the_recent_files_recent_files() {
use crate::i18n::LangExt as _;
let shown = |lang: &str| {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default());
app.session.prefs.interface_language = lang.into();
@@ -177,7 +178,12 @@ fn home_heads_the_recent_files_recent_files() {
assert!(home.shows("Recent Files"), "the recent files are headed Recent Files");
assert!(!home.shows("Recent"), "not Recent alone");
let home = shown("de");
assert!(home.shows("Zuletzt geöffnete Dateien"), "German shows the catalog's Recent Files");
let german = crate::i18n::tr(crate::i18n::Lang::from_code("de").expect("German is registered"), "Recent Files");
if german == "Recent Files" {
assert!(!home.shows("Recent Files"), "without a catalog row German keeps the framework's heading");
} else {
assert!(home.shows(german), "German shows the catalog's Recent Files, {german}");
}
}
/// The Home screen has a Learn section: every tutorial of the Learn panel under its skill. A