@pingux/astro 2.33.0-alpha.11 → 2.33.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,8 +47,6 @@ var CheckboxField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
47
47
  autoFocus: hasAutoFocus || controlProps.hasAutoFocus,
48
48
  defaultSelected: isDefaultSelected || controlProps.isDefaultSelected
49
49
  }, props), controlProps);
50
- var _usePress = (0, _interactions.usePress)(props),
51
- containerPressProps = _usePress.pressProps;
52
50
  var state = (0, _reactStately.useToggleState)(checkboxProps);
53
51
  var checkboxRef = (0, _react.useRef)();
54
52
  (0, _hooks.usePropWarning)(props, 'disabled', 'isDisabled');
@@ -56,6 +54,10 @@ var CheckboxField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
56
54
  (0, _react.useImperativeHandle)(ref, function () {
57
55
  return checkboxRef.current;
58
56
  });
57
+ var _usePress = (0, _interactions.usePress)(_objectSpread(_objectSpread({}, props), {}, {
58
+ ref: checkboxRef
59
+ })),
60
+ containerPressProps = _usePress.pressProps;
59
61
  (0, _react.useEffect)(function () {
60
62
  if (checkboxRef.current && isIndeterminate) {
61
63
  checkboxRef.current.indeterminate = true;
@@ -5,8 +5,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
5
5
  var _react = _interopRequireDefault(require("react"));
6
6
  var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
7
7
  var _statuses = _interopRequireDefault(require("../../utils/devUtils/constants/statuses"));
8
- var _testAxe = _interopRequireDefault(require("../../utils/testUtils/testAxe"));
9
8
  var _testWrapper = require("../../utils/testUtils/testWrapper");
9
+ var _universalComponentTest = require("../../utils/testUtils/universalComponentTest");
10
10
  var _ = _interopRequireDefault(require("."));
11
11
  var _react2 = require("@emotion/react");
12
12
  var testLabel = 'Test Label';
@@ -21,8 +21,12 @@ var getComponent = function getComponent() {
21
21
  return renderFn((0, _react2.jsx)(_["default"], (0, _extends2["default"])({}, defaultProps, props)));
22
22
  };
23
23
 
24
- // Need to be added to each test file to test accessibility using axe.
25
- (0, _testAxe["default"])(getComponent);
24
+ // Needs to be added to each components test file
25
+ (0, _universalComponentTest.universalComponentTests)({
26
+ renderComponent: function renderComponent(props) {
27
+ return (0, _react2.jsx)(_["default"], (0, _extends2["default"])({}, defaultProps, props));
28
+ }
29
+ });
26
30
  test('default checkbox', function () {
27
31
  getComponent();
28
32
  var input = _testWrapper.screen.getByRole('checkbox');
@@ -36,8 +36,6 @@ var CheckboxField = /*#__PURE__*/forwardRef(function (props, ref) {
36
36
  autoFocus: hasAutoFocus || controlProps.hasAutoFocus,
37
37
  defaultSelected: isDefaultSelected || controlProps.isDefaultSelected
38
38
  }, props), controlProps);
39
- var _usePress = usePress(props),
40
- containerPressProps = _usePress.pressProps;
41
39
  var state = useToggleState(checkboxProps);
42
40
  var checkboxRef = useRef();
43
41
  usePropWarning(props, 'disabled', 'isDisabled');
@@ -45,6 +43,10 @@ var CheckboxField = /*#__PURE__*/forwardRef(function (props, ref) {
45
43
  useImperativeHandle(ref, function () {
46
44
  return checkboxRef.current;
47
45
  });
46
+ var _usePress = usePress(_objectSpread(_objectSpread({}, props), {}, {
47
+ ref: checkboxRef
48
+ })),
49
+ containerPressProps = _usePress.pressProps;
48
50
  useEffect(function () {
49
51
  if (checkboxRef.current && isIndeterminate) {
50
52
  checkboxRef.current.indeterminate = true;
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
2
  import React from 'react';
3
3
  import userEvent from '@testing-library/user-event';
4
4
  import statuses from '../../utils/devUtils/constants/statuses';
5
- import axeTest from '../../utils/testUtils/testAxe';
6
5
  import { render, screen } from '../../utils/testUtils/testWrapper';
6
+ import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
7
7
  import CheckboxField from '.';
8
8
  import { jsx as ___EmotionJSX } from "@emotion/react";
9
9
  var testLabel = 'Test Label';
@@ -18,8 +18,12 @@ var getComponent = function getComponent() {
18
18
  return renderFn(___EmotionJSX(CheckboxField, _extends({}, defaultProps, props)));
19
19
  };
20
20
 
21
- // Need to be added to each test file to test accessibility using axe.
22
- axeTest(getComponent);
21
+ // Needs to be added to each components test file
22
+ universalComponentTests({
23
+ renderComponent: function renderComponent(props) {
24
+ return ___EmotionJSX(CheckboxField, _extends({}, defaultProps, props));
25
+ }
26
+ });
23
27
  test('default checkbox', function () {
24
28
  getComponent();
25
29
  var input = screen.getByRole('checkbox');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.33.0-alpha.11",
3
+ "version": "2.33.0-alpha.12",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",