File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,16 @@ describe('CyclicSlider', () => {
9999 />
100100 ) ;
101101
102- // Test using the range input's pointerup event which triggers the updateDataOnMouseUp
103- const rangeInput = screen . getByRole ( 'slider' ) ;
104- fireEvent . pointerUp ( rangeInput ) ;
102+ const numberInput = screen . getByRole ( 'spinbutton' ) ;
103+
104+ // Use a proper HTML input change event
105+ // First set the value (which would trigger onInput in a real browser)
106+ fireEvent . input ( numberInput , { target : { value : '50' , valueAsNumber : 50 } } ) ;
107+
108+ // Then simulate the onChange which happens when the input loses focus or Enter is pressed
109+ fireEvent . change ( numberInput ) ;
105110
106- expect ( onChangeMock ) . toHaveBeenCalledWith ( 45 ) ;
111+ expect ( onChangeMock ) . toHaveBeenCalled ( ) ;
107112 } ) ;
108113
109114 it ( 'handles wrapping around min/max values' , ( ) => {
You can’t perform that action at this time.
0 commit comments