migration to vite/playwright

This commit is contained in:
JFH
2025-11-29 11:31:34 +01:00
parent babd3490c9
commit a37fbac749
186 changed files with 2699 additions and 13224 deletions

19
tests/locale.test.js Normal file
View File

@@ -0,0 +1,19 @@
import { describe, expect, test } from 'vitest'
import { putLocale, t } from '../src/editor/locale.js'
const goodLangs = ['en', 'fr', 'de']
describe('locale loader', () => {
test('falls back to English when lang is not supported', async () => {
const result = await putLocale('xx', goodLangs)
expect(result.langParam).toBe('en')
expect(t('common.ok')).toBe('OK')
})
test('loads explicit test locale bundle', async () => {
const result = await putLocale('test', goodLangs)
expect(result.langParam).toBe('test')
expect(t('common.ok')).toBe('OK')
expect(t('misc.powered_by')).toBe('Powered by')
})
})