File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,21 @@ describe("Events", () => {
270270 expect ( change ) . toHaveBeenCalledTimes ( 1 ) ;
271271 } ) ;
272272
273+ test ( "input and select emitted on user click" , async ( ) => {
274+ const { listen, getAllByRole } = await render ( Radio , default_props ) ;
275+
276+ const input = listen ( "input" ) ;
277+ const select = listen ( "select" ) ;
278+ const radios = getAllByRole ( "radio" ) as HTMLInputElement [ ] ;
279+
280+ await event . click ( radios [ 2 ] ) ;
281+
282+ await waitFor ( ( ) => {
283+ expect ( input ) . toHaveBeenCalledTimes ( 1 ) ;
284+ expect ( select ) . toHaveBeenCalledTimes ( 1 ) ;
285+ expect ( select ) . toHaveBeenCalledWith ( { value : "turtle" , index : 2 } ) ;
286+ } ) ;
287+ } ) ;
273288 test ( "custom_button_click emitted when custom button is clicked" , async ( ) => {
274289 const { listen, getByLabelText } = await render ( Radio , {
275290 ...default_props ,
You can’t perform that action at this time.
0 commit comments