Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

test(a11y): drive the RTL layout test off the real ar catalog instead of a mocked manifest

nirholasb81fa6d78758
diff --git a/tests/e2e/home-a11y.spec.js b/tests/e2e/home-a11y.spec.js
index 8c9a1b31a..d610e3b38 100644
--- a/tests/e2e/home-a11y.spec.js
+++ b/tests/e2e/home-a11y.spec.js
@@ -381,38 +381,13 @@ test('a Fahrenheit house reads in Fahrenheit whatever the browser locale is', as
}
});
-/**
- * Publish a locale to THIS page only, so the runtime can pick it.
- *
- * /i18n.js reads /locales/manifest.json as the allowlist for `?lang=`, and
- * scripts/i18n-translate.mjs only lists a locale there once its catalog is
- * complete, which is the right rule: a half-translated language in the picker
- * renders as English with a foreign heading. It also means a locale with a
- * translation backlog cannot be exercised at all, and the layout question this
- * file asks (does the lane use logical properties) is not the same question as
- * the catalog question.
- *
- * So the manifest ENTRY is the only thing faked. Everything else is the real
- * runtime doing its real work: it reads `?lang=`, sets `lang` and `dir` on the
- * document, fetches the committed public/locales/ar.json off disk and swaps the
- * DOM from it. A hand-set `dir` attribute would prove none of that.
- */
-async function publishLocale(page, code, dir) {
- await page.route('**/locales/manifest.json', (route) =>
- route.fulfill({
- status: 200,
- contentType: 'application/json',
- body: JSON.stringify({ default: 'en', locales: [{ code: 'en', name: 'English', dir: 'ltr' }, { code, name: code, dir }] }),
- }),
- );
-}
-
test('an RTL locale lays the house out right to left without breaking it', async ({ page }) => {
await signIn(page, 'owner');
// A real RTL locale from public/locales, driven the way a visitor drives it,
// not a CSS override: the point is that the runtime sets dir and the layout
- // answers, which a hand-set attribute would prove nothing about.
- await publishLocale(page, 'ar', 'rtl');
+ // answers, which a hand-set attribute would prove nothing about. `ar` is a
+ // complete catalog listed in the real /locales/manifest.json, so /i18n.js
+ // accepts `?lang=ar` off the disk with nothing faked.
await page.goto(`/smart-home/${homeId}?view=2d&lang=ar`, { waitUntil: 'domcontentloaded' });
await expect(page.locator('#hs-rooms')).not.toHaveAttribute('aria-busy', 'true', { timeout: 120_000 });
await expect(page.locator('html')).toHaveAttribute('dir', 'rtl', { timeout: 60_000 });
@@ -438,7 +413,6 @@ test("a user's own device names are never translated", async ({ page }) => {
await signIn(page, 'owner');
const light = await anyLight(instance);
- await publishLocale(page, 'ar', 'rtl');
const seen = [];
for (const lang of ['en', 'ar']) {
await page.goto(`/smart-home/${homeId}?view=2d&lang=${lang}`, { waitUntil: 'domcontentloaded' });