docs: filterAvailableLocales (#11031)

Adding documentation and tests missing in PR #11007

---------

Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
Co-authored-by: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com>
This commit is contained in:
Dan Ribbens
2025-02-12 14:48:12 -05:00
committed by GitHub
parent 6bfa66c9ff
commit 3131dba039
4 changed files with 52 additions and 8 deletions

View File

@@ -97,7 +97,7 @@ describe('Localization', () => {
// })
})
describe('localizer', async () => {
describe('localizer', () => {
test('should show localizer controls', async () => {
await page.goto(url.create)
await expect(page.locator('.localizer.app-header__localizer')).toBeVisible()
@@ -105,6 +105,13 @@ describe('Localization', () => {
await expect(page.locator('.localizer .popup.popup--active')).toBeVisible()
})
test('should filter locale with filterAvailableLocales', async () => {
await page.goto(url.create)
await expect(page.locator('.localizer.app-header__localizer')).toBeVisible()
await page.locator('.localizer >> button').first().click()
await expect(page.locator('.localizer .popup.popup--active')).not.toContainText('FILTERED')
})
test('should disable control for active locale', async () => {
await page.goto(url.create)
@@ -472,7 +479,7 @@ describe('Localization', () => {
await runCopy(page)
await expect(page.locator('#field-title')).toHaveValue(title)
const regexPattern = new RegExp(`locale=es`)
const regexPattern = /locale=es/
await expect(page).toHaveURL(regexPattern)
await openCopyToLocaleDrawer(page)