@pingux/astro 2.54.0-alpha.0 → 2.54.0-alpha.1
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.
@@ -39,7 +39,7 @@ var Breadcrumbs = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
39
39
|
var breadcrumbsRef = (0, _hooks.useLocalOrForwardRef)(ref);
|
40
40
|
(0, _hooks.usePropWarning)(props, 'disabled', 'isDisabled');
|
41
41
|
var createBreadcrumb = (0, _react.useCallback)(function (child, idx) {
|
42
|
-
var isCurrentItem =
|
42
|
+
var isCurrentItem = (0, _isArray["default"])(filteredChildren) && filteredChildren.length > 1 ? idx === _react["default"].Children.toArray(children).length - 1 : true;
|
43
43
|
return (0, _react2.jsx)(_react["default"].Fragment, {
|
44
44
|
key: "li-".concat(child.key)
|
45
45
|
}, (0, _react2.jsx)(_BreadcrumbItem["default"], (0, _extends2["default"])({
|
@@ -54,11 +54,10 @@ test('should render nodes from the children', function () {
|
|
54
54
|
test('should render correct amount of icons', function () {
|
55
55
|
getComponent({
|
56
56
|
iconProps: {
|
57
|
-
'data-testid': testIconId
|
58
|
-
icon: _ChevronRightIcon["default"]
|
57
|
+
'data-testid': testIconId
|
59
58
|
}
|
60
59
|
});
|
61
|
-
expect(_testWrapper.screen.getAllByTestId(testIconId).length).toBe(testItemsArr.length -
|
60
|
+
expect(_testWrapper.screen.getAllByTestId(testIconId).length).toBe(testItemsArr.length - 1);
|
62
61
|
});
|
63
62
|
test('breadcrumbItem should render breadcrumbItem as a Text component when appropriate elementType passed', function () {
|
64
63
|
getComponent({}, {
|
@@ -26,7 +26,7 @@ var Breadcrumbs = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
26
26
|
var breadcrumbsRef = useLocalOrForwardRef(ref);
|
27
27
|
usePropWarning(props, 'disabled', 'isDisabled');
|
28
28
|
var createBreadcrumb = useCallback(function (child, idx) {
|
29
|
-
var isCurrentItem =
|
29
|
+
var isCurrentItem = _Array$isArray(filteredChildren) && filteredChildren.length > 1 ? idx === React.Children.toArray(children).length - 1 : true;
|
30
30
|
return ___EmotionJSX(React.Fragment, {
|
31
31
|
key: "li-".concat(child.key)
|
32
32
|
}, ___EmotionJSX(BreadcrumbItem, _extends({
|
@@ -51,11 +51,10 @@ test('should render nodes from the children', function () {
|
|
51
51
|
test('should render correct amount of icons', function () {
|
52
52
|
getComponent({
|
53
53
|
iconProps: {
|
54
|
-
'data-testid': testIconId
|
55
|
-
icon: ChevronRightIcon
|
54
|
+
'data-testid': testIconId
|
56
55
|
}
|
57
56
|
});
|
58
|
-
expect(screen.getAllByTestId(testIconId).length).toBe(testItemsArr.length -
|
57
|
+
expect(screen.getAllByTestId(testIconId).length).toBe(testItemsArr.length - 1);
|
59
58
|
});
|
60
59
|
test('breadcrumbItem should render breadcrumbItem as a Text component when appropriate elementType passed', function () {
|
61
60
|
getComponent({}, {
|