Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

test(desktop): follow extracted renderer language helpers

vastsa8ab3c20e7f2b
diff --git a/apps/desktop/test/renderer-branding.test.mjs b/apps/desktop/test/renderer-branding.test.mjs
index 5f64f4bb7..52dc031cb 100644
--- a/apps/desktop/test/renderer-branding.test.mjs
+++ b/apps/desktop/test/renderer-branding.test.mjs
@@ -17,7 +17,7 @@ const [
composer,
styles,
mascotLogo,
- appLanguage,
+ rendererLanguage,
] = await Promise.all([
read("../../../packages/i18n/src/locales/en/index.ts"),
read("../../../packages/i18n/src/locales/zh-CN/index.ts"),
@@ -29,7 +29,7 @@ const [
readComposerSource(),
loadStyles(),
read("../src/components/HomeMascotLogo.tsx"),
- read("../src/lib/app-language.ts"),
+ read("../src/lib/renderer-language.ts"),
]);
test("renderer surfaces the PI-Desktop brand instead of the Codex shell brand", () => {
@@ -94,7 +94,10 @@ test("app chrome uses the shared brand asset without branding the composer input
styles,
/@media \(prefers-reduced-motion: reduce\)[\s\S]*?\.home-mascot-still\.home-mascot-dark,[\s\S]*?\.home-mascot-still\.home-mascot-light[\s\S]*?display:\s*block;/,
);
- assert.match(appLanguage, /document\.documentElement\.lang\s*=\s*target/);
+ assert.match(
+ rendererLanguage,
+ /if \(request === languageRequest\)\s*document\.documentElement\.lang = target/,
+ );
assert.doesNotMatch(styles, /@keyframes home-mascot-orbit|@keyframes home-mascot-breathe|@keyframes home-mascot-blink/);
assert.doesNotMatch(styles, /background-size:\s*5000px 100px|image-rendering:\s*pixelated/);
assert.doesNotMatch(composer, /<BrandLogo/);
diff --git a/apps/desktop/test/renderer-review-fixes.test.mjs b/apps/desktop/test/renderer-review-fixes.test.mjs
index e399627ba..5fd7049bd 100644
--- a/apps/desktop/test/renderer-review-fixes.test.mjs
+++ b/apps/desktop/test/renderer-review-fixes.test.mjs
@@ -48,7 +48,7 @@ test("screenshot fixtures stay out of the production App bundle", () => {
test("the crash fallback never interprets the error as markup", () => {
assert.doesNotMatch(main, /innerHTML/);
assert.match(main, /detail\.textContent = String\(error\);/);
- assert.match(main, /heading\.textContent = crashCatalog\.app\.uiCrashed;/);
+ assert.match(main, /heading\.textContent = i18n\.t\("app\.uiCrashed"/);
});
test("window controls draw through the icon wrappers", () => {
diff --git a/apps/desktop/test/startup-splash-motion.test.mjs b/apps/desktop/test/startup-splash-motion.test.mjs
index 10967754f..e9108482b 100644
--- a/apps/desktop/test/startup-splash-motion.test.mjs
+++ b/apps/desktop/test/startup-splash-motion.test.mjs
@@ -54,7 +54,7 @@ test("crash and empty-home title copy is catalog-backed in English and Chinese",
assert.match(english, /uiCrashed:\s*"Something went wrong with the interface"/);
assert.match(chinese, /uiCrashed:\s*"界面出现了问题"/);
assert.match(app, /i18n\.t\("app\.uiCrashed"\)/);
- assert.match(main, /crashCatalog\.app\.uiCrashed/);
+ assert.match(main, /i18n\.t\("app\.uiCrashed"/);
assert.doesNotMatch(main, /PI-Desktop failed to start UI/);
assert.match(chinese, /emptyTitle:\s*"今天想做点什么?"/);
assert.match(english, /emptyTitleTemporary:\s*"What would you like to explore temporarily\?"/);