slider.test.tsx 884 B

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