fix(ui): logic for showing copyToLocale button and adds test (#11584)
### What? This [PR](https://github.com/payloadcms/payload/pull/11546) introduced a bug where the `CopyToLocale` button can show up when localization is false. ### Why? `const disableCopyToLocale = localization && collectionConfig?.admin?.disableCopyToLocale` this line was faulty ### How? Fixed the logic and added test to confirm button doesn't show when localization is false.
This commit is contained in:
committed by
GitHub
parent
6f90d62fc2
commit
a53876d741
@@ -80,6 +80,15 @@ test.describe('Admin Panel (Root)', () => {
|
||||
await expect(firstRow).toBeVisible()
|
||||
})
|
||||
|
||||
test('collection - should hide Copy To Locale button when localization is false', async () => {
|
||||
await page.goto(url.create)
|
||||
const textField = page.locator('#field-text')
|
||||
await textField.fill('test')
|
||||
await saveDocAndAssert(page)
|
||||
await page.locator('.doc-controls__popup >> .popup-button').click()
|
||||
await expect(page.locator('#copy-locale-data__button')).toBeHidden()
|
||||
})
|
||||
|
||||
test('global — navigates to edit view', async () => {
|
||||
await page.goto(url.global('menu'))
|
||||
const pageURL = page.url()
|
||||
|
||||
Reference in New Issue
Block a user