feat(confirm): input app name for app deletion confirmation (#33660)

This commit is contained in:
Bowen Liang
2026-03-19 14:25:29 +08:00
committed by GitHub
parent e4f1d3c63a
commit 942087cbdb
28 changed files with 123 additions and 7 deletions

View File

@ -543,6 +543,11 @@ describe('AppCard', () => {
fireEvent.click(screen.getByTestId('popover-trigger'))
fireEvent.click(await screen.findByRole('button', { name: 'common.operation.delete' }))
expect(await screen.findByRole('alertdialog')).toBeInTheDocument()
// Fill in the confirmation input with app name
const deleteInput = screen.getByRole('textbox')
fireEvent.change(deleteInput, { target: { value: mockApp.name } })
fireEvent.click(screen.getByRole('button', { name: 'common.operation.confirm' }))
await waitFor(() => {
@ -556,6 +561,11 @@ describe('AppCard', () => {
fireEvent.click(screen.getByTestId('popover-trigger'))
fireEvent.click(await screen.findByRole('button', { name: 'common.operation.delete' }))
expect(await screen.findByRole('alertdialog')).toBeInTheDocument()
// Fill in the confirmation input with app name
const deleteInput = screen.getByRole('textbox')
fireEvent.change(deleteInput, { target: { value: mockApp.name } })
fireEvent.click(screen.getByRole('button', { name: 'common.operation.confirm' }))
await waitFor(() => {
@ -572,6 +582,11 @@ describe('AppCard', () => {
fireEvent.click(screen.getByTestId('popover-trigger'))
fireEvent.click(await screen.findByRole('button', { name: 'common.operation.delete' }))
expect(await screen.findByRole('alertdialog')).toBeInTheDocument()
// Fill in the confirmation input with app name
const deleteInput = screen.getByRole('textbox')
fireEvent.change(deleteInput, { target: { value: mockApp.name } })
fireEvent.click(screen.getByRole('button', { name: 'common.operation.confirm' }))
await waitFor(() => {