fix: depth field in api view throws error when no value present (#6106)

This commit is contained in:
Jessica Chowdhury
2024-05-14 14:46:16 +01:00
committed by GitHub
parent 48af78278d
commit fcee13b017
2 changed files with 10 additions and 1 deletions

View File

@@ -312,6 +312,15 @@ describe('admin', () => {
await expect(page.locator('#field-sidebarField')).toBeDisabled()
})
test('collection — depth field should have value 0 when empty', async () => {
const { id } = await createPost()
await page.goto(`${postsUrl.edit(id)}/api`)
const depthField = page.locator('#field-depth')
await depthField.fill('')
await expect(depthField).toHaveValue('0')
})
test('global — should not show API tab when disabled in config', async () => {
await page.goto(postsUrl.global(noApiViewGlobalSlug))
await expect(page.locator('.doc-tabs__tabs-container')).not.toContainText('API')