import { _ as _asyncToGenerator, r as regenerator } from '../index-qSfOyGhk.js';
import React__default from 'react';
import { render, screen, act } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import PixelSlider from './index.js';
import '../typeof-CgC7Bq6K.js';
import '../slicedToArray-BB-AwwkK.js';
import '../slider/index.js';
import '../extends-C4cduGrv.js';
import '../objectWithoutProperties-TXwlfNxG.js';
import 'classnames';
import '../label/index.js';
import 'prop-types';
import '@reach/visually-hidden';

var handleChangeMock = jest.fn(function (value) {
  return value;
});
afterEach(function () {
  jest.clearAllMocks();
});
test("PixelSlider returns Number-type values", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
  var input;
  return regenerator.wrap(function _callee$(_context) {
    while (1) {
      switch (_context.prev = _context.next) {
        case 0:
          render( /*#__PURE__*/React__default.createElement(PixelSlider, {
            label: "foo",
            name: "bar",
            value: 0,
            onChange: handleChangeMock
          }));
          input = screen.getByLabelText("foo");
          _context.next = 4;
          return act(function () {
            return userEvent.type(input, "7");
          });

        case 4:
          expect(handleChangeMock).toHaveBeenCalledWith(7);

        case 5:
        case "end":
          return _context.stop();
      }
    }
  }, _callee);
})));
test("PixelSlider doesn't return strings", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
  var input;
  return regenerator.wrap(function _callee2$(_context2) {
    while (1) {
      switch (_context2.prev = _context2.next) {
        case 0:
          render( /*#__PURE__*/React__default.createElement(PixelSlider, {
            label: "foo",
            name: "bar",
            value: 0,
            onChange: handleChangeMock
          }));
          input = screen.getByLabelText("foo");
          _context2.next = 4;
          return act(function () {
            return userEvent.type(input, "string!");
          });

        case 4:
          expect(handleChangeMock).not.toHaveBeenCalled();

        case 5:
        case "end":
          return _context2.stop();
      }
    }
  }, _callee2);
})));
