@shopgate/pwa-ui-shared 7.32.0-beta.1 → 7.32.0-beta.10
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/ActionButton/index.js +4 -0
- package/AddToCartButton/index.js +4 -1
- package/Button/index.js +10 -3
- package/ButtonLink/index.js +4 -0
- package/Card/index.js +13 -34
- package/CardList/components/Item/index.js +26 -20
- package/CardList/index.js +2 -1
- package/CartTotalLine/index.js +1 -1
- package/Dialog/components/PipelineErrorDialog/index.js +2 -1
- package/Glow/index.js +4 -3
- package/NoResults/index.js +1 -1
- package/RatingStars/index.js +16 -5
- package/RippleButton/index.js +5 -1
- package/ScannerOverlay/components/ScannerBar/index.js +1 -1
- package/Sheet/components/Header/index.js +3 -4
- package/Sheet/index.js +15 -6
- package/TaxDisclaimer/index.js +0 -1
- package/icons/AccountBoxIcon.d.ts +1 -1
- package/icons/AccountBoxIcon.d.ts.map +1 -1
- package/icons/AddMoreIcon.d.ts +1 -1
- package/icons/AddMoreIcon.d.ts.map +1 -1
- package/icons/ArrowDropIcon.d.ts +1 -1
- package/icons/ArrowDropIcon.d.ts.map +1 -1
- package/icons/ArrowIcon.d.ts +1 -1
- package/icons/ArrowIcon.d.ts.map +1 -1
- package/icons/BarcodeScannerIcon.d.ts +1 -1
- package/icons/BarcodeScannerIcon.d.ts.map +1 -1
- package/icons/BoxIcon.d.ts +1 -1
- package/icons/BoxIcon.d.ts.map +1 -1
- package/icons/BrowseIcon.d.ts +2 -1
- package/icons/BrowseIcon.d.ts.map +1 -1
- package/icons/BurgerIcon.d.ts +1 -1
- package/icons/BurgerIcon.d.ts.map +1 -1
- package/icons/CalendarIcon.d.ts +2 -1
- package/icons/CalendarIcon.d.ts.map +1 -1
- package/icons/CartCouponIcon.d.ts +2 -1
- package/icons/CartCouponIcon.d.ts.map +1 -1
- package/icons/CartIcon.d.ts +2 -1
- package/icons/CartIcon.d.ts.map +1 -1
- package/icons/CartPlusIcon.d.ts +2 -1
- package/icons/CartPlusIcon.d.ts.map +1 -1
- package/icons/CheckIcon.d.ts +2 -1
- package/icons/CheckIcon.d.ts.map +1 -1
- package/icons/CheckedIcon.d.ts +1 -1
- package/icons/CheckedIcon.d.ts.map +1 -1
- package/icons/ChevronIcon.d.ts +2 -1
- package/icons/ChevronIcon.d.ts.map +1 -1
- package/icons/CreditCardIcon.d.ts +2 -1
- package/icons/CreditCardIcon.d.ts.map +1 -1
- package/icons/CrossIcon.d.ts +2 -1
- package/icons/CrossIcon.d.ts.map +1 -1
- package/icons/DescriptionIcon.d.ts +2 -1
- package/icons/DescriptionIcon.d.ts.map +1 -1
- package/icons/FilterIcon.d.ts +2 -1
- package/icons/FilterIcon.d.ts.map +1 -1
- package/icons/FlashDisabledIcon.d.ts +2 -1
- package/icons/FlashDisabledIcon.d.ts.map +1 -1
- package/icons/FlashEnabledIcon.d.ts +2 -1
- package/icons/FlashEnabledIcon.d.ts.map +1 -1
- package/icons/GridIcon.d.ts +2 -1
- package/icons/GridIcon.d.ts.map +1 -1
- package/icons/HeartIcon.d.ts +2 -1
- package/icons/HeartIcon.d.ts.map +1 -1
- package/icons/HeartOutlineIcon.d.ts +2 -1
- package/icons/HeartOutlineIcon.d.ts.map +1 -1
- package/icons/HeartPlusIcon.d.ts +2 -1
- package/icons/HeartPlusIcon.d.ts.map +1 -1
- package/icons/HeartPlusOutlineIcon.d.ts +2 -1
- package/icons/HeartPlusOutlineIcon.d.ts.map +1 -1
- package/icons/HomeIcon.d.ts +2 -1
- package/icons/HomeIcon.d.ts.map +1 -1
- package/icons/InfoIcon.d.ts +2 -1
- package/icons/InfoIcon.d.ts.map +1 -1
- package/icons/InfoOutlineIcon.d.ts +2 -1
- package/icons/InfoOutlineIcon.d.ts.map +1 -1
- package/icons/ListIcon.d.ts +2 -1
- package/icons/ListIcon.d.ts.map +1 -1
- package/icons/LocalShippingIcon.d.ts +2 -1
- package/icons/LocalShippingIcon.d.ts.map +1 -1
- package/icons/LocationIcon.d.ts +2 -1
- package/icons/LocationIcon.d.ts.map +1 -1
- package/icons/LocatorIcon.d.ts +2 -1
- package/icons/LocatorIcon.d.ts.map +1 -1
- package/icons/LockIcon.d.ts +2 -1
- package/icons/LockIcon.d.ts.map +1 -1
- package/icons/LogoutIcon.d.ts +2 -1
- package/icons/LogoutIcon.d.ts.map +1 -1
- package/icons/MagnifierIcon.d.ts +2 -1
- package/icons/MagnifierIcon.d.ts.map +1 -1
- package/icons/MapMarkerIcon.d.ts +2 -1
- package/icons/MapMarkerIcon.d.ts.map +1 -1
- package/icons/MoreIcon.d.ts +2 -1
- package/icons/MoreIcon.d.ts.map +1 -1
- package/icons/MoreVertIcon.d.ts +2 -1
- package/icons/MoreVertIcon.d.ts.map +1 -1
- package/icons/NotificationIcon.d.ts +2 -1
- package/icons/NotificationIcon.d.ts.map +1 -1
- package/icons/PersonIcon.d.ts +2 -1
- package/icons/PersonIcon.d.ts.map +1 -1
- package/icons/PhoneIcon.d.ts +2 -1
- package/icons/PhoneIcon.d.ts.map +1 -1
- package/icons/PlaceholderIcon.d.ts +2 -1
- package/icons/PlaceholderIcon.d.ts.map +1 -1
- package/icons/RadioCheckedIcon.d.ts +2 -1
- package/icons/RadioCheckedIcon.d.ts.map +1 -1
- package/icons/RadioUncheckedIcon.d.ts +2 -1
- package/icons/RadioUncheckedIcon.d.ts.map +1 -1
- package/icons/SecurityIcon.d.ts +2 -1
- package/icons/SecurityIcon.d.ts.map +1 -1
- package/icons/ShippingMethodIcon.d.ts +2 -1
- package/icons/ShippingMethodIcon.d.ts.map +1 -1
- package/icons/ShoppingCartIcon.d.ts +2 -1
- package/icons/ShoppingCartIcon.d.ts.map +1 -1
- package/icons/SortIcon.d.ts +2 -1
- package/icons/SortIcon.d.ts.map +1 -1
- package/icons/StarHalfIcon.d.ts +2 -1
- package/icons/StarHalfIcon.d.ts.map +1 -1
- package/icons/StarIcon.d.ts +2 -1
- package/icons/StarIcon.d.ts.map +1 -1
- package/icons/StarOutlineIcon.d.ts +2 -1
- package/icons/StarOutlineIcon.d.ts.map +1 -1
- package/icons/StopIcon.d.ts +2 -1
- package/icons/StopIcon.d.ts.map +1 -1
- package/icons/TickIcon.d.ts +2 -1
- package/icons/TickIcon.d.ts.map +1 -1
- package/icons/TimeIcon.d.ts +2 -1
- package/icons/TimeIcon.d.ts.map +1 -1
- package/icons/TrashIcon.d.ts +1 -1
- package/icons/TrashIcon.d.ts.map +1 -1
- package/icons/TrashOutlineIcon.d.ts +2 -1
- package/icons/TrashOutlineIcon.d.ts.map +1 -1
- package/icons/UncheckedIcon.d.ts +2 -1
- package/icons/UncheckedIcon.d.ts.map +1 -1
- package/icons/ViewListIcon.d.ts +2 -1
- package/icons/ViewListIcon.d.ts.map +1 -1
- package/icons/VisibilityIcon.d.ts +2 -1
- package/icons/VisibilityIcon.d.ts.map +1 -1
- package/icons/VisibilityOffIcon.d.ts +2 -1
- package/icons/VisibilityOffIcon.d.ts.map +1 -1
- package/icons/WarningIcon.d.ts +2 -1
- package/icons/WarningIcon.d.ts.map +1 -1
- package/package.json +5 -5
- package/AccordionContainer/spec.js +0 -35
- package/ActionButton/spec.js +0 -66
- package/AddToCartButton/spec.js +0 -68
- package/Availability/spec.js +0 -42
- package/Button/spec.js +0 -38
- package/ButtonLink/spec.js +0 -29
- package/Chip/spec.js +0 -27
- package/ContextMenu/spec.js +0 -113
- package/Dialog/components/HtmlContentDialog/spec.js +0 -107
- package/Dialog/components/PipelineErrorDialog/spec.js +0 -89
- 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 -17
- package/Sheet/spec.js +0 -100
- package/TaxDisclaimer/spec.js +0 -44
- package/TextField/spec.js +0 -146
- package/ToggleIcon/spec.js +0 -39
- package/tsconfig.build.json +0 -16
- package/tsconfig.json +0 -3
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The shipping method icon component.
|
|
4
5
|
*/
|
|
5
|
-
declare const ShippingMethodIcon: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const ShippingMethodIcon: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default ShippingMethodIcon;
|
|
7
8
|
//# sourceMappingURL=ShippingMethodIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShippingMethodIcon.d.ts","sourceRoot":"","sources":["../../icons/ShippingMethodIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ShippingMethodIcon.d.ts","sourceRoot":"","sources":["../../icons/ShippingMethodIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAUtE;;GAEG;AACH,QAAA,MAAM,kBAAkB,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACc,CAAC;AAE5E,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The shopping cart icon component.
|
|
4
5
|
*/
|
|
5
|
-
declare const ShoppingCart: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const ShoppingCart: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default ShoppingCart;
|
|
7
8
|
//# sourceMappingURL=ShoppingCartIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShoppingCartIcon.d.ts","sourceRoot":"","sources":["../../icons/ShoppingCartIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ShoppingCartIcon.d.ts","sourceRoot":"","sources":["../../icons/ShoppingCartIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;GAEG;AACH,QAAA,MAAM,YAAY,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACQ,CAAC;AAEhE,eAAe,YAAY,CAAC"}
|
package/icons/SortIcon.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The sort icon component.
|
|
4
5
|
*/
|
|
5
|
-
declare const Sort: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const Sort: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default Sort;
|
|
7
8
|
//# sourceMappingURL=SortIcon.d.ts.map
|
package/icons/SortIcon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortIcon.d.ts","sourceRoot":"","sources":["../../icons/SortIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SortIcon.d.ts","sourceRoot":"","sources":["../../icons/SortIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAGtE;;GAEG;AACH,QAAA,MAAM,IAAI,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACQ,CAAC;AAExD,eAAe,IAAI,CAAC"}
|
package/icons/StarHalfIcon.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The half-filled star icon component
|
|
4
5
|
*/
|
|
5
|
-
declare const StarHalfIcon: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const StarHalfIcon: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default StarHalfIcon;
|
|
7
8
|
//# sourceMappingURL=StarHalfIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StarHalfIcon.d.ts","sourceRoot":"","sources":["../../icons/StarHalfIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StarHalfIcon.d.ts","sourceRoot":"","sources":["../../icons/StarHalfIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;GAEG;AACH,QAAA,MAAM,YAAY,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACI,CAAC;AAE5D,eAAe,YAAY,CAAC"}
|
package/icons/StarIcon.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The star icon component
|
|
4
5
|
*/
|
|
5
|
-
declare const Star: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const Star: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default Star;
|
|
7
8
|
//# sourceMappingURL=StarIcon.d.ts.map
|
package/icons/StarIcon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StarIcon.d.ts","sourceRoot":"","sources":["../../icons/StarIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StarIcon.d.ts","sourceRoot":"","sources":["../../icons/StarIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;GAEG;AACH,QAAA,MAAM,IAAI,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACQ,CAAC;AAExD,eAAe,IAAI,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The star-outline icon component.
|
|
4
5
|
*/
|
|
5
|
-
declare const StarOutline: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const StarOutline: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default StarOutline;
|
|
7
8
|
//# sourceMappingURL=StarOutlineIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StarOutlineIcon.d.ts","sourceRoot":"","sources":["../../icons/StarOutlineIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StarOutlineIcon.d.ts","sourceRoot":"","sources":["../../icons/StarOutlineIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;GAEG;AACH,QAAA,MAAM,WAAW,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACQ,CAAC;AAE/D,eAAe,WAAW,CAAC"}
|
package/icons/StopIcon.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The stop icon component.
|
|
4
5
|
*/
|
|
5
|
-
declare const StopIcon: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const StopIcon: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default StopIcon;
|
|
7
8
|
//# sourceMappingURL=StopIcon.d.ts.map
|
package/icons/StopIcon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StopIcon.d.ts","sourceRoot":"","sources":["../../icons/StopIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StopIcon.d.ts","sourceRoot":"","sources":["../../icons/StopIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;GAEG;AACH,QAAA,MAAM,QAAQ,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACI,CAAC;AAExD,eAAe,QAAQ,CAAC"}
|
package/icons/TickIcon.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The tick icon component.
|
|
4
5
|
*/
|
|
5
|
-
declare const Tick: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const Tick: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default Tick;
|
|
7
8
|
//# sourceMappingURL=TickIcon.d.ts.map
|
package/icons/TickIcon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TickIcon.d.ts","sourceRoot":"","sources":["../../icons/TickIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TickIcon.d.ts","sourceRoot":"","sources":["../../icons/TickIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;GAEG;AACH,QAAA,MAAM,IAAI,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACQ,CAAC;AAExD,eAAe,IAAI,CAAC"}
|
package/icons/TimeIcon.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The time icon component.
|
|
4
5
|
*/
|
|
5
|
-
declare const TimeIcon: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const TimeIcon: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default TimeIcon;
|
|
7
8
|
//# sourceMappingURL=TimeIcon.d.ts.map
|
package/icons/TimeIcon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeIcon.d.ts","sourceRoot":"","sources":["../../icons/TimeIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeIcon.d.ts","sourceRoot":"","sources":["../../icons/TimeIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAMtE;;GAEG;AACH,QAAA,MAAM,QAAQ,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACe,CAAC;AAEnE,eAAe,QAAQ,CAAC"}
|
package/icons/TrashIcon.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
|
2
2
|
/**
|
|
3
3
|
* The trash icon component.
|
|
4
4
|
*/
|
|
5
|
-
declare const Trash: (props: Omit<IconProps, "content">) => import("react
|
|
5
|
+
declare const Trash: (props: Omit<IconProps, "content">) => import("react").JSX.Element;
|
|
6
6
|
export default Trash;
|
|
7
7
|
//# sourceMappingURL=TrashIcon.d.ts.map
|
package/icons/TrashIcon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrashIcon.d.ts","sourceRoot":"","sources":["../../icons/TrashIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;GAEG;AACH,QAAA,MAAM,KAAK,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"TrashIcon.d.ts","sourceRoot":"","sources":["../../icons/TrashIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;GAEG;AACH,QAAA,MAAM,KAAK,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,gCACQ,CAAC;AAEzD,eAAe,KAAK,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The trash outline icon component.
|
|
4
5
|
* @link https://fonts.google.com/icons?selected=Material+Icons:delete_outline:&icon.query=trash
|
|
5
6
|
*/
|
|
6
|
-
declare const TrashOutline: (props: Omit<IconProps, "content">) =>
|
|
7
|
+
declare const TrashOutline: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
7
8
|
export default TrashOutline;
|
|
8
9
|
//# sourceMappingURL=TrashOutlineIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrashOutlineIcon.d.ts","sourceRoot":"","sources":["../../icons/TrashOutlineIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TrashOutlineIcon.d.ts","sourceRoot":"","sources":["../../icons/TrashOutlineIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAKtE;;;GAGG;AACH,QAAA,MAAM,YAAY,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBAGrD,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
package/icons/UncheckedIcon.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The unchecked icon component.
|
|
4
5
|
*/
|
|
5
|
-
declare const Unchecked: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const Unchecked: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default Unchecked;
|
|
7
8
|
//# sourceMappingURL=UncheckedIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UncheckedIcon.d.ts","sourceRoot":"","sources":["../../icons/UncheckedIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UncheckedIcon.d.ts","sourceRoot":"","sources":["../../icons/UncheckedIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;GAEG;AACH,QAAA,MAAM,SAAS,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACQ,CAAC;AAE7D,eAAe,SAAS,CAAC"}
|
package/icons/ViewListIcon.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The view list icon component.
|
|
4
5
|
*/
|
|
5
|
-
declare const ViewList: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const ViewList: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default ViewList;
|
|
7
8
|
//# sourceMappingURL=ViewListIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewListIcon.d.ts","sourceRoot":"","sources":["../../icons/ViewListIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewListIcon.d.ts","sourceRoot":"","sources":["../../icons/ViewListIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;GAEG;AACH,QAAA,MAAM,QAAQ,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACQ,CAAC;AAE5D,eAAe,QAAQ,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The visibility icon component.
|
|
4
5
|
* https://material.io/tools/icons/?icon=visibility&style=baseline
|
|
5
6
|
*/
|
|
6
|
-
declare const VisibilityIcon: (props: Omit<IconProps, "content">) =>
|
|
7
|
+
declare const VisibilityIcon: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
7
8
|
export default VisibilityIcon;
|
|
8
9
|
//# sourceMappingURL=VisibilityIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisibilityIcon.d.ts","sourceRoot":"","sources":["../../icons/VisibilityIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VisibilityIcon.d.ts","sourceRoot":"","sources":["../../icons/VisibilityIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;;GAGG;AACH,QAAA,MAAM,cAAc,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACI,CAAC;AAE9D,eAAe,cAAc,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The visibility off icon component.
|
|
4
5
|
* https://material.io/tools/icons/?icon=visibility_off&style=baseline
|
|
5
6
|
*/
|
|
6
|
-
declare const VisibilityOffIcon: (props: Omit<IconProps, "content">) =>
|
|
7
|
+
declare const VisibilityOffIcon: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
7
8
|
export default VisibilityOffIcon;
|
|
8
9
|
//# sourceMappingURL=VisibilityOffIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisibilityOffIcon.d.ts","sourceRoot":"","sources":["../../icons/VisibilityOffIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VisibilityOffIcon.d.ts","sourceRoot":"","sources":["../../icons/VisibilityOffIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;;GAGG;AACH,QAAA,MAAM,iBAAiB,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACI,CAAC;AAEjE,eAAe,iBAAiB,CAAC"}
|
package/icons/WarningIcon.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { IconProps } from '@shopgate/pwa-common/components/Icon';
|
|
2
3
|
/**
|
|
3
4
|
* The warning icon component.
|
|
4
5
|
*/
|
|
5
|
-
declare const WarningIcon: (props: Omit<IconProps, "content">) =>
|
|
6
|
+
declare const WarningIcon: (props: Omit<IconProps, "content">) => React.JSX.Element;
|
|
6
7
|
export default WarningIcon;
|
|
7
8
|
//# sourceMappingURL=WarningIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningIcon.d.ts","sourceRoot":"","sources":["../../icons/WarningIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WarningIcon.d.ts","sourceRoot":"","sources":["../../icons/WarningIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAItE;;GAEG;AACH,QAAA,MAAM,WAAW,GAAI,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,sBACI,CAAC;AAE3D,eAAe,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-ui-shared",
|
|
3
|
-
"version": "7.32.0-beta.
|
|
3
|
+
"version": "7.32.0-beta.10",
|
|
4
4
|
"description": "Shopgate's shared UI components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@shopgate/pwa-ui-ios": "7.32.0-beta.
|
|
9
|
-
"@shopgate/pwa-ui-material": "7.32.0-beta.
|
|
8
|
+
"@shopgate/pwa-ui-ios": "7.32.0-beta.10",
|
|
9
|
+
"@shopgate/pwa-ui-material": "7.32.0-beta.10"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@shopgate/pwa-common": "7.32.0-beta.
|
|
13
|
-
"@shopgate/pwa-common-commerce": "7.32.0-beta.
|
|
12
|
+
"@shopgate/pwa-common": "7.32.0-beta.10",
|
|
13
|
+
"@shopgate/pwa-common-commerce": "7.32.0-beta.10",
|
|
14
14
|
"classnames": "2.5.1",
|
|
15
15
|
"react": "^17.0.2"
|
|
16
16
|
},
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
3
|
-
import AccordionContainer from "./index";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @returns {JSX}
|
|
7
|
-
*/
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const Child = () => /*#__PURE__*/_jsx("div", {});
|
|
10
|
-
describe('<AccordionContainer />', () => {
|
|
11
|
-
it('should render children with props', () => {
|
|
12
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(AccordionContainer, {
|
|
13
|
-
children: props => /*#__PURE__*/_jsx(Child, {
|
|
14
|
-
...props
|
|
15
|
-
})
|
|
16
|
-
}));
|
|
17
|
-
const props = wrapper.find('Child').props();
|
|
18
|
-
expect(wrapper).toMatchSnapshot();
|
|
19
|
-
expect(props.open).toEqual(false);
|
|
20
|
-
expect(typeof props.handleOpen).toEqual('function');
|
|
21
|
-
expect(typeof props.handleClose).toEqual('function');
|
|
22
|
-
});
|
|
23
|
-
it('should update children props when state changes', () => {
|
|
24
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(AccordionContainer, {
|
|
25
|
-
children: props => /*#__PURE__*/_jsx(Child, {
|
|
26
|
-
...props
|
|
27
|
-
})
|
|
28
|
-
}));
|
|
29
|
-
wrapper.setState({
|
|
30
|
-
open: true
|
|
31
|
-
});
|
|
32
|
-
expect(wrapper).toMatchSnapshot();
|
|
33
|
-
expect(wrapper.find('Child').props().open).toEqual(true);
|
|
34
|
-
});
|
|
35
|
-
});
|
package/ActionButton/spec.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
|
-
import ActionButton from "./index";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
describe('<ActionButton />', () => {
|
|
6
|
-
const renderComponent = (props = {}) => render(/*#__PURE__*/_jsx(ActionButton, {
|
|
7
|
-
...props,
|
|
8
|
-
children: "Action Button"
|
|
9
|
-
}));
|
|
10
|
-
describe('Given the component was mounted to the DOM', () => {
|
|
11
|
-
let renderedElement;
|
|
12
|
-
let mockOnClick;
|
|
13
|
-
beforeEach(() => {
|
|
14
|
-
jest.useFakeTimers();
|
|
15
|
-
mockOnClick = jest.fn();
|
|
16
|
-
renderedElement = renderComponent({
|
|
17
|
-
onClick: mockOnClick
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
afterEach(() => {
|
|
21
|
-
jest.clearAllTimers();
|
|
22
|
-
jest.useRealTimers();
|
|
23
|
-
});
|
|
24
|
-
it('should match snapshot', () => {
|
|
25
|
-
expect(renderedElement.container.firstChild).toMatchSnapshot();
|
|
26
|
-
});
|
|
27
|
-
it('should not show the loading indicator by default', () => {
|
|
28
|
-
const indicator = renderedElement.container.querySelector('[data-test-id="loadingIndicator"]');
|
|
29
|
-
expect(indicator).toBeNull();
|
|
30
|
-
});
|
|
31
|
-
describe('Given the loading prop is set to true', () => {
|
|
32
|
-
beforeEach(() => {
|
|
33
|
-
renderedElement.rerender(/*#__PURE__*/_jsx(ActionButton, {
|
|
34
|
-
onClick: mockOnClick,
|
|
35
|
-
loading: true,
|
|
36
|
-
children: "Action Button"
|
|
37
|
-
}));
|
|
38
|
-
});
|
|
39
|
-
it('should match snapshot', () => {
|
|
40
|
-
expect(renderedElement.container.firstChild).toMatchSnapshot();
|
|
41
|
-
});
|
|
42
|
-
it('should show the loading indicator', () => {
|
|
43
|
-
const indicator = renderedElement.container.querySelector('[data-test-id="loadingIndicator"]');
|
|
44
|
-
expect(indicator).toBeTruthy();
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
describe('Given the component gets clicked', () => {
|
|
48
|
-
let timeoutSpy;
|
|
49
|
-
beforeEach(() => {
|
|
50
|
-
timeoutSpy = jest.spyOn(global, 'setTimeout');
|
|
51
|
-
fireEvent.click(screen.getByRole('button'));
|
|
52
|
-
});
|
|
53
|
-
afterEach(() => {
|
|
54
|
-
timeoutSpy.mockRestore();
|
|
55
|
-
});
|
|
56
|
-
it('should use setTimeout for delaying the onClick handler', () => {
|
|
57
|
-
expect(timeoutSpy).toHaveBeenCalledTimes(1);
|
|
58
|
-
expect(timeoutSpy.mock.calls[0][1]).toBe(ActionButton.clickDelay);
|
|
59
|
-
});
|
|
60
|
-
it('should eventually call the onClick handler', () => {
|
|
61
|
-
jest.runOnlyPendingTimers();
|
|
62
|
-
expect(mockOnClick).toHaveBeenCalledTimes(1);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
package/AddToCartButton/spec.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
import { act } from 'react-dom/test-utils';
|
|
4
|
-
import AddToCartButton from "./index";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Flushes the promise queue.
|
|
8
|
-
* @returns {Promise}
|
|
9
|
-
*/
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
const flushMicrotasks = () => Promise.resolve();
|
|
12
|
-
describe('<AddToCartButton />', () => {
|
|
13
|
-
it('should render in loading state and should not be clickable', () => {
|
|
14
|
-
const spy = jest.fn(() => Promise.resolve());
|
|
15
|
-
const wrapper = mount(/*#__PURE__*/_jsx(AddToCartButton, {
|
|
16
|
-
onClick: spy,
|
|
17
|
-
isLoading: true,
|
|
18
|
-
isOrderable: true,
|
|
19
|
-
isDisabled: false
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
// Click shouldn’t fire when loading
|
|
23
|
-
wrapper.find('button').prop('onClick')();
|
|
24
|
-
expect(wrapper).toMatchSnapshot();
|
|
25
|
-
expect(spy).toHaveBeenCalledTimes(0);
|
|
26
|
-
});
|
|
27
|
-
it('should render with checkmark icon and should not be clickable the second time', async () => {
|
|
28
|
-
const spy = jest.fn(() => Promise.resolve());
|
|
29
|
-
const wrapper = mount(/*#__PURE__*/_jsx(AddToCartButton, {
|
|
30
|
-
onClick: spy,
|
|
31
|
-
isLoading: false,
|
|
32
|
-
isOrderable: true,
|
|
33
|
-
isDisabled: false
|
|
34
|
-
}));
|
|
35
|
-
|
|
36
|
-
// First click triggers async work
|
|
37
|
-
await act(async () => {
|
|
38
|
-
wrapper.find('button').prop('onClick')();
|
|
39
|
-
await flushMicrotasks();
|
|
40
|
-
});
|
|
41
|
-
wrapper.update();
|
|
42
|
-
|
|
43
|
-
// Second click should be ignored
|
|
44
|
-
await act(async () => {
|
|
45
|
-
wrapper.find('button').prop('onClick')();
|
|
46
|
-
await flushMicrotasks();
|
|
47
|
-
});
|
|
48
|
-
wrapper.update();
|
|
49
|
-
expect(wrapper).toMatchSnapshot();
|
|
50
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
51
|
-
});
|
|
52
|
-
it('should render with cart icon and should be clickable', async () => {
|
|
53
|
-
const spy = jest.fn(() => Promise.resolve());
|
|
54
|
-
const wrapper = mount(/*#__PURE__*/_jsx(AddToCartButton, {
|
|
55
|
-
onClick: spy,
|
|
56
|
-
isLoading: false,
|
|
57
|
-
isOrderable: true,
|
|
58
|
-
isDisabled: false
|
|
59
|
-
}));
|
|
60
|
-
await act(async () => {
|
|
61
|
-
wrapper.find('button').prop('onClick')();
|
|
62
|
-
await flushMicrotasks();
|
|
63
|
-
});
|
|
64
|
-
wrapper.update();
|
|
65
|
-
expect(wrapper).toMatchSnapshot();
|
|
66
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
67
|
-
});
|
|
68
|
-
});
|
package/Availability/spec.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import { AVAILABILITY_STATE_OK, AVAILABILITY_STATE_WARNING, AVAILABILITY_STATE_ALERT } from '@shopgate/pwa-common-commerce/product/constants';
|
|
4
|
-
import Availability from "./index";
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
describe('<Availability />', () => {
|
|
7
|
-
it('should not render when text is empty', () => {
|
|
8
|
-
const wrapper = render(/*#__PURE__*/_jsx(Availability, {
|
|
9
|
-
text: ""
|
|
10
|
-
}));
|
|
11
|
-
expect(wrapper.asFragment()).toMatchSnapshot();
|
|
12
|
-
});
|
|
13
|
-
it('should not render by default if state is "ok"', () => {
|
|
14
|
-
const wrapper = render(/*#__PURE__*/_jsx(Availability, {
|
|
15
|
-
state: AVAILABILITY_STATE_OK,
|
|
16
|
-
text: "Available"
|
|
17
|
-
}));
|
|
18
|
-
expect(wrapper.asFragment()).toMatchSnapshot();
|
|
19
|
-
});
|
|
20
|
-
it('should render if state is "ok" when "showWhenAvailable" is set', () => {
|
|
21
|
-
const wrapper = render(/*#__PURE__*/_jsx(Availability, {
|
|
22
|
-
state: AVAILABILITY_STATE_OK,
|
|
23
|
-
text: "Available",
|
|
24
|
-
showWhenAvailable: true
|
|
25
|
-
}));
|
|
26
|
-
expect(wrapper.asFragment()).toMatchSnapshot();
|
|
27
|
-
});
|
|
28
|
-
it('should render if state is "warning"', () => {
|
|
29
|
-
const wrapper = render(/*#__PURE__*/_jsx(Availability, {
|
|
30
|
-
state: AVAILABILITY_STATE_WARNING,
|
|
31
|
-
text: "Only 5 left"
|
|
32
|
-
}));
|
|
33
|
-
expect(wrapper.asFragment()).toMatchSnapshot();
|
|
34
|
-
});
|
|
35
|
-
it('should render if state is "warning"', () => {
|
|
36
|
-
const wrapper = render(/*#__PURE__*/_jsx(Availability, {
|
|
37
|
-
state: AVAILABILITY_STATE_ALERT,
|
|
38
|
-
text: "Out of stock"
|
|
39
|
-
}));
|
|
40
|
-
expect(wrapper.asFragment()).toMatchSnapshot();
|
|
41
|
-
});
|
|
42
|
-
});
|
package/Button/spec.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import trim from 'lodash/trim';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { shallow } from 'enzyme';
|
|
4
|
-
import Button from "./index";
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
describe('<Button />', () => {
|
|
7
|
-
it('should render as a regular button if type is omitted', () => {
|
|
8
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(Button, {
|
|
9
|
-
children: "Press me"
|
|
10
|
-
}));
|
|
11
|
-
expect(wrapper).toMatchSnapshot();
|
|
12
|
-
expect(wrapper.render().text()).toEqual('Press me');
|
|
13
|
-
});
|
|
14
|
-
it('should render as a regular button if type is explicitly defined', () => {
|
|
15
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(Button, {
|
|
16
|
-
type: "regular",
|
|
17
|
-
children: "Press me"
|
|
18
|
-
}));
|
|
19
|
-
expect(wrapper).toMatchSnapshot();
|
|
20
|
-
expect(trim(wrapper.prop('className'))).toMatch(/^ui-shared__button\s+/);
|
|
21
|
-
});
|
|
22
|
-
it('should render as a primary button', () => {
|
|
23
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(Button, {
|
|
24
|
-
type: "primary",
|
|
25
|
-
children: "Press me"
|
|
26
|
-
}));
|
|
27
|
-
expect(trim(wrapper.prop('className'))).toMatch(/^ui-shared__button\s+/);
|
|
28
|
-
expect(wrapper).toMatchSnapshot();
|
|
29
|
-
});
|
|
30
|
-
it('should render as a secondary button', () => {
|
|
31
|
-
const wrapper = shallow(/*#__PURE__*/_jsx(Button, {
|
|
32
|
-
type: "secondary",
|
|
33
|
-
children: "Press me"
|
|
34
|
-
}));
|
|
35
|
-
expect(trim(wrapper.prop('className'))).toMatch(/^ui-shared__button\s+/);
|
|
36
|
-
expect(wrapper).toMatchSnapshot();
|
|
37
|
-
});
|
|
38
|
-
});
|
package/ButtonLink/spec.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { fireEvent, render } from '@testing-library/react';
|
|
3
|
-
import { UnwrappedButtonLink as ButtonLink } from "./index";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
describe('<ButtonLink>', () => {
|
|
6
|
-
describe('On click action', () => {
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
jest.useFakeTimers();
|
|
9
|
-
});
|
|
10
|
-
afterEach(() => {
|
|
11
|
-
jest.runOnlyPendingTimers();
|
|
12
|
-
jest.useRealTimers();
|
|
13
|
-
});
|
|
14
|
-
it('should create component and open page on click', () => {
|
|
15
|
-
const mockedNavigate = jest.fn();
|
|
16
|
-
const link = 'https://example.com';
|
|
17
|
-
const component = render(/*#__PURE__*/_jsx(ButtonLink, {
|
|
18
|
-
href: link,
|
|
19
|
-
navigate: mockedNavigate,
|
|
20
|
-
children: "Text inside"
|
|
21
|
-
}));
|
|
22
|
-
expect(component.container.firstChild).toMatchSnapshot();
|
|
23
|
-
fireEvent.click(component.container.querySelector('button'));
|
|
24
|
-
jest.runOnlyPendingTimers();
|
|
25
|
-
expect(mockedNavigate).toHaveBeenCalledTimes(1);
|
|
26
|
-
expect(mockedNavigate).toHaveBeenCalledWith(link);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
});
|
package/Chip/spec.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
import Chip from '.';
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
describe('<Chip />', () => {
|
|
6
|
-
it('should render a tag', () => {
|
|
7
|
-
const wrapper = mount(/*#__PURE__*/_jsx(Chip, {
|
|
8
|
-
id: "some-id",
|
|
9
|
-
children: "text"
|
|
10
|
-
}));
|
|
11
|
-
expect(wrapper).toMatchSnapshot();
|
|
12
|
-
expect(wrapper.find('button').length).toEqual(2);
|
|
13
|
-
expect(wrapper.find('button').at(1).text()).toEqual('text');
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
describe('<Chip />', () => {
|
|
17
|
-
it('should render a without removable icon', () => {
|
|
18
|
-
const wrapper = mount(/*#__PURE__*/_jsx(Chip, {
|
|
19
|
-
id: "some-id",
|
|
20
|
-
removable: false,
|
|
21
|
-
children: "text"
|
|
22
|
-
}));
|
|
23
|
-
expect(wrapper).toMatchSnapshot();
|
|
24
|
-
expect(wrapper.find('button').length).toEqual(1);
|
|
25
|
-
expect(wrapper.find('button').at(0).text()).toEqual('text');
|
|
26
|
-
});
|
|
27
|
-
});
|