@shopgate/pwa-ui-shared 7.31.5 → 7.31.6
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/package.json +5 -5
- package/AccordionContainer/spec.js +0 -35
- package/ActionButton/spec.js +0 -69
- package/AddToCartButton/spec.js +0 -68
- package/Availability/spec.js +0 -42
- package/Button/spec.js +0 -38
- package/ButtonLink/spec.js +0 -25
- package/Chip/spec.js +0 -27
- package/ContextMenu/spec.js +0 -113
- package/Dialog/components/HtmlContentDialog/spec.js +0 -101
- package/Dialog/components/PipelineErrorDialog/spec.js +0 -105
- package/Dialog/components/TextMessageDialog/spec.js +0 -62
- package/Dialog/components/VariantSelectModal/spec.js +0 -55
- package/Dialog/spec.js +0 -84
- package/DiscountBadge/spec.js +0 -20
- package/FavoritesButton/spec.js +0 -131
- package/Form/Builder/classes/ActionListener/spec.js +0 -323
- package/Form/Builder/spec.js +0 -309
- package/Form/InfoField/spec.js +0 -12
- package/Form/Password/spec.js +0 -39
- package/Form/RadioGroup/spec.js +0 -97
- package/Form/Select/spec.js +0 -39
- package/Form/SelectContextChoices/spec.js +0 -36
- package/Form/TextField/spec.js +0 -124
- package/FormElement/spec.js +0 -68
- package/Glow/spec.js +0 -14
- package/IndicatorCircle/spec.js +0 -26
- package/PlaceholderLabel/spec.js +0 -26
- package/PlaceholderParagraph/spec.js +0 -26
- package/ProgressBar/spec.js +0 -14
- package/RadioButton/spec.js +0 -22
- package/RatingStars/spec.js +0 -91
- package/RippleButton/spec.js +0 -58
- package/Sheet/components/Header/components/SearchBar/spec.js +0 -22
- package/Sheet/components/Header/spec.js +0 -15
- package/Sheet/spec.js +0 -100
- package/TaxDisclaimer/spec.js +0 -43
- package/TextField/spec.js +0 -146
- package/ToggleIcon/spec.js +0 -39
- package/tsconfig.build.json +0 -16
- package/tsconfig.json +0 -3
package/ToggleIcon/spec.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
import ToggleIcon from "./index";
|
|
4
|
-
import VisibilityIcon from "../icons/VisibilityIcon";
|
|
5
|
-
import VisibilityOffIcon from "../icons/VisibilityOffIcon";
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const inputProps = {
|
|
8
|
-
onIcon: /*#__PURE__*/_jsx(VisibilityIcon, {}),
|
|
9
|
-
offIcon: /*#__PURE__*/_jsx(VisibilityOffIcon, {})
|
|
10
|
-
};
|
|
11
|
-
describe('<ToggleIcon>', () => {
|
|
12
|
-
it('should render a toggle icon', () => {
|
|
13
|
-
const wrapper = mount(/*#__PURE__*/_jsx(ToggleIcon, {
|
|
14
|
-
...inputProps
|
|
15
|
-
}));
|
|
16
|
-
expect(wrapper).toMatchSnapshot();
|
|
17
|
-
expect(wrapper.find('VisibilityIcon').length).toBe(1);
|
|
18
|
-
expect(wrapper.find('VisibilityOffIcon').length).toBe(0);
|
|
19
|
-
});
|
|
20
|
-
it('should render a toggle icon with false as default', () => {
|
|
21
|
-
const wrapper = mount(/*#__PURE__*/_jsx(ToggleIcon, {
|
|
22
|
-
...inputProps,
|
|
23
|
-
on: false
|
|
24
|
-
}));
|
|
25
|
-
expect(wrapper).toMatchSnapshot();
|
|
26
|
-
expect(wrapper.find('VisibilityIcon').length).toBe(0);
|
|
27
|
-
expect(wrapper.find('VisibilityOffIcon').length).toBe(1);
|
|
28
|
-
});
|
|
29
|
-
it('should trigger the toggleHandler callback', () => {
|
|
30
|
-
const mockToggleHandler = jest.fn();
|
|
31
|
-
const wrapper = mount(/*#__PURE__*/_jsx(ToggleIcon, {
|
|
32
|
-
...inputProps,
|
|
33
|
-
toggleHandler: mockToggleHandler
|
|
34
|
-
}));
|
|
35
|
-
wrapper.find('div').simulate('click');
|
|
36
|
-
expect(wrapper).toMatchSnapshot();
|
|
37
|
-
expect(mockToggleHandler.mock.calls.length).toBe(1);
|
|
38
|
-
});
|
|
39
|
-
});
|
package/tsconfig.build.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@shopgate/engage/tsconfig.build.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./dist",
|
|
5
|
-
"rootDir": "."
|
|
6
|
-
},
|
|
7
|
-
"include": ["**/*.ts", "**/*.tsx"],
|
|
8
|
-
"exclude": [
|
|
9
|
-
"dist",
|
|
10
|
-
"node_modules",
|
|
11
|
-
"**/*.spec.*",
|
|
12
|
-
"**/__tests__/**",
|
|
13
|
-
"**/__snapshots__/**",
|
|
14
|
-
"coverage"
|
|
15
|
-
]
|
|
16
|
-
}
|
package/tsconfig.json
DELETED