Localize macOS application menu and correct AITURK package checks
This commit is contained in:
@@ -6,7 +6,10 @@ import { expect, test } from './test'
|
||||
|
||||
let fixture: MockBackendFixture | null = null
|
||||
type DesktopTestWindow = Window & {
|
||||
hermesDesktop: { api<T = unknown>(request: { path: string }): Promise<T> }
|
||||
hermesDesktop: {
|
||||
api<T = unknown>(request: { path: string }): Promise<T>
|
||||
setUiLanguage(locale: string): void
|
||||
}
|
||||
}
|
||||
|
||||
test.beforeAll(async () => {
|
||||
@@ -75,3 +78,20 @@ test('Turkish safety settings persist the backend enum through the real desktop
|
||||
await expect(approvals.getByRole('combobox')).toContainText('Elle onayla')
|
||||
await page.screenshot({ path: test.info().outputPath('turkish-safety-settings.png'), fullPage: true })
|
||||
})
|
||||
|
||||
test('native language bridge updates the Mac menu and preserves menu-free Windows', async () => {
|
||||
const { app, page } = fixture!
|
||||
const platform = await app.evaluate(() => process.platform)
|
||||
for (const locale of ['en', 'tr']) {
|
||||
await page.evaluate(language => {
|
||||
;(window as unknown as DesktopTestWindow).hermesDesktop.setUiLanguage(language)
|
||||
}, locale)
|
||||
await expect
|
||||
.poll(() => app.evaluate(({ Menu }) => Menu.getApplicationMenu()?.items.map((item: { label: string }) => item.label) ?? null))
|
||||
.toEqual(
|
||||
platform === 'darwin'
|
||||
? expect.arrayContaining([locale === 'tr' ? 'Dosya' : 'File', locale === 'tr' ? 'Düzen' : 'Edit'])
|
||||
: null
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user