diff --git a/packages/react/src/Alert/Alert.test.tsx b/packages/react/src/Alert/Alert.test.tsx index 92919c714c..ecc1331366 100644 --- a/packages/react/src/Alert/Alert.test.tsx +++ b/packages/react/src/Alert/Alert.test.tsx @@ -53,7 +53,7 @@ describe('Alert', () => { }) it('renders the close button with a label', () => { - const { container } = render() + const { container } = render() const component = container.querySelector(':only-child') const closeButton = component?.querySelector('.ams-icon-button') diff --git a/packages/react/src/Alert/Alert.tsx b/packages/react/src/Alert/Alert.tsx index 64b3e0931a..93c468337f 100644 --- a/packages/react/src/Alert/Alert.tsx +++ b/packages/react/src/Alert/Alert.tsx @@ -16,7 +16,7 @@ export type AlertProps = { /** Whether the alert can be dismissed by the user. Adds a button to the top right. */ closeable?: boolean /** The label for the button that dismisses the Alert. */ - closeLabel?: string + closeButtonLabel?: string /** * The hierarchical level of the alert title within the document. * @default 2 @@ -43,7 +43,7 @@ export const Alert = forwardRef( children, className, closeable, - closeLabel = 'Sluiten', + closeButtonLabel = 'Sluiten', headingLevel = 2, onClose, severity = 'warning', @@ -68,7 +68,7 @@ export const Alert = forwardRef( )} {children} - {closeable && } + {closeable && } ) }, diff --git a/packages/react/src/Dialog/Dialog.test.tsx b/packages/react/src/Dialog/Dialog.test.tsx index be560d9022..f5ed21bb1d 100644 --- a/packages/react/src/Dialog/Dialog.test.tsx +++ b/packages/react/src/Dialog/Dialog.test.tsx @@ -83,7 +83,7 @@ describe('Dialog', () => { }) it('renders a custom close label', () => { - render() + render() const closeButton = screen.getByText('Close') diff --git a/packages/react/src/Dialog/Dialog.tsx b/packages/react/src/Dialog/Dialog.tsx index ef25a61aeb..8b94f1fc20 100644 --- a/packages/react/src/Dialog/Dialog.tsx +++ b/packages/react/src/Dialog/Dialog.tsx @@ -13,19 +13,19 @@ export type DialogProps = { /** Children for the footer of the dialog, like a save or close button. */ actions?: ReactNode /** The label for the button that dismisses the Dialog. */ - closeLabel?: string + closeButtonLabel?: string } & PropsWithChildren> export const Dialog = forwardRef( ( - { actions, children, className, closeLabel = 'Sluiten', title, ...restProps }: DialogProps, + { actions, children, className, closeButtonLabel = 'Sluiten', title, ...restProps }: DialogProps, ref: ForwardedRef, ) => (
{title} - +
{children}
{actions &&
{actions}
} diff --git a/packages/react/src/Pagination/Pagination.test.tsx b/packages/react/src/Pagination/Pagination.test.tsx index 19a42d419c..71406c112e 100644 --- a/packages/react/src/Pagination/Pagination.test.tsx +++ b/packages/react/src/Pagination/Pagination.test.tsx @@ -100,8 +100,11 @@ describe('Pagination', () => { it('render custom labels for the "previous" and "next" buttons', () => { render() - expect(screen.getByText('previous')).toBeInTheDocument() - expect(screen.getByText('next')).toBeInTheDocument() + const previousButton = screen.getByRole('button', { name: 'previous' }) + const nextButton = screen.getByRole('button', { name: 'next' }) + + expect(previousButton).toBeInTheDocument() + expect(nextButton).toBeInTheDocument() }) it('render custom aria-labels for the "previous" and "next" buttons', () => {