{payload.title}
diff --git a/web/app/components/datasets/rename-modal/__tests__/index.spec.tsx b/web/app/components/datasets/rename-modal/__tests__/index.spec.tsx
index 4f8a421a52..ac4075fa5b 100644
--- a/web/app/components/datasets/rename-modal/__tests__/index.spec.tsx
+++ b/web/app/components/datasets/rename-modal/__tests__/index.spec.tsx
@@ -167,11 +167,7 @@ describe('RenameDatasetModal', () => {
it('should render close icon button', () => {
render()
- // The modal renders with title and other elements
- // The close functionality is tested in user interactions
- // The modal renders with title and other elements
- // The close functionality is tested in user interactions
- expect(screen.getByText('datasetSettings.title'))!.toBeInTheDocument()
+ expect(screen.getByRole('button', { name: /operation\.close$/ }))!.toBeInTheDocument()
})
it('should render form labels', () => {
@@ -296,14 +292,10 @@ describe('RenameDatasetModal', () => {
})
it('should call onClose when close icon is clicked', () => {
- // This test is covered by the cancel button test
- // The close icon functionality works the same way as cancel button
const handleClose = vi.fn()
render()
- // Use the cancel button to verify close callback works
- const cancelButton = screen.getByText('common.operation.cancel')
- fireEvent.click(cancelButton)
+ fireEvent.click(screen.getByRole('button', { name: /operation\.close$/ }))
expect(handleClose).toHaveBeenCalledTimes(1)
})
diff --git a/web/app/components/datasets/rename-modal/index.tsx b/web/app/components/datasets/rename-modal/index.tsx
index ae8f9f5d6a..d2750ae21b 100644
--- a/web/app/components/datasets/rename-modal/index.tsx
+++ b/web/app/components/datasets/rename-modal/index.tsx
@@ -93,9 +93,14 @@ const RenameDatasetModal = ({ show, dataset, onSuccess, onClose }: RenameDataset