feat(web): HU | EN language switcher in the header (MITHOME-115)
A compact "HU | EN" switcher next to the theme toggle (desktop) and the menu button (mobile). Each link opens the current page in the other language with its translated slug (/hu/szolgaltatasok <-> /en/services), unknown pages fall back to the language's home. English is always offered (user decision), even before a page's English is approved. Links carry lang/hrefLang, the active one aria-current, and the group a localized accessible name. No flags: a flag marks a country, not a language. Unit and component tests plus staging smoke SMOKE-08. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8687ae28a2
commit
2bb9f122d5
@@ -75,6 +75,16 @@ test('SMOKE-07: external links on the homepage open in a new tab', async ({ page
|
||||
}
|
||||
})
|
||||
|
||||
// MITHOME-115: the language switcher keeps the current page (translated slug).
|
||||
test('SMOKE-08: language switcher opens the same page in the other language', async ({ page }) => {
|
||||
await page.goto('/hu/szolgaltatasok')
|
||||
const english = page.getByRole('group', { name: 'Nyelv kiválasztása' }).first().getByRole('link', { name: 'English' })
|
||||
await expect(english).toHaveAttribute('href', '/en/services')
|
||||
await english.click()
|
||||
await expect(page).toHaveURL(/\/en\/services$/)
|
||||
await expect(page.getByRole('group', { name: 'Choose language' }).first().getByRole('link', { name: 'Magyar' })).toHaveAttribute('href', '/hu/szolgaltatasok')
|
||||
})
|
||||
|
||||
test('SMOKE-05: empty contact form is blocked client-side without API submission', async ({ page }) => {
|
||||
let contactPostCount = 0
|
||||
page.on('request', request => {
|
||||
|
||||
Reference in New Issue
Block a user