Expand AITURK Turkish settings and desktop surfaces for beta 5
This commit is contained in:
@@ -30,15 +30,15 @@ describe('I18nProvider', () => {
|
||||
vi.restoreAllMocks()
|
||||
})
|
||||
|
||||
it('defaults to English without a config client', () => {
|
||||
it('defaults to Turkish without a config client', () => {
|
||||
render(
|
||||
<I18nProvider configClient={null}>
|
||||
<LanguageProbe />
|
||||
</I18nProvider>
|
||||
)
|
||||
|
||||
expect(screen.getByTestId('locale').textContent).toBe('en')
|
||||
expect(screen.getByTestId('label').textContent).toBe('Language')
|
||||
expect(screen.getByTestId('locale').textContent).toBe('tr')
|
||||
expect(screen.getByTestId('label').textContent).toBe('Dil')
|
||||
})
|
||||
|
||||
it('normalizes an initial locale alias and switches translations', async () => {
|
||||
@@ -76,7 +76,7 @@ describe('I18nProvider', () => {
|
||||
expect(configClient.saveConfig).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('keeps English usable when config loading fails', async () => {
|
||||
it('keeps Turkish usable when config loading fails', async () => {
|
||||
const configClient: I18nConfigClient = {
|
||||
getConfig: vi.fn().mockRejectedValue(new Error('config unavailable')),
|
||||
saveConfig: vi.fn()
|
||||
@@ -90,8 +90,8 @@ describe('I18nProvider', () => {
|
||||
|
||||
await waitFor(() => expect(screen.getByTestId('loading').textContent).toBe('false'))
|
||||
|
||||
expect(screen.getByTestId('locale').textContent).toBe('en')
|
||||
expect(screen.getByTestId('label').textContent).toBe('Language')
|
||||
expect(screen.getByTestId('locale').textContent).toBe('tr')
|
||||
expect(screen.getByTestId('label').textContent).toBe('Dil')
|
||||
expect(configClient.saveConfig).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
@@ -147,8 +147,8 @@ describe('I18nProvider', () => {
|
||||
|
||||
await waitFor(() => expect(screen.getByTestId('loading').textContent).toBe('false'))
|
||||
|
||||
expect(screen.getByTestId('locale').textContent).toBe('en')
|
||||
expect(screen.getByTestId('label').textContent).toBe('Language')
|
||||
expect(screen.getByTestId('locale').textContent).toBe('tr')
|
||||
expect(screen.getByTestId('label').textContent).toBe('Dil')
|
||||
expect(configClient.saveConfig).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
@@ -217,14 +217,14 @@ describe('I18nProvider', () => {
|
||||
)
|
||||
|
||||
expect(screen.getByTestId('locale').textContent).toBe('ar')
|
||||
expect(document.documentElement.dir).toBe('rtl')
|
||||
expect(document.documentElement.lang).toBe('ar')
|
||||
expect(window.document.documentElement.dir).toBe('rtl')
|
||||
expect(window.document.documentElement.lang).toBe('ar')
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'switch' }))
|
||||
|
||||
await waitFor(() => expect(screen.getByTestId('locale').textContent).toBe('en'))
|
||||
expect(document.documentElement.dir).toBe('ltr')
|
||||
expect(document.documentElement.lang).toBe('en')
|
||||
expect(window.document.documentElement.dir).toBe('ltr')
|
||||
expect(window.document.documentElement.lang).toBe('en')
|
||||
})
|
||||
|
||||
it('rolls back the visible locale when saving fails', async () => {
|
||||
|
||||
Reference in New Issue
Block a user