File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
packages/react-core/src/components/Dropdown Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,9 @@ class DropdownWithContext extends React.Component<DropdownProps & InjectedOuiaPr
3030 constructor ( props : DropdownProps & InjectedOuiaProps ) {
3131 super ( props ) ;
3232 if ( props . dropdownItems && props . dropdownItems . length > 0 && props . children ) {
33- throw new Error (
34- 'Children and dropdownItems props have been provided. Only the dropdownItems prop items will be rendered '
33+ // eslint-disable-next-line no-console
34+ console . error (
35+ 'Children and dropdownItems props have been provided. Only the dropdownItems prop items will be rendered'
3536 ) ;
3637 }
3738 }
Original file line number Diff line number Diff line change @@ -140,6 +140,8 @@ export class Toggle extends React.Component<ToggleProps> {
140140 parentRef,
141141 id,
142142 type,
143+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
144+ bubbleEvent,
143145 ...props
144146 } = this . props ;
145147 return (
Original file line number Diff line number Diff line change @@ -185,7 +185,8 @@ describe('API', () => {
185185 } ) ;
186186
187187 test ( 'dropdownItems and children console error ' , ( ) => {
188- expect ( ( ) =>
188+ const myMock = jest . fn ( ) ;
189+ global . console = { error : myMock } as any ;
189190 mount (
190191 < Dropdown
191192 dropdownItems = { dropdownItems }
@@ -195,7 +196,7 @@ describe('API', () => {
195196 < div > Children items</ div >
196197 </ Dropdown >
197198 )
198- ) . toThrowError ( ) ;
199+ expect ( myMock ) . toBeCalledWith ( 'Children and dropdownItems props have been provided. Only the dropdownItems prop items will be rendered' ) ;
199200 } ) ;
200201
201202 test ( 'dropdownItems only, no console error ' , ( ) => {
You can’t perform that action at this time.
0 commit comments