slider.test.tsx 837 B

1234567891011121314151617181920212223242526272829
  1. /* eslint-disable no-undef */
  2. import React from 'react';
  3. import { render, cleanup } from '@testing-library/react';
  4. import '@testing-library/jest-dom';
  5. import Sliders from '../components/Sliders';
  6. describe('Slider component', () => {
  7. afterEach(cleanup);
  8. test('check sliders status', () => {
  9. const { getByTestId } = render(<Sliders />);
  10. expect(getByTestId('sliders')).toBeVisible();
  11. });
  12. // test('mouse move on sliders', async () => {
  13. // const { getByTestId } = render(<Sliders defaultValue={50} />);
  14. // fireEvent.mouseDown(getByTestId('sliders'), {
  15. // clientX: 60,
  16. // clientY: 15,
  17. // buttons: 1,
  18. // });
  19. // const style = window.getComputedStyle(getByTestId('track'));
  20. // console.log(style);
  21. // expect(getByTestId('track')).toHaveStyle('left: calc(50% - 10px);');
  22. // });
  23. });