Bugfix: show proper error toast when user tries to rename project to conflicting name (#5613)

* Correct error toast behavior so rename error comes through

* Add rename error state to E2E test
This commit is contained in:
Frank Noirot
2025-03-05 18:00:36 -05:00
committed by GitHub
parent b947dad6e9
commit 00ff6371ed
4 changed files with 31 additions and 1 deletions

View File

@ -745,6 +745,23 @@ test(
// expect the name not to have changed
await expect(page.getByText('bracket')).toBeVisible()
})
await test.step(`rename a project to a duplicate name should error toast`, async () => {
const routerTemplate = page.getByText('bracket')
await routerTemplate.hover()
await routerTemplate.focus()
await expect(page.getByLabel('sketch').last()).toBeVisible()
await page.getByLabel('sketch').last().click()
const inputField = page.getByTestId('project-rename-input')
await expect(inputField).toBeVisible()
await expect(inputField).toBeFocused()
await inputField.fill('lego')
await page.keyboard.press('Enter')
await expect(page.getByText('already exists')).toBeVisible()
})
}
)