File tree Expand file tree Collapse file tree
src/lib/components/button-group
tests/component/button-group Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { PropsWithChildren } from 'react'
22import { ButtonGroup as ButtonGroupBS } from 'react-bootstrap'
33import styles from './ButtonGroup.module.scss'
4+ import * as React from 'react'
45
5- interface ButtonGroupProps {
6+ interface ButtonGroupProps extends React . HTMLAttributes < HTMLElement > {
67 vertical ?: boolean
78}
89
9- export function ButtonGroup ( { vertical, children } : PropsWithChildren < ButtonGroupProps > ) {
10+ export function ButtonGroup ( { vertical, children, ... props } : PropsWithChildren < ButtonGroupProps > ) {
1011 return (
11- < ButtonGroupBS vertical = { vertical } className = { styles . border } >
12+ < ButtonGroupBS vertical = { vertical } className = { styles . border } { ... props } >
1213 { children }
1314 </ ButtonGroupBS >
1415 )
Original file line number Diff line number Diff line change @@ -25,4 +25,10 @@ describe('ButtonGroup', () => {
2525
2626 cy . findByRole ( 'group' ) . should ( 'not.have.class' , 'btn-group-vertical' )
2727 } )
28+
29+ it ( 'renders html attributes' , ( ) => {
30+ cy . mount ( < ButtonGroup data-testid = "button-group" aria-label = "button group" /> )
31+
32+ cy . findByRole ( 'group' ) . should ( 'have.attr' , 'aria-label' , 'button group' )
33+ } )
2834} )
You can’t perform that action at this time.
0 commit comments