diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsx b/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsx index e849f6ef2bd9d1..83ab818f14a265 100644 --- a/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsx +++ b/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsx @@ -45,10 +45,8 @@ vi.mock('@/utils/var', () => ({ })) vi.mock('@/app/components/base/action-button', () => ({ - default: ({ onClick, children }: { onClick?: () => void; children: React.ReactNode }) => ( - + default: ({ children, ...props }: React.ButtonHTMLAttributes) => ( + ), })) @@ -219,7 +217,7 @@ describe('DetailHeader', () => { render() fireEvent.click(screen.getByText('plugin.detailPanel.operation.update')) - fireEvent.click(screen.getByTestId('close-button')) + fireEvent.click(screen.getByRole('button', { name: 'common.operation.close' })) expect(mockHandleUpdate).toHaveBeenCalledTimes(1) expect(onHide).toHaveBeenCalled() diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx b/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx index c5fb5894d5b181..23d4c992fe071a 100644 --- a/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx +++ b/web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx @@ -310,7 +310,10 @@ const DetailHeader = ({ showCheckVersion={canUpdatePlugin} showRemove={canDeletePlugin} /> - + $['operation.close'], { ns: 'common' })} + onClick={onHide} + >