Skip to content

Commit fb764b3

Browse files
committed
test(web): translation sentinels and localized render smokes
1 parent e19c118 commit fb764b3

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

clients/web/src/i18n/catalogs.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,15 @@ describe('catalog sweep', () => {
7171
});
7272
}
7373
});
74+
75+
describe('no untranslated stubs', () => {
76+
for (const locale of SUPPORTED_LOCALES) {
77+
if (locale === 'en') continue;
78+
it(`${locale}: differs from English on sentinel keys`, () => {
79+
const catalog = ALL_CATALOGS[locale];
80+
expect(catalog.connect_lede).not.toBe(en.connect_lede);
81+
expect(catalog.upgrade_lede).not.toBe(en.upgrade_lede);
82+
expect(catalog.multihop_note).not.toBe(en.multihop_note);
83+
});
84+
}
85+
});

clients/web/src/pages/ConnectPage.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,13 @@ describe('<ConnectPage />', () => {
4949
).toBeInTheDocument();
5050
expect(screen.getByRole('link', { name: 'upgrade with FLUX' })).toBeInTheDocument();
5151
});
52+
53+
it('renders Spanish after the es catalog loads', async () => {
54+
renderPage('es');
55+
// The catalog chunk loads async; findBy* waits for the swap.
56+
expect(await screen.findByRole('button', { name: /\.conf/ })).toBeInTheDocument();
57+
const { es } = await import('../i18n/locales/es');
58+
expect(await screen.findByText(es.connect_choose_location as string)).toBeInTheDocument();
59+
expect(screen.queryByText('Choose a location')).not.toBeInTheDocument();
60+
});
5261
});

0 commit comments

Comments
 (0)