Skip to content

Commit

Permalink
fix_updating_progress_slider_from_mobile (#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnujChhikara authored Dec 26, 2024
1 parent 8d6aecd commit c43c180
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions __tests__/Unit/Components/Tasks/ProgressSlider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ describe('Progress Slider', () => {
expect(sliderInput).toBeInTheDocument();
});

test('should render range input field and handle touch events', async () => {
render(
<ProgressSlider {...DEFAULT_PROPS} value={40} isLoading={false} />
);
const sliderInput = screen.getByRole('slider');
fireEvent.touchEnd(sliderInput, { target: { value: 50 } });
expect(DEFAULT_PROPS.debounceSlider).toHaveBeenCalled();
expect(sliderInput).toBeInTheDocument();
});

test('should render with dev mode styles when dev query is true', async () => {
(useRouter as jest.Mock).mockImplementation(() => ({
query: { dev: 'true' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const ProgressSlider: FC<ProgressSliderProps> = ({
max="100"
step="10"
onChange={(e) => handleProgressChange(e)}
onTouchEnd={() => debounceSlider(1000)}
onMouseUp={() => debounceSlider(1000)}
disabled={isLoading}
style={
Expand Down

0 comments on commit c43c180

Please sign in to comment.