@pingux/astro 2.33.0-alpha.1 → 2.33.0-alpha.11
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.
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +8 -9
- package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +8 -11
- package/lib/cjs/components/ArrayField/ArrayField.js +5 -3
- package/lib/cjs/components/ArrayField/ArrayField.test.js +13 -4
- package/lib/cjs/components/Avatar/Avatar.test.js +7 -4
- package/lib/cjs/components/Badge/Badge.test.js +7 -3
- package/lib/cjs/components/Box/Box.test.js +7 -4
- package/lib/cjs/components/Bracket/Bracket.js +3 -1
- package/lib/cjs/components/Bracket/Bracket.test.js +7 -3
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.test.js +7 -3
- package/lib/cjs/components/ButtonBar/ButtonBar.js +9 -3
- package/lib/cjs/components/ButtonBar/ButtonBar.stories.js +61 -5
- package/lib/cjs/components/ButtonBar/ButtonBar.test.js +13 -3
- package/lib/cjs/components/Callout/Callout.js +8 -3
- package/lib/cjs/components/Callout/Callout.test.js +8 -0
- package/lib/cjs/components/Card/Card.test.js +7 -4
- package/lib/cjs/components/Checkbox/Checkbox.test.js +7 -4
- package/lib/cjs/components/CodeView/CodeView.js +1 -0
- package/lib/cjs/components/CodeView/CodeView.test.js +7 -3
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.test.js +5 -10
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelBadge.js +9 -3
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelBadge.test.js +7 -3
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelContainer.test.js +7 -3
- package/lib/cjs/components/CollapsiblePanelItem/CollapsiblePanelItem.test.js +7 -3
- package/lib/cjs/components/ColorField/ColorField.test.js +7 -3
- package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +11 -21
- package/lib/cjs/components/CopyText/CopyText.test.js +15 -5
- package/lib/cjs/components/DataTable/DataTableBadge.test.js +8 -0
- package/lib/cjs/components/DataTable/DataTableMenu.test.js +8 -0
- package/lib/cjs/components/DataTable/DataTableMultiLine.test.js +16 -5
- package/lib/cjs/components/DatePicker/DatePicker.test.js +11 -20
- package/lib/cjs/components/EditButton/EditButton.test.js +8 -2
- package/lib/cjs/components/FieldHelperText/FieldHelperText.test.js +7 -3
- package/lib/cjs/components/FileInputField/FileInputField.test.js +8 -2
- package/lib/cjs/components/HelpHint/HelpHint.test.js +7 -3
- package/lib/cjs/components/IconBadge/IconBadge.js +8 -3
- package/lib/cjs/components/IconBadge/IconBadge.test.js +9 -3
- package/lib/cjs/components/IconButton/IconButton.test.js +7 -3
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.js +11 -6
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.test.js +7 -3
- package/lib/cjs/components/ImageUploadField/ImageUploadField.test.js +7 -3
- package/lib/cjs/components/Input/Input.test.js +7 -3
- package/lib/cjs/components/Link/Link.test.js +7 -3
- package/lib/cjs/components/LinkSelectField/LinkSelectField.test.js +12 -31
- package/lib/cjs/components/ListItem/ListItem.test.js +5 -8
- package/lib/cjs/components/ListView/ListView.test.js +19 -0
- package/lib/cjs/components/ListViewItem/ListViewItem.test.js +7 -3
- package/lib/cjs/components/ListViewItem/controls/ListViewItemEditButton.js +11 -4
- package/lib/cjs/components/ListViewItem/controls/ListViewItemEditButton.test.js +7 -3
- package/lib/cjs/components/ListViewItem/controls/ListViewItemMenu.js +10 -4
- package/lib/cjs/components/ListViewItem/controls/ListViewItemMenu.test.js +7 -4
- package/lib/cjs/components/ListViewItem/controls/ListViewItemSwitchField.js +9 -3
- package/lib/cjs/components/ListViewItem/controls/ListViewItemSwitchField.test.js +7 -3
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.js +4 -3
- package/lib/cjs/components/ListViewItem/controls/chart/ListViewItemChart.test.js +7 -3
- package/lib/cjs/components/Loader/Loader.test.js +7 -3
- package/lib/cjs/components/Menu/Menu.test.js +11 -3
- package/lib/cjs/components/MenuItem/MenuItem.test.js +15 -3
- package/lib/cjs/components/Messages/Messages.test.js +9 -3
- package/lib/cjs/components/Modal/tests/Modal.unit.test.js +7 -3
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +14 -20
- package/lib/cjs/components/NavBar/NavBar.js +3 -2
- package/lib/cjs/components/NavBar/NavBar.test.js +10 -2
- package/lib/cjs/components/NumberField/NumberField.test.js +5 -8
- package/lib/cjs/components/OverlayPanel/OverlayPanel.test.js +7 -3
- package/lib/cjs/components/PageHeader/PageHeader.test.js +11 -2
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderCloseButton.js +9 -3
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderCloseButton.test.js +7 -3
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderMenu.js +12 -4
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderMenu.test.js +7 -3
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderSwitchField.js +12 -4
- package/lib/cjs/components/PanelHeader/controls/PanelHeaderSwitchField.test.js +7 -3
- package/lib/cjs/components/PasswordField/PasswordField.test.js +7 -3
- package/lib/cjs/components/RadioField/RadioField.test.js +9 -3
- package/lib/cjs/components/RadioGroupField/RadioGroupField.test.js +10 -3
- package/lib/cjs/components/RequirementsList/RequirementsList.test.js +7 -3
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.test.js +11 -3
- package/lib/cjs/components/ScrollBox/ScrollBox.test.js +8 -0
- package/lib/cjs/components/SearchField/SearchField.test.js +7 -3
- package/lib/cjs/components/SelectField/SelectField.test.js +11 -3
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.test.js +14 -30
- package/lib/cjs/components/Separator/Separator.test.js +7 -3
- package/lib/cjs/components/Stepper/Stepper.test.js +12 -14
- package/lib/cjs/components/SwitchField/SwitchField.test.js +7 -3
- package/lib/cjs/components/Table/Table.js +9 -3
- package/lib/cjs/components/Table/Table.test.js +26 -3
- package/lib/cjs/components/TableBody/TableBody.js +9 -3
- package/lib/cjs/components/TableBody/TableBody.test.d.ts +1 -0
- package/lib/cjs/components/TableBody/TableBody.test.js +13 -0
- package/lib/cjs/components/TableCaption/TableCaption.js +9 -3
- package/lib/cjs/components/TableCaption/TableCaption.test.js +13 -0
- package/lib/cjs/components/TableCell/TableCell.d.ts +2 -2
- package/lib/cjs/components/TableCell/TableCell.js +9 -3
- package/lib/cjs/components/TableCell/TableCell.test.js +7 -3
- package/lib/cjs/components/TableHead/TableHead.js +9 -3
- package/lib/cjs/components/TableHead/TableHead.test.js +13 -0
- package/lib/cjs/components/TableRow/TableRow.js +9 -3
- package/lib/cjs/components/TableRow/TableRow.test.js +13 -0
- package/lib/cjs/components/Tabs/Tabs.stories.js +2 -2
- package/lib/cjs/components/Tabs/Tabs.style.js +0 -1
- package/lib/cjs/components/Tabs/Tabs.test.js +10 -3
- package/lib/cjs/components/Text/Text.test.js +7 -3
- package/lib/cjs/components/TextArea/TextArea.test.js +8 -3
- package/lib/cjs/components/TextAreaField/TextAreaField.test.js +7 -3
- package/lib/cjs/components/TextField/TextField.test.js +7 -3
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.test.js +8 -0
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.test.js +7 -3
- package/lib/cjs/hooks/useComponentToggle/useComponentToggle.js +1 -3
- package/lib/cjs/hooks/useField/useField.d.ts +33 -35
- package/lib/cjs/hooks/useField/useField.js +1 -1
- package/lib/cjs/hooks/useProgressiveState/index.d.ts +1 -0
- package/lib/cjs/hooks/useProgressiveState/useProgressiveState.d.ts +11 -0
- package/lib/cjs/hooks/useProgressiveState/useProgressiveState.js +3 -6
- package/lib/cjs/hooks/useProgressiveState/useProgressiveState.test.d.ts +1 -0
- package/lib/cjs/hooks/useProgressiveState/useProgressiveState.test.js +7 -16
- package/lib/cjs/hooks/usePropWarning/index.d.ts +1 -0
- package/lib/cjs/hooks/usePropWarning/usePropWarning.d.ts +13 -0
- package/lib/cjs/hooks/usePropWarning/usePropWarning.js +0 -8
- package/lib/cjs/hooks/usePropWarning/usePropWarning.test.d.ts +1 -0
- package/lib/cjs/hooks/usePropWarning/usePropWarning.test.js +13 -9
- package/lib/cjs/hooks/useRockerButton/index.d.ts +1 -0
- package/lib/cjs/hooks/useRockerButton/useRockerButton.d.ts +241 -0
- package/lib/cjs/hooks/useSelectField/index.d.ts +1 -0
- package/lib/cjs/hooks/useSelectField/useSelectField.d.ts +55 -0
- package/lib/cjs/hooks/useSelectField/useSelectField.js +10 -10
- package/lib/cjs/types/item.d.ts +4 -7
- package/lib/cjs/types/popoverContainer.d.ts +1 -0
- package/lib/cjs/types/shared/style.d.ts +6 -0
- package/lib/cjs/utils/designUtils/figmaLinks.js +4 -2
- package/lib/cjs/utils/testUtils/universalComponentTest.d.ts +1 -2
- package/lib/cjs/utils/testUtils/universalComponentTest.js +6 -4
- package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +8 -9
- package/lib/components/AccordionGroup/AccordionGroup.test.js +8 -11
- package/lib/components/ArrayField/ArrayField.js +6 -4
- package/lib/components/ArrayField/ArrayField.test.js +13 -4
- package/lib/components/Avatar/Avatar.test.js +7 -4
- package/lib/components/Badge/Badge.test.js +7 -3
- package/lib/components/Box/Box.test.js +7 -4
- package/lib/components/Bracket/Bracket.js +3 -1
- package/lib/components/Bracket/Bracket.test.js +7 -3
- package/lib/components/Breadcrumbs/Breadcrumbs.test.js +7 -3
- package/lib/components/ButtonBar/ButtonBar.js +4 -3
- package/lib/components/ButtonBar/ButtonBar.stories.js +57 -3
- package/lib/components/ButtonBar/ButtonBar.test.js +13 -3
- package/lib/components/Callout/Callout.js +4 -3
- package/lib/components/Callout/Callout.test.js +8 -0
- package/lib/components/Card/Card.test.js +7 -4
- package/lib/components/Checkbox/Checkbox.test.js +7 -4
- package/lib/components/CodeView/CodeView.js +1 -0
- package/lib/components/CodeView/CodeView.test.js +7 -3
- package/lib/components/CollapsiblePanel/CollapsiblePanel.test.js +5 -10
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelBadge.js +4 -3
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelBadge.test.js +7 -3
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelContainer.test.js +7 -3
- package/lib/components/CollapsiblePanelItem/CollapsiblePanelItem.test.js +7 -3
- package/lib/components/ColorField/ColorField.test.js +7 -3
- package/lib/components/ComboBoxField/ComboBoxField.test.js +11 -21
- package/lib/components/CopyText/CopyText.test.js +15 -5
- package/lib/components/DataTable/DataTableBadge.test.js +8 -0
- package/lib/components/DataTable/DataTableMenu.test.js +8 -0
- package/lib/components/DataTable/DataTableMultiLine.test.js +16 -5
- package/lib/components/DatePicker/DatePicker.test.js +11 -20
- package/lib/components/EditButton/EditButton.test.js +8 -2
- package/lib/components/FieldHelperText/FieldHelperText.test.js +7 -3
- package/lib/components/FileInputField/FileInputField.test.js +8 -2
- package/lib/components/HelpHint/HelpHint.test.js +7 -3
- package/lib/components/IconBadge/IconBadge.js +4 -3
- package/lib/components/IconBadge/IconBadge.test.js +9 -3
- package/lib/components/IconButton/IconButton.test.js +7 -3
- package/lib/components/IconButtonToggle/IconButtonToggle.js +6 -6
- package/lib/components/IconButtonToggle/IconButtonToggle.test.js +7 -3
- package/lib/components/ImageUploadField/ImageUploadField.test.js +7 -3
- package/lib/components/Input/Input.test.js +7 -3
- package/lib/components/Link/Link.test.js +7 -3
- package/lib/components/LinkSelectField/LinkSelectField.test.js +12 -31
- package/lib/components/ListItem/ListItem.test.js +5 -8
- package/lib/components/ListView/ListView.test.js +19 -0
- package/lib/components/ListViewItem/ListViewItem.test.js +7 -3
- package/lib/components/ListViewItem/controls/ListViewItemEditButton.js +6 -4
- package/lib/components/ListViewItem/controls/ListViewItemEditButton.test.js +7 -3
- package/lib/components/ListViewItem/controls/ListViewItemMenu.js +5 -4
- package/lib/components/ListViewItem/controls/ListViewItemMenu.test.js +7 -4
- package/lib/components/ListViewItem/controls/ListViewItemSwitchField.js +4 -3
- package/lib/components/ListViewItem/controls/ListViewItemSwitchField.test.js +7 -3
- package/lib/components/ListViewItem/controls/chart/ListViewItemChart.js +5 -4
- package/lib/components/ListViewItem/controls/chart/ListViewItemChart.test.js +7 -3
- package/lib/components/Loader/Loader.test.js +7 -3
- package/lib/components/Menu/Menu.test.js +11 -3
- package/lib/components/MenuItem/MenuItem.test.js +15 -3
- package/lib/components/Messages/Messages.test.js +9 -3
- package/lib/components/Modal/tests/Modal.unit.test.js +7 -3
- package/lib/components/MultivaluesField/MultivaluesField.test.js +14 -20
- package/lib/components/NavBar/NavBar.js +4 -3
- package/lib/components/NavBar/NavBar.test.js +10 -2
- package/lib/components/NumberField/NumberField.test.js +5 -8
- package/lib/components/OverlayPanel/OverlayPanel.test.js +7 -3
- package/lib/components/PageHeader/PageHeader.test.js +11 -2
- package/lib/components/PanelHeader/controls/PanelHeaderCloseButton.js +4 -3
- package/lib/components/PanelHeader/controls/PanelHeaderCloseButton.test.js +7 -3
- package/lib/components/PanelHeader/controls/PanelHeaderMenu.js +7 -4
- package/lib/components/PanelHeader/controls/PanelHeaderMenu.test.js +7 -3
- package/lib/components/PanelHeader/controls/PanelHeaderSwitchField.js +7 -4
- package/lib/components/PanelHeader/controls/PanelHeaderSwitchField.test.js +7 -3
- package/lib/components/PasswordField/PasswordField.test.js +7 -3
- package/lib/components/RadioField/RadioField.test.js +9 -3
- package/lib/components/RadioGroupField/RadioGroupField.test.js +10 -3
- package/lib/components/RequirementsList/RequirementsList.test.js +7 -3
- package/lib/components/RockerButtonGroup/RockerButtonGroup.test.js +11 -3
- package/lib/components/ScrollBox/ScrollBox.test.js +8 -0
- package/lib/components/SearchField/SearchField.test.js +7 -3
- package/lib/components/SelectField/SelectField.test.js +11 -3
- package/lib/components/SelectFieldBase/SelectFieldBase.test.js +13 -31
- package/lib/components/Separator/Separator.test.js +7 -3
- package/lib/components/Stepper/Stepper.test.js +12 -14
- package/lib/components/SwitchField/SwitchField.test.js +7 -3
- package/lib/components/Table/Table.js +4 -3
- package/lib/components/Table/Table.test.js +26 -3
- package/lib/components/TableBody/TableBody.js +4 -3
- package/lib/components/TableBody/TableBody.test.js +11 -0
- package/lib/components/TableCaption/TableCaption.js +4 -3
- package/lib/components/TableCaption/TableCaption.test.js +11 -0
- package/lib/components/TableCell/TableCell.js +4 -3
- package/lib/components/TableCell/TableCell.test.js +7 -3
- package/lib/components/TableHead/TableHead.js +4 -3
- package/lib/components/TableHead/TableHead.test.js +11 -0
- package/lib/components/TableRow/TableRow.js +4 -3
- package/lib/components/TableRow/TableRow.test.js +11 -0
- package/lib/components/Tabs/Tabs.stories.js +3 -3
- package/lib/components/Tabs/Tabs.style.js +0 -1
- package/lib/components/Tabs/Tabs.test.js +10 -3
- package/lib/components/Text/Text.test.js +7 -3
- package/lib/components/TextArea/TextArea.test.js +8 -3
- package/lib/components/TextAreaField/TextAreaField.test.js +7 -3
- package/lib/components/TextField/TextField.test.js +7 -3
- package/lib/components/TimeZonePicker/TimeZonePicker.test.js +8 -0
- package/lib/components/TooltipTrigger/TooltipTrigger.test.js +7 -3
- package/lib/hooks/useComponentToggle/useComponentToggle.js +1 -3
- package/lib/hooks/useField/useField.js +2 -0
- package/lib/hooks/useProgressiveState/useProgressiveState.js +3 -7
- package/lib/hooks/useProgressiveState/useProgressiveState.test.js +7 -16
- package/lib/hooks/usePropWarning/usePropWarning.js +0 -8
- package/lib/hooks/usePropWarning/usePropWarning.test.js +13 -9
- package/lib/hooks/useSelectField/useSelectField.js +11 -9
- package/lib/utils/designUtils/figmaLinks.js +4 -2
- package/lib/utils/testUtils/universalComponentTest.js +6 -4
- package/package.json +1 -1
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
3
3
|
import { render, screen } from '@testing-library/react';
|
4
4
|
import userEvent from '@testing-library/user-event';
|
5
|
-
import
|
5
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
6
6
|
import Input from '.';
|
7
7
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
8
|
var testId = 'test-input';
|
@@ -15,8 +15,12 @@ var getComponent = function getComponent() {
|
|
15
15
|
return render(___EmotionJSX(Input, _extends({}, defaultProps, props)));
|
16
16
|
};
|
17
17
|
|
18
|
-
//
|
19
|
-
|
18
|
+
// Needs to be added to each components test file
|
19
|
+
universalComponentTests({
|
20
|
+
renderComponent: function renderComponent(props) {
|
21
|
+
return ___EmotionJSX(Input, _extends({}, defaultProps, props));
|
22
|
+
}
|
23
|
+
});
|
20
24
|
test('default input', function () {
|
21
25
|
getComponent();
|
22
26
|
var input = screen.getByTestId(testId);
|
@@ -1,8 +1,8 @@
|
|
1
1
|
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
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
5
4
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
5
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
6
6
|
import Link from '.';
|
7
7
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
8
|
var testId = 'test-link';
|
@@ -15,8 +15,12 @@ var getComponent = function getComponent() {
|
|
15
15
|
return render(___EmotionJSX(Link, _extends({}, defaultProps, props)));
|
16
16
|
};
|
17
17
|
|
18
|
-
//
|
19
|
-
|
18
|
+
// Needs to be added to each components test file
|
19
|
+
universalComponentTests({
|
20
|
+
renderComponent: function renderComponent(props) {
|
21
|
+
return ___EmotionJSX(Link, _extends({}, defaultProps, props));
|
22
|
+
}
|
23
|
+
});
|
20
24
|
test('a link is rendered', function () {
|
21
25
|
getComponent();
|
22
26
|
var link = screen.getByTestId(testId);
|
@@ -1,22 +1,10 @@
|
|
1
|
-
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
2
|
-
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
3
|
-
import _Object$create from "@babel/runtime-corejs3/core-js-stable/object/create";
|
4
|
-
import _Object$getPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/get-prototype-of";
|
5
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
-
import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/set-prototype-of";
|
7
|
-
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
8
|
-
import _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reverse";
|
9
|
-
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
10
|
-
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
11
|
-
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
12
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
13
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context2; _forEachInstanceProperty(_context2 = ["next", "throw", "return"]).call(_context2, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context3; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context3 = this.tryEntries).call(_context3, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
14
2
|
import React from 'react';
|
15
3
|
import userEvent from '@testing-library/user-event';
|
16
|
-
import { axe } from 'jest-axe';
|
17
4
|
import { Item, LinkSelectField } from '../../index';
|
18
5
|
import statuses from '../../utils/devUtils/constants/statuses';
|
19
6
|
import { render, screen, within } from '../../utils/testUtils/testWrapper';
|
7
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
20
8
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
21
9
|
var items = [{
|
22
10
|
name: 'a'
|
@@ -184,21 +172,14 @@ test('passing helper text should display it and correct aria attributes on input
|
|
184
172
|
var helperTextID = helper.getAttribute('id');
|
185
173
|
expect(screen.getByRole('button')).toHaveAttribute('aria-describedby', helperTextID);
|
186
174
|
});
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
expect(results).toHaveNoViolations();
|
199
|
-
case 6:
|
200
|
-
case "end":
|
201
|
-
return _context.stop();
|
202
|
-
}
|
203
|
-
}, _callee);
|
204
|
-
})));
|
175
|
+
|
176
|
+
// Needs to be added to each components test file
|
177
|
+
universalComponentTests({
|
178
|
+
renderComponent: function renderComponent(props) {
|
179
|
+
return ___EmotionJSX(LinkSelectField, _extends({}, defaultProps, props), function (item) {
|
180
|
+
return ___EmotionJSX(Item, {
|
181
|
+
key: item.name
|
182
|
+
}, item.name);
|
183
|
+
});
|
184
|
+
}
|
185
|
+
});
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
3
3
|
import { render, screen } from '@testing-library/react';
|
4
4
|
import userEvent from '@testing-library/user-event';
|
5
|
-
import
|
5
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
6
6
|
import ListItem from './ListItem';
|
7
7
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
8
|
var testTitle = 'Test Title';
|
@@ -17,13 +17,10 @@ var getComponent = function getComponent() {
|
|
17
17
|
})));
|
18
18
|
};
|
19
19
|
|
20
|
-
//
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
'aria-required-parent': {
|
25
|
-
enabled: false
|
26
|
-
}
|
20
|
+
// Needs to be added to each components test file
|
21
|
+
universalComponentTests({
|
22
|
+
renderComponent: function renderComponent(props) {
|
23
|
+
return ___EmotionJSX(ListItem, _extends({}, defaultProps, props));
|
27
24
|
}
|
28
25
|
});
|
29
26
|
describe('ListItem', function () {
|
@@ -19,6 +19,7 @@ import userEvent from '@testing-library/user-event';
|
|
19
19
|
import _ from 'lodash';
|
20
20
|
import loadingStates from '../../utils/devUtils/constants/loadingStates';
|
21
21
|
import { fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
|
22
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
22
23
|
import CheckboxField from '../CheckboxField';
|
23
24
|
import ListView from './ListView';
|
24
25
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
@@ -113,6 +114,24 @@ var getComponentWithCheckbox = function getComponentWithCheckbox() {
|
|
113
114
|
}));
|
114
115
|
})));
|
115
116
|
};
|
117
|
+
|
118
|
+
// Needs to be added to each components test file
|
119
|
+
universalComponentTests({
|
120
|
+
renderComponent: function renderComponent(props) {
|
121
|
+
return ___EmotionJSX(ListView, _extends({}, defaultProps, props, {
|
122
|
+
items: items
|
123
|
+
}), function (item) {
|
124
|
+
return ___EmotionJSX(Item, {
|
125
|
+
key: item.key,
|
126
|
+
textValue: item.name,
|
127
|
+
"data-id": item.key
|
128
|
+
}, ___EmotionJSX("h1", {
|
129
|
+
key: item.key,
|
130
|
+
"data-testid": item.name
|
131
|
+
}, item.name));
|
132
|
+
});
|
133
|
+
}
|
134
|
+
});
|
116
135
|
test('renders listview component', function () {
|
117
136
|
getComponent();
|
118
137
|
var listView = screen.getByTestId(testId);
|
@@ -16,8 +16,8 @@ import AccountIcon from '@pingux/mdi-react/AccountIcon';
|
|
16
16
|
import { act } from '@testing-library/react';
|
17
17
|
import { ListViewItem, ListViewItemSwitchField } from '../..';
|
18
18
|
import { pingImg } from '../../utils/devUtils/constants/images';
|
19
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
20
19
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
20
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
21
21
|
import { LIST_ITEM_ICON } from './ListViewItem';
|
22
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
23
23
|
var defaultProps = {
|
@@ -44,8 +44,12 @@ jest.mock('../../hooks/useFallbackImage', function () {
|
|
44
44
|
};
|
45
45
|
});
|
46
46
|
|
47
|
-
//
|
48
|
-
|
47
|
+
// Needs to be added to each components test file
|
48
|
+
universalComponentTests({
|
49
|
+
renderComponent: function renderComponent(props) {
|
50
|
+
return ___EmotionJSX(ListViewItem, _extends({}, defaultProps, props));
|
51
|
+
}
|
52
|
+
});
|
49
53
|
var TEST_TEXT = 'test text';
|
50
54
|
describe('ListViewItem', function () {
|
51
55
|
test('renders data', function () {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { forwardRef } from 'react';
|
2
2
|
import CreateIcon from '@pingux/mdi-react/CreateIcon';
|
3
3
|
import { Box, Icon, IconButton } from '../../..';
|
4
4
|
import { iconButtonPropTypes } from '../../IconButton/iconButtonAttributes';
|
@@ -11,12 +11,14 @@ import { iconButtonPropTypes } from '../../IconButton/iconButtonAttributes';
|
|
11
11
|
* to ListItemEditButton.
|
12
12
|
*/
|
13
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
14
|
-
var ListViewItemEditButton = function
|
15
|
-
return ___EmotionJSX(Box,
|
14
|
+
var ListViewItemEditButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
15
|
+
return ___EmotionJSX(Box, {
|
16
|
+
ref: ref
|
17
|
+
}, ___EmotionJSX(IconButton, props, ___EmotionJSX(Icon, {
|
16
18
|
icon: CreateIcon,
|
17
19
|
size: "sm"
|
18
20
|
})));
|
19
|
-
};
|
21
|
+
});
|
20
22
|
ListViewItemEditButton.propTypes = iconButtonPropTypes;
|
21
23
|
ListViewItemEditButton.displayName = 'ListViewItemEditButton';
|
22
24
|
export default ListViewItemEditButton;
|
@@ -1,16 +1,20 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import userEvent from '@testing-library/user-event';
|
3
3
|
import { ListViewItemEditButton } from '../../..';
|
4
|
-
import axeTest from '../../../utils/testUtils/testAxe';
|
5
4
|
import { render, screen } from '../../../utils/testUtils/testWrapper';
|
5
|
+
import { universalComponentTests } from '../../../utils/testUtils/universalComponentTest';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
7
|
var getComponent = function getComponent() {
|
8
8
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9
9
|
return render(___EmotionJSX(ListViewItemEditButton, props));
|
10
10
|
};
|
11
11
|
|
12
|
-
//
|
13
|
-
|
12
|
+
// Needs to be added to each components test file
|
13
|
+
universalComponentTests({
|
14
|
+
renderComponent: function renderComponent(props) {
|
15
|
+
return ___EmotionJSX(ListViewItemEditButton, props);
|
16
|
+
}
|
17
|
+
});
|
14
18
|
test('ListViewItemEditButton responds to IconButton props', function () {
|
15
19
|
var onPress = jest.fn();
|
16
20
|
getComponent({
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
2
2
|
var _excluded = ["children"];
|
3
|
-
import React from 'react';
|
3
|
+
import React, { forwardRef } from 'react';
|
4
4
|
import MoreVertIcon from '@pingux/mdi-react/MoreVertIcon';
|
5
5
|
import { Icon, IconButton, Menu, PopoverMenu } from '../../..';
|
6
6
|
import { menuPropTypes } from '../../Menu/menuAttributes';
|
@@ -13,16 +13,17 @@ import { menuPropTypes } from '../../Menu/menuAttributes';
|
|
13
13
|
* specs easy. Most props available to the Menu component are available to ListItemMenu.
|
14
14
|
*/
|
15
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
16
|
-
var ListViewItemMenu = function
|
16
|
+
var ListViewItemMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
17
17
|
var children = _ref.children,
|
18
18
|
others = _objectWithoutProperties(_ref, _excluded);
|
19
19
|
return ___EmotionJSX(PopoverMenu, null, ___EmotionJSX(IconButton, {
|
20
|
-
"aria-label": "more"
|
20
|
+
"aria-label": "more",
|
21
|
+
ref: ref
|
21
22
|
}, ___EmotionJSX(Icon, {
|
22
23
|
icon: MoreVertIcon,
|
23
24
|
size: "md"
|
24
25
|
})), ___EmotionJSX(Menu, others, children));
|
25
|
-
};
|
26
|
+
});
|
26
27
|
ListViewItemMenu.propTypes = menuPropTypes;
|
27
28
|
ListViewItemMenu.displayName = 'ListViewItemMenu';
|
28
29
|
export default ListViewItemMenu;
|
@@ -13,16 +13,19 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
13
13
|
import React from 'react';
|
14
14
|
import userEvent from '@testing-library/user-event';
|
15
15
|
import { Item, ListViewItemMenu } from '../../..';
|
16
|
-
import axeTest from '../../../utils/testUtils/testAxe';
|
17
16
|
import { render, screen } from '../../../utils/testUtils/testWrapper';
|
17
|
+
import { universalComponentTests } from '../../../utils/testUtils/universalComponentTest';
|
18
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
19
19
|
var getComponent = function getComponent() {
|
20
20
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
21
21
|
return render(___EmotionJSX(ListViewItemMenu, props, ___EmotionJSX(Item, null, "testItem")));
|
22
22
|
};
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
// Needs to be added to each components test file
|
24
|
+
universalComponentTests({
|
25
|
+
renderComponent: function renderComponent(props) {
|
26
|
+
return ___EmotionJSX(ListViewItemMenu, props, ___EmotionJSX(Item, null, "testItem"));
|
27
|
+
}
|
28
|
+
});
|
26
29
|
test('ListViewItemMenu responds to Menu props', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
27
30
|
var onAction, menuTrigger, menuItem;
|
28
31
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
-
import React from 'react';
|
2
|
+
import React, { forwardRef } from 'react';
|
3
3
|
import { SwitchField } from '../../..';
|
4
4
|
import { switchFieldPropTypes } from '../../SwitchField/switchFieldAttributes';
|
5
5
|
|
@@ -11,14 +11,15 @@ import { switchFieldPropTypes } from '../../SwitchField/switchFieldAttributes';
|
|
11
11
|
* available to ListItemEditButton.
|
12
12
|
*/
|
13
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
14
|
-
var ListViewItemSwitchField = function
|
14
|
+
var ListViewItemSwitchField = /*#__PURE__*/forwardRef(function (props, ref) {
|
15
15
|
return ___EmotionJSX(SwitchField, _extends({
|
16
|
+
ref: ref,
|
16
17
|
role: "group",
|
17
18
|
"aria-label": "active user",
|
18
19
|
isDefaultSelected: true,
|
19
20
|
mr: 0
|
20
21
|
}, props));
|
21
|
-
};
|
22
|
+
});
|
22
23
|
ListViewItemSwitchField.displayName = 'ListViewItemSwitchField';
|
23
24
|
ListViewItemSwitchField.propTypes = switchFieldPropTypes;
|
24
25
|
export default ListViewItemSwitchField;
|
@@ -1,16 +1,20 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import userEvent from '@testing-library/user-event';
|
3
3
|
import { ListViewItemSwitchField } from '../../..';
|
4
|
-
import axeTest from '../../../utils/testUtils/testAxe';
|
5
4
|
import { render, screen } from '../../../utils/testUtils/testWrapper';
|
5
|
+
import { universalComponentTests } from '../../../utils/testUtils/universalComponentTest';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
7
|
var getComponent = function getComponent() {
|
8
8
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9
9
|
return render(___EmotionJSX(ListViewItemSwitchField, props));
|
10
10
|
};
|
11
11
|
|
12
|
-
//
|
13
|
-
|
12
|
+
// Needs to be added to each components test file
|
13
|
+
universalComponentTests({
|
14
|
+
renderComponent: function renderComponent(props) {
|
15
|
+
return ___EmotionJSX(ListViewItemSwitchField, props);
|
16
|
+
}
|
17
|
+
});
|
14
18
|
test('ListViewItemSwitchField responds to SwitchFiled props', function () {
|
15
19
|
var onChange = jest.fn();
|
16
20
|
getComponent({
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
-
import React, { useCallback, useMemo } from 'react';
|
2
|
+
import React, { forwardRef, useCallback, useMemo } from 'react';
|
3
3
|
import { useVisuallyHidden } from 'react-aria';
|
4
4
|
import { Line, LineChart, ResponsiveContainer } from 'recharts';
|
5
5
|
import useResizeObserver from 'use-resize-observer';
|
@@ -7,7 +7,7 @@ import { Box, Button, Text, Tooltip, TooltipTrigger } from '../../../../index';
|
|
7
7
|
import { neutral } from '../../../../styles/colors';
|
8
8
|
import { listViewItemChartPropTypes } from './ListViewItemChartAttributes';
|
9
9
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
10
|
-
var ListViewItemChart = function
|
10
|
+
var ListViewItemChart = /*#__PURE__*/forwardRef(function (props, ref) {
|
11
11
|
var buttonProps = props.buttonProps,
|
12
12
|
chartData = props.chartData,
|
13
13
|
chartLabel = props.chartLabel,
|
@@ -44,7 +44,8 @@ var ListViewItemChart = function ListViewItemChart(props) {
|
|
44
44
|
isRow: true,
|
45
45
|
alignItems: "center",
|
46
46
|
height: 0,
|
47
|
-
mr: "md"
|
47
|
+
mr: "md",
|
48
|
+
ref: ref
|
48
49
|
}, ___EmotionJSX(Box, _extends({
|
49
50
|
variant: "lisViewItemChart.titleContainer"
|
50
51
|
}, hideIfMobile()), ___EmotionJSX(Text, {
|
@@ -82,7 +83,7 @@ var ListViewItemChart = function ListViewItemChart(props) {
|
|
82
83
|
}, ___EmotionJSX(Text, {
|
83
84
|
variant: "variants.lisViewItemChart.trend"
|
84
85
|
}, trend))), ___EmotionJSX(Tooltip, null, tooltipText)));
|
85
|
-
};
|
86
|
+
});
|
86
87
|
ListViewItemChart.propTypes = listViewItemChartPropTypes;
|
87
88
|
ListViewItemChart.displayName = 'ListViewItemChart';
|
88
89
|
export default ListViewItemChart;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import React from 'react';
|
3
3
|
import useResizeObserver from 'use-resize-observer';
|
4
|
-
import axeTest from '../../../../utils/testUtils/testAxe';
|
5
4
|
import { render, screen } from '../../../../utils/testUtils/testWrapper';
|
5
|
+
import { universalComponentTests } from '../../../../utils/testUtils/universalComponentTest';
|
6
6
|
import Box from '../../../Box/Box';
|
7
7
|
import { chartData } from './chartData';
|
8
8
|
import ListViewItemChart from './ListViewItemChart';
|
@@ -50,8 +50,12 @@ afterEach(function () {
|
|
50
50
|
jest.restoreAllMocks();
|
51
51
|
});
|
52
52
|
|
53
|
-
//
|
54
|
-
|
53
|
+
// Needs to be added to each components test file
|
54
|
+
universalComponentTests({
|
55
|
+
renderComponent: function renderComponent(props) {
|
56
|
+
return ___EmotionJSX(ListViewItemChart, props);
|
57
|
+
}
|
58
|
+
});
|
55
59
|
test('renders ListViewItemChart component', function () {
|
56
60
|
getComponent();
|
57
61
|
var chart = screen.getByRole('region');
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import React from 'react';
|
3
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
4
3
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
4
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
5
5
|
import Loader from '.';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
7
|
var testId = 'test-loader';
|
@@ -13,8 +13,12 @@ var getComponent = function getComponent() {
|
|
13
13
|
return render(___EmotionJSX(Loader, _extends({}, defaultProps, props)));
|
14
14
|
};
|
15
15
|
|
16
|
-
//
|
17
|
-
|
16
|
+
// Needs to be added to each components test file
|
17
|
+
universalComponentTests({
|
18
|
+
renderComponent: function renderComponent(props) {
|
19
|
+
return ___EmotionJSX(Loader, _extends({}, defaultProps, props));
|
20
|
+
}
|
21
|
+
});
|
18
22
|
test('default loader', function () {
|
19
23
|
getComponent();
|
20
24
|
var loader = screen.getByRole('alert');
|
@@ -6,8 +6,8 @@ import React from 'react';
|
|
6
6
|
import userEvent from '@testing-library/user-event';
|
7
7
|
import { Item, Menu } from '../../index';
|
8
8
|
import ORIENTATION from '../../utils/devUtils/constants/orientation';
|
9
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
10
9
|
import { fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
|
10
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
11
11
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
12
12
|
var testTitle = 'Test Title';
|
13
13
|
var defaultProps = {
|
@@ -33,8 +33,16 @@ var getComponent = function getComponent() {
|
|
33
33
|
})));
|
34
34
|
};
|
35
35
|
|
36
|
-
//
|
37
|
-
|
36
|
+
// Needs to be added to each components test file
|
37
|
+
universalComponentTests({
|
38
|
+
renderComponent: function renderComponent(props) {
|
39
|
+
return ___EmotionJSX(Menu, _extends({}, defaultProps, props), _mapInstanceProperty(defaultItems).call(defaultItems, function (item) {
|
40
|
+
return ___EmotionJSX(Item, _extends({
|
41
|
+
key: item.key
|
42
|
+
}, item));
|
43
|
+
}));
|
44
|
+
}
|
45
|
+
});
|
38
46
|
test('should render basic menu with children', function () {
|
39
47
|
getComponent();
|
40
48
|
var menu = screen.queryByRole('menu');
|
@@ -5,8 +5,8 @@ import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
5
5
|
import React from 'react';
|
6
6
|
import userEvent from '@testing-library/user-event';
|
7
7
|
import { Item, Menu } from '../../index';
|
8
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
9
8
|
import { fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
|
9
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
10
10
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
11
11
|
var testId = 'testId';
|
12
12
|
var defaultMenuItems = [{
|
@@ -45,8 +45,20 @@ var getComponent = function getComponent() {
|
|
45
45
|
})));
|
46
46
|
};
|
47
47
|
|
48
|
-
//
|
49
|
-
|
48
|
+
// Needs to be added to each components test file
|
49
|
+
universalComponentTests({
|
50
|
+
renderComponent: function renderComponent(props) {
|
51
|
+
return ___EmotionJSX(Menu, _extends({}, defaultProps, props), _mapInstanceProperty(defaultMenuItems).call(defaultMenuItems, function (li) {
|
52
|
+
return ___EmotionJSX(Item, _extends({
|
53
|
+
key: li.key
|
54
|
+
}, li, {
|
55
|
+
sx: {
|
56
|
+
backgroundColor: 'orange'
|
57
|
+
}
|
58
|
+
}));
|
59
|
+
}));
|
60
|
+
}
|
61
|
+
});
|
50
62
|
test('renders menu with menu items', function () {
|
51
63
|
getComponent();
|
52
64
|
var menu = screen.getByRole('menu');
|
@@ -6,8 +6,8 @@ import { act } from 'react-dom/test-utils';
|
|
6
6
|
import { Item } from 'react-stately';
|
7
7
|
import AccountIcon from '@pingux/mdi-react/AccountIcon';
|
8
8
|
import userEvent from '@testing-library/user-event';
|
9
|
-
import axeTest from '../../utils/testUtils/testAxe';
|
10
9
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
10
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
11
11
|
import { ARIA_STATUSES } from './Message';
|
12
12
|
import Messages, { messagesReducerStory, multiMessagesReducerStory } from '.';
|
13
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
@@ -49,8 +49,14 @@ var getWithDynamicList = function getWithDynamicList() {
|
|
49
49
|
}));
|
50
50
|
};
|
51
51
|
|
52
|
-
//
|
53
|
-
|
52
|
+
// Needs to be added to each components test file
|
53
|
+
universalComponentTests({
|
54
|
+
renderComponent: function renderComponent(props) {
|
55
|
+
return ___EmotionJSX(Messages, _extends({}, defaultProps, props), function (item) {
|
56
|
+
return ___EmotionJSX(Item, item, item.text);
|
57
|
+
});
|
58
|
+
}
|
59
|
+
});
|
54
60
|
test('renders Messages component in the default state', function () {
|
55
61
|
getComponent();
|
56
62
|
var messages = screen.getByTestId(testId);
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import userEvent from '@testing-library/user-event';
|
3
3
|
import { Modal, OverlayProvider } from '../../../index';
|
4
|
-
import axeTest from '../../../utils/testUtils/testAxe';
|
5
4
|
import { queryByAttribute, render, screen } from '../../../utils/testUtils/testWrapper';
|
5
|
+
import { universalComponentTests } from '../../../utils/testUtils/universalComponentTest';
|
6
6
|
|
7
7
|
// For testing the modal alone
|
8
8
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
@@ -15,8 +15,12 @@ var getComponent = function getComponent() {
|
|
15
15
|
// Unit tests
|
16
16
|
// **********
|
17
17
|
|
18
|
-
//
|
19
|
-
|
18
|
+
// Needs to be added to each components test file
|
19
|
+
universalComponentTests({
|
20
|
+
renderComponent: function renderComponent(props) {
|
21
|
+
return ___EmotionJSX(Modal, props);
|
22
|
+
}
|
23
|
+
});
|
20
24
|
test('default modal', function () {
|
21
25
|
getComponent();
|
22
26
|
expect(screen.queryByRole('dialog')).toBeInTheDocument();
|