Skip to content

Commit

Permalink
test(slider): remove event handler unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogdriip committed Oct 19, 2022
1 parent bb12fb8 commit 061ecee
Showing 1 changed file with 0 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,40 +74,6 @@ describe('Slider', () => {
})
})

describe('onThumbPointerDown, onThumbPointerUp', () => {
it('should called when starts drag and ends drag', () => {
const onThumbPointerDown = jest.fn()
const onThumbPointerUp = jest.fn()

const { getAllByTestId } = renderSlider({ onThumbPointerDown, onThumbPointerUp })
const sliderThumb = getAllByTestId(SLIDER_THUMB_TEST_ID)

fireEvent.pointerDown(sliderThumb[0])
fireEvent.pointerUp(sliderThumb[0])

expect(onThumbPointerDown).toBeCalledTimes(1)
expect(onThumbPointerUp).toBeCalledTimes(1)
})

it('should not called when disabled is true', () => {
const onThumbPointerDown = jest.fn()
const onThumbPointerUp = jest.fn()

const { getAllByTestId } = renderSlider({
onThumbPointerDown,
onThumbPointerUp,
disabled: true,
})
const sliderThumb = getAllByTestId(SLIDER_THUMB_TEST_ID)

fireEvent.pointerDown(sliderThumb[0])
fireEvent.pointerUp(sliderThumb[0])

expect(onThumbPointerDown).not.toBeCalled()
expect(onThumbPointerUp).not.toBeCalled()
})
})

describe('accessibility', () => {
describe('role', () => {
it('should render thumb with an "slider" role', () => {
Expand Down

0 comments on commit 061ecee

Please sign in to comment.