slider.test.tsx 892 B

123456789101112131415161718192021222324252627282930
  1. /* eslint-disable import/no-extraneous-dependencies */
  2. /* eslint-disable no-undef */
  3. import React from 'react';
  4. import { render, cleanup } from '@testing-library/react';
  5. import '@testing-library/jest-dom';
  6. import Sliders from '../components/Sliders';
  7. describe('Slider component', () => {
  8. afterEach(cleanup);
  9. test('check sliders status', () => {
  10. const { getByTestId } = render(<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. });