@blaze-cms/react-page-builder 0.146.0-core-styles.42 → 0.146.0-node18.0
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/CHANGELOG.md +31 -197
- package/lib/HOC/recreateOnNavigation.js.map +1 -1
- package/lib/HOC/withTitle.js.map +1 -1
- package/lib/application/query/index.js +1 -0
- package/lib/application/query/index.js.map +1 -1
- package/lib/components/BackToTop/BackToTop.js.map +1 -1
- package/lib/components/Banner/AdSlotRender.js +1 -1
- package/lib/components/Banner/Banner.js +1 -1
- package/lib/components/Banner/BannerRender.js.map +1 -1
- package/lib/components/Breadcrumb/Breadcrumb.js +1 -1
- package/lib/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/components/Button.js.map +1 -1
- package/lib/components/Card/CardsContainer.js +1 -1
- package/lib/components/Card/CardsFactory.js.map +1 -1
- package/lib/components/Card/CardsRender.js.map +1 -1
- package/lib/components/Carousel/CarouselRender/CarouselRender.js +1 -0
- package/lib/components/Carousel/CarouselRender/CarouselRender.js.map +1 -1
- package/lib/components/CarouselWrapper/DefaultCarousel.js.map +1 -1
- package/lib/components/ContentGroup/ContentGroupTabs.js +1 -1
- package/lib/components/ContentGroup/ContentGroupTabs.js.map +1 -1
- package/lib/components/ContentGroup/helpers/get-sections-data.js +1 -0
- package/lib/components/ContentGroup/helpers/get-sections-data.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryRender.js +1 -0
- package/lib/components/DataSummary/DataSummaryRender.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummaryContent.js +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummaryContent.js +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummaryContent.js +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummaryContent.js +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/index.js.map +1 -1
- package/lib/components/DateTime/DateTime.js +4 -4
- package/lib/components/DateTime/DateTime.js.map +1 -1
- package/lib/components/EmailConfirm/EmailConfirm.js +3 -3
- package/lib/components/EmailConfirm/EmailConfirm.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/GlobalLightbox.js +2 -2
- package/lib/components/Image/GlobalLightbox/GlobalLightbox.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/index.js.map +1 -1
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Image/ImageFactory.js +1 -1
- package/lib/components/Image/ImageFactory.js.map +1 -1
- package/lib/components/ItemList/helpers/get-item-list-ids.js +1 -0
- package/lib/components/ItemList/helpers/get-item-list-ids.js.map +1 -1
- package/lib/components/ItemList/hooks/use-item-list-id.js.map +1 -1
- package/lib/components/Layout/LayoutFactory.js.map +1 -1
- package/lib/components/Layout/LayoutWithStickyTimer.js.map +1 -1
- package/lib/components/List/ListFactory.js.map +1 -1
- package/lib/components/List/ListRender.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRenderWrapper.js +1 -1
- package/lib/components/List/components/Full/FullRender.js +1 -1
- package/lib/components/List/components/Full/FullRenderItem.js +1 -1
- package/lib/components/List/components/Header/ListHeader.js +1 -0
- package/lib/components/List/components/Header/ListHeader.js.map +1 -1
- package/lib/components/List/components/Pagination/ListPagination.js.map +1 -1
- package/lib/components/List/components/Pagination/LoadMore.js +2 -2
- package/lib/components/List/components/Pagination/LoadMore.js.map +1 -1
- package/lib/components/List/helpers/build-query-booster.js +1 -1
- package/lib/components/List/helpers/sort-aggs.js.map +1 -1
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/MenuItem/MenuItemRender.js.map +1 -1
- package/lib/components/ModalAdapter/index.js.map +1 -1
- package/lib/components/SearchContent/SearchContent.js.map +1 -1
- package/lib/components/SearchContent/SearchContentItems.js +1 -0
- package/lib/components/SearchContent/SearchContentItems.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/FiltersList.js +1 -1
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js +1 -0
- package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-select-options.js +1 -0
- package/lib/components/SearchFilter/helpers/get-select-options.js.map +1 -1
- package/lib/components/SearchFilter/helpers/parse-filter-value.js +1 -0
- package/lib/components/SearchFilter/helpers/parse-filter-value.js.map +1 -1
- package/lib/components/SearchFilterSort/SearchFilterSort.js +1 -0
- package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
- package/lib/components/SocialFollow/SocialFollowRender.js +1 -0
- package/lib/components/SocialFollow/SocialFollowRender.js.map +1 -1
- package/lib/components/Video/providers/Vimeo/VimeoProvider.js.map +1 -1
- package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
- package/lib/components/Video/providers/get-provider.js.map +1 -1
- package/lib/components/Wrapper.js +2 -2
- package/lib/components/Wrapper.js.map +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/constants/index.js.map +1 -1
- package/lib/helpers/build-query-fields.js +1 -0
- package/lib/helpers/build-query-fields.js.map +1 -1
- package/lib/helpers/build-search-values-checkbox-select.js +1 -1
- package/lib/helpers/build-search-values-checkbox-select.js.map +1 -1
- package/lib/helpers/check-props-to-use.js +1 -0
- package/lib/helpers/check-props-to-use.js.map +1 -1
- package/lib/helpers/get-current-offset.js +4 -5
- package/lib/helpers/get-current-offset.js.map +1 -1
- package/lib/helpers/get-entities-with-banner.js +1 -1
- package/lib/helpers/get-wrapped-value-with-link.js +1 -0
- package/lib/helpers/get-wrapped-value-with-link.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js +1 -0
- package/lib/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js +1 -1
- package/lib/helpers/process-data-summary-value.js +1 -1
- package/lib/helpers/remove-unwanted-characters.js +1 -1
- package/lib/helpers/remove-unwanted-characters.js.map +1 -1
- package/lib/hooks/helpers/buildPBComponents.js.map +1 -1
- package/lib/hooks/helpers/get-components-to-insert-by-type.js.map +1 -1
- package/lib/hooks/helpers/get-lightbox-images.js +1 -1
- package/lib/hooks/helpers/inject-textblock-banners.js.map +1 -1
- package/lib/hooks/use-check-mobile-screen.js.map +1 -1
- package/lib/hooks/use-get-entity-schema.js.map +1 -1
- package/lib/hooks/use-get-image-id-from-relation.js.map +1 -1
- package/lib/hooks/use-page-builder.js +1 -1
- package/lib/hooks/use-page-builder.js.map +1 -1
- package/lib/utils/get-props-to-display-modifiers.js +1 -0
- package/lib/utils/get-props-to-display-modifiers.js.map +1 -1
- package/lib/variants/Infographic/index.js.map +1 -1
- package/lib/variants/LongformGallery/LongformGallery.js +1 -0
- package/lib/variants/LongformGallery/LongformGallery.js.map +1 -1
- package/lib/variants/LongformGallery/index.js.map +1 -1
- package/lib/variants/SlideSummary/index.js.map +1 -1
- package/lib/variants/ThumbnailCarousel/ThumbnailCarousel.js +1 -0
- package/lib/variants/ThumbnailCarousel/ThumbnailCarousel.js.map +1 -1
- package/lib/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js.map +1 -1
- package/lib/variants/ThumbnailCarousel/index.js.map +1 -1
- package/lib-es/HOC/recreateOnNavigation.js.map +1 -1
- package/lib-es/HOC/withTitle.js.map +1 -1
- package/lib-es/components/BackToTop/BackToTop.js.map +1 -1
- package/lib-es/components/Banner/BannerRender.js.map +1 -1
- package/lib-es/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/lib-es/components/Button.js.map +1 -1
- package/lib-es/components/Card/CardsFactory.js.map +1 -1
- package/lib-es/components/Card/CardsRender.js.map +1 -1
- package/lib-es/components/CarouselWrapper/DefaultCarousel.js.map +1 -1
- package/lib-es/components/ContentGroup/ContentGroupTabs.js.map +1 -1
- package/lib-es/components/DataSummary/DataSummaryTypes/index.js.map +1 -1
- package/lib-es/components/DateTime/DateTime.js +4 -4
- package/lib-es/components/DateTime/DateTime.js.map +1 -1
- package/lib-es/components/EmailConfirm/EmailConfirm.js +4 -4
- package/lib-es/components/EmailConfirm/EmailConfirm.js.map +1 -1
- package/lib-es/components/Image/GlobalLightbox/GlobalLightbox.js +3 -3
- package/lib-es/components/Image/GlobalLightbox/GlobalLightbox.js.map +1 -1
- package/lib-es/components/Image/GlobalLightbox/index.js.map +1 -1
- package/lib-es/components/Image/Image.js.map +1 -1
- package/lib-es/components/Image/ImageFactory.js.map +1 -1
- package/lib-es/components/ItemList/hooks/use-item-list-id.js.map +1 -1
- package/lib-es/components/Layout/LayoutFactory.js.map +1 -1
- package/lib-es/components/Layout/LayoutWithStickyTimer.js.map +1 -1
- package/lib-es/components/List/ListFactory.js.map +1 -1
- package/lib-es/components/List/ListRender.js.map +1 -1
- package/lib-es/components/List/components/Pagination/ListPagination.js.map +1 -1
- package/lib-es/components/List/components/Pagination/LoadMore.js +2 -2
- package/lib-es/components/List/components/Pagination/LoadMore.js.map +1 -1
- package/lib-es/components/List/helpers/sort-aggs.js.map +1 -1
- package/lib-es/components/Menu/Menu.js.map +1 -1
- package/lib-es/components/MenuItem/MenuItemRender.js.map +1 -1
- package/lib-es/components/ModalAdapter/index.js.map +1 -1
- package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/Video/providers/Vimeo/VimeoProvider.js.map +1 -1
- package/lib-es/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
- package/lib-es/components/Video/providers/get-provider.js.map +1 -1
- package/lib-es/components/Wrapper.js +2 -2
- package/lib-es/components/Wrapper.js.map +1 -1
- package/lib-es/components/index.js.map +1 -1
- package/lib-es/constants/index.js.map +1 -1
- package/lib-es/helpers/build-search-values-checkbox-select.js +1 -1
- package/lib-es/helpers/build-search-values-checkbox-select.js.map +1 -1
- package/lib-es/helpers/get-current-offset.js +1 -1
- package/lib-es/helpers/get-current-offset.js.map +1 -1
- package/lib-es/helpers/get-wrapped-value-with-link.js.map +1 -1
- package/lib-es/helpers/remove-unwanted-characters.js.map +1 -1
- package/lib-es/hooks/helpers/buildPBComponents.js.map +1 -1
- package/lib-es/hooks/helpers/get-components-to-insert-by-type.js.map +1 -1
- package/lib-es/hooks/helpers/inject-textblock-banners.js.map +1 -1
- package/lib-es/hooks/use-check-mobile-screen.js.map +1 -1
- package/lib-es/hooks/use-get-entity-schema.js.map +1 -1
- package/lib-es/hooks/use-get-image-id-from-relation.js.map +1 -1
- package/lib-es/hooks/use-page-builder.js +1 -1
- package/lib-es/hooks/use-page-builder.js.map +1 -1
- package/lib-es/variants/Infographic/index.js.map +1 -1
- package/lib-es/variants/LongformGallery/LongformGallery.js.map +1 -1
- package/lib-es/variants/LongformGallery/index.js.map +1 -1
- package/lib-es/variants/SlideSummary/index.js.map +1 -1
- package/lib-es/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js.map +1 -1
- package/lib-es/variants/ThumbnailCarousel/index.js.map +1 -1
- package/package.json +20 -19
- package/src/HOC/recreateOnNavigation.js +3 -3
- package/src/HOC/withTitle.js +3 -3
- package/src/components/BackToTop/BackToTop.js +5 -8
- package/src/components/Banner/BannerRender.js +0 -2
- package/src/components/Breadcrumb/Breadcrumb.js +5 -1
- package/src/components/Button.js +3 -6
- package/src/components/Card/CardsFactory.js +8 -7
- package/src/components/Card/CardsRender.js +5 -3
- package/src/components/CarouselWrapper/DefaultCarousel.js +20 -26
- package/src/components/ContentGroup/ContentGroupTabs.js +4 -7
- package/src/components/DataSummary/DataSummaryTypes/index.js +14 -10
- package/src/components/DateTime/DateTime.js +4 -4
- package/src/components/EmailConfirm/EmailConfirm.js +9 -11
- package/src/components/Image/GlobalLightbox/GlobalLightbox.js +7 -9
- package/src/components/Image/GlobalLightbox/index.js +2 -2
- package/src/components/Image/Image.js +6 -4
- package/src/components/Image/ImageFactory.js +5 -5
- package/src/components/ItemList/hooks/use-item-list-id.js +10 -13
- package/src/components/Layout/LayoutFactory.js +2 -2
- package/src/components/Layout/LayoutWithStickyTimer.js +11 -14
- package/src/components/List/ListFactory.js +10 -11
- package/src/components/List/ListRender.js +6 -1
- package/src/components/List/components/Pagination/ListPagination.js +3 -6
- package/src/components/List/components/Pagination/LoadMore.js +7 -9
- package/src/components/List/helpers/sort-aggs.js +1 -2
- package/src/components/Menu/Menu.js +12 -16
- package/src/components/MenuItem/MenuItemRender.js +3 -6
- package/src/components/ModalAdapter/index.js +2 -2
- package/src/components/SearchContent/SearchContent.js +26 -32
- package/src/components/SearchFilter/SearchFilter/SearchFilter.js +15 -19
- package/src/components/Video/providers/Vimeo/VimeoProvider.js +19 -22
- package/src/components/Video/providers/YouTube/YoutubeEmbeded.js +58 -64
- package/src/components/Video/providers/get-provider.js +4 -4
- package/src/components/Wrapper.js +5 -7
- package/src/components/index.js +20 -20
- package/src/constants/index.js +2 -1
- package/src/helpers/build-search-values-checkbox-select.js +1 -1
- package/src/helpers/get-current-offset.js +1 -1
- package/src/helpers/get-wrapped-value-with-link.js +1 -1
- package/src/helpers/remove-unwanted-characters.js +1 -4
- package/src/hooks/helpers/buildPBComponents.js +2 -4
- package/src/hooks/helpers/get-components-to-insert-by-type.js +3 -1
- package/src/hooks/helpers/inject-textblock-banners.js +2 -8
- package/src/hooks/use-check-mobile-screen.js +5 -8
- package/src/hooks/use-get-entity-schema.js +5 -1
- package/src/hooks/use-get-image-id-from-relation.js +5 -1
- package/src/hooks/use-page-builder.js +9 -12
- package/src/variants/Infographic/index.js +2 -2
- package/src/variants/LongformGallery/LongformGallery.js +2 -8
- package/src/variants/LongformGallery/index.js +2 -2
- package/src/variants/SlideSummary/index.js +2 -2
- package/src/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js +2 -3
- package/src/variants/ThumbnailCarousel/index.js +2 -2
- package/tests/unit/src/HOC/withTitle.test.js +11 -21
- package/tests/unit/src/Layout/Layout.test.js +2 -1
- package/tests/unit/src/Layout/helpers/check-if-row-has-columns.test.js +1 -0
- package/tests/unit/src/components/Banner/AdSlotRender.test.js +4 -1
- package/tests/unit/src/components/Banner/helpers.test.js +34 -7
- package/tests/unit/src/components/BlazeLink.test.js +1 -4
- package/tests/unit/src/components/Breadcrumb/__snapshots__/Breadcrumb.test.js.snap +18 -0
- package/tests/unit/src/components/Card/Card.test.js +17 -4
- package/tests/unit/src/components/Card/CardContainer.test.js +7 -1
- package/tests/unit/src/components/Card/__snapshots__/Card.test.js.snap +15 -0
- package/tests/unit/src/components/Card/__snapshots__/CardContainer.test.js.snap +12 -0
- package/tests/unit/src/components/Card/mockData.js +2 -4
- package/tests/unit/src/components/Carousel/CarouselRender/CarouselRender.test.js +47 -46
- package/tests/unit/src/components/Carousel/CarouselRender/__snapshots__/CarouselRender.test.js.snap +45 -1
- package/tests/unit/src/components/Carousel/CarouselRender/mocks.js +0 -0
- package/tests/unit/src/components/Carousel/__snapshots__/Carousel.test.js.snap +1 -1
- package/tests/unit/src/components/ContentGroup/ContentGroupTabs.test.js +4 -1
- package/tests/unit/src/components/ContentGroup/helpers/get-sections-data.test.js +4 -1
- package/tests/unit/src/components/DataSummary/__snapshots__/DataSummaryRender.test.js.snap +0 -1
- package/tests/unit/src/components/DataSummary/helpers/build-props-to-display-with-content.test.js +5 -1
- package/tests/unit/src/components/DataSummary/helpers/get-value-from-array.test.js +4 -1
- package/tests/unit/src/components/DataSummary/helpers/strip-summary-props-content.test.js +8 -2
- package/tests/unit/src/components/DataSummary/mockData.js +4 -1
- package/tests/unit/src/components/Image/ImageFactory.test.js +4 -3
- package/tests/unit/src/components/ItemList/ItemListCounter.test.js +2 -1
- package/tests/unit/src/components/ItemList/hooks/use-item-list-id.test.js +1 -1
- package/tests/unit/src/components/Layout/LayoutFactory.test.js +0 -4
- package/tests/unit/src/components/List/components/Cards/CardsRender.test.js +8 -1
- package/tests/unit/src/components/List/components/Pagination/Classic.test.js +1 -1
- package/tests/unit/src/components/PlaceholderIcon/index.test.js +2 -2
- package/tests/unit/src/components/SearchFilter/components/Range.test.js +5 -5
- package/tests/unit/src/components/SearchFilter/components/__snapshots__/Range.test.js.snap +175 -190
- package/tests/unit/src/components/SearchFilter/helpers/get-select-options.test.js +8 -2
- package/tests/unit/src/components/TextBlock/TextBlock.test.js +1 -1
- package/tests/unit/src/components/TextBlock/__snapshots__/TextBlock.test.js.snap +12 -0
- package/tests/unit/src/helpers/__snapshots__/parse-textBlock.test.js.snap +3 -0
- package/tests/unit/src/helpers/build-checkbox-filters.test.js +4 -1
- package/tests/unit/src/helpers/get-dictionary-match.test.js +1 -1
- package/tests/unit/src/helpers/parse-textBlock.test.js +3 -1
- package/tests/unit/src/hooks/use-check-mobile-screen.test.js +3 -2
- package/tests/unit/src/hooks/use-get-image-id-from-relation.test.js +3 -3
- package/tests/unit/src/hooks/use-get-images.test.js +16 -14
- package/tests/unit/src/hooks/use-get-single-entity-schema.test.js +6 -4
- package/tests/unit/src/hooks/use-page-builder.test.js +0 -48
|
@@ -4,8 +4,8 @@ const ThumbnailCarousel = {
|
|
|
4
4
|
getSettings: componentSettings => ({
|
|
5
5
|
...componentSettings
|
|
6
6
|
}),
|
|
7
|
-
VariantComponent: dynamic(
|
|
8
|
-
import(/* webpackChunkName: "blazePbVariantThumbnailCarousel" */ './ThumbnailCarousel')
|
|
7
|
+
VariantComponent: dynamic(
|
|
8
|
+
() => import(/* webpackChunkName: "blazePbVariantThumbnailCarousel" */ './ThumbnailCarousel')
|
|
9
9
|
)
|
|
10
10
|
};
|
|
11
11
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import '@testing-library/jest-dom/extend-expect';
|
|
6
|
-
import {
|
|
6
|
+
import { render } from '@testing-library/react';
|
|
7
7
|
import { withTitle } from '../../../../src/HOC';
|
|
8
8
|
|
|
9
9
|
jest.mock('@blaze-cms/utils-handlebars', () => ({
|
|
@@ -15,36 +15,26 @@ const MockComponent = () => <div>MockedComponent</div>;
|
|
|
15
15
|
describe('withTitle HOC', () => {
|
|
16
16
|
it('should return h2 based on elementTitle prop', () => {
|
|
17
17
|
const WrappedComponent = withTitle(MockComponent);
|
|
18
|
-
const shallowWrapper = shallow(<WrappedComponent />);
|
|
19
|
-
const children = shallowWrapper.prop('children');
|
|
20
|
-
|
|
21
|
-
expect(children.length).toBe(2);
|
|
22
|
-
|
|
23
|
-
const [firstChild, secondChild] = children;
|
|
24
|
-
|
|
25
|
-
expect(firstChild).toBe('');
|
|
26
|
-
expect(secondChild.type).toBe(MockComponent);
|
|
27
|
-
|
|
28
18
|
const titleProp = 'test title';
|
|
29
|
-
const
|
|
30
|
-
const [, secondChildWithTitle] = wrapperWithTitle.prop('children');
|
|
19
|
+
const { getByText } = render(<WrappedComponent elementTitle={titleProp} />);
|
|
31
20
|
|
|
32
|
-
expect(
|
|
33
|
-
expect(
|
|
21
|
+
expect(getByText('test title')).toBeInTheDocument();
|
|
22
|
+
expect(getByText('MockedComponent')).toBeInTheDocument();
|
|
34
23
|
});
|
|
35
24
|
|
|
36
25
|
it('should not display h2 if elementTitle is empty', () => {
|
|
37
26
|
const WrappedComponent = withTitle(MockComponent);
|
|
38
27
|
const blankTitle = '';
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
expect(
|
|
28
|
+
const { container } = render(<WrappedComponent elementTitle={blankTitle} />);
|
|
29
|
+
const header = container.querySelector('h2');
|
|
30
|
+
expect(header).toEqual(null);
|
|
42
31
|
});
|
|
32
|
+
|
|
43
33
|
it('should not display title if isHeroImg prop is true', () => {
|
|
44
34
|
const WrappedComponent = withTitle(MockComponent);
|
|
45
35
|
const blankTitle = '';
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
expect(
|
|
36
|
+
const { container } = render(<WrappedComponent elementTitle={blankTitle} isHeroImg />);
|
|
37
|
+
const header = container.querySelector('h2');
|
|
38
|
+
expect(header).toEqual(null);
|
|
49
39
|
});
|
|
50
40
|
});
|
|
@@ -8,6 +8,7 @@ import { ROW, COLUMN } from '../../../../../src/components/Layout/constants';
|
|
|
8
8
|
|
|
9
9
|
describe('checkIfRowHasColumns function', () => {
|
|
10
10
|
const REACT_CHILDREN_WITH_COLUMN = [false, [<image id="1" component={{ type: 'column' }} />]];
|
|
11
|
+
|
|
11
12
|
const ELEMENT_WITH_COLUMN = <element>{REACT_CHILDREN_WITH_COLUMN}</element>;
|
|
12
13
|
const rowWithColumnChildren = checkIfRowHasColumns(ROW, ELEMENT_WITH_COLUMN);
|
|
13
14
|
|
|
@@ -116,15 +116,24 @@ describe('buildBannerSizes helper', () => {
|
|
|
116
116
|
it('should return an array of sizes based on given sizeId', () => {
|
|
117
117
|
const parsedSizes = buildBannerSizes(
|
|
118
118
|
'sizeId',
|
|
119
|
-
[
|
|
119
|
+
[
|
|
120
|
+
{ width: 300, height: 250 },
|
|
121
|
+
{ width: 50, height: 50 }
|
|
122
|
+
],
|
|
120
123
|
undefined
|
|
121
124
|
);
|
|
122
|
-
expect(parsedSizes).toEqual([
|
|
125
|
+
expect(parsedSizes).toEqual([
|
|
126
|
+
[300, 250],
|
|
127
|
+
[50, 50]
|
|
128
|
+
]);
|
|
123
129
|
});
|
|
124
130
|
|
|
125
131
|
it('should return an array of sizes based on given sizes string', () => {
|
|
126
132
|
const parsedSizes = buildBannerSizes(undefined, {}, '320x180,1x1');
|
|
127
|
-
expect(parsedSizes).toEqual([
|
|
133
|
+
expect(parsedSizes).toEqual([
|
|
134
|
+
[320, 180],
|
|
135
|
+
[1, 1]
|
|
136
|
+
]);
|
|
128
137
|
});
|
|
129
138
|
});
|
|
130
139
|
|
|
@@ -203,18 +212,36 @@ describe('buildSizeMapping helper', () => {
|
|
|
203
212
|
{
|
|
204
213
|
width: 300,
|
|
205
214
|
height: 250,
|
|
206
|
-
viewports: [
|
|
215
|
+
viewports: [
|
|
216
|
+
{ width: 1024, height: 768 },
|
|
217
|
+
{ width: 900, height: 768 }
|
|
218
|
+
]
|
|
207
219
|
},
|
|
208
220
|
{ width: 210, height: 60, viewports: [{ width: 900, height: 768 }] }
|
|
209
221
|
]);
|
|
210
222
|
expect(sizeMappingEmpty).toEqual([
|
|
211
|
-
{
|
|
212
|
-
|
|
223
|
+
{
|
|
224
|
+
viewport: [1024, 768],
|
|
225
|
+
sizes: [
|
|
226
|
+
[728, 90],
|
|
227
|
+
[300, 250]
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
viewport: [900, 768],
|
|
232
|
+
sizes: [
|
|
233
|
+
[300, 250],
|
|
234
|
+
[210, 60]
|
|
235
|
+
]
|
|
236
|
+
}
|
|
213
237
|
]);
|
|
214
238
|
});
|
|
215
239
|
|
|
216
240
|
it('should return empty size if a size dimension is falsey', () => {
|
|
217
|
-
const viewports = [
|
|
241
|
+
const viewports = [
|
|
242
|
+
{ width: 1024, height: 768 },
|
|
243
|
+
{ width: 768, height: null }
|
|
244
|
+
];
|
|
218
245
|
const otherViewports = [{ width: 600, height: null }];
|
|
219
246
|
const expectedSizes = [[300, 250]];
|
|
220
247
|
const sizeMappingEmpty = buildSizeMapping('id', [
|
|
@@ -6,7 +6,7 @@ import { render, waitFor, act } from '@testing-library/react';
|
|
|
6
6
|
import '@testing-library/jest-dom/extend-expect';
|
|
7
7
|
import { MainContext } from '@blaze-cms/nextjs-components';
|
|
8
8
|
import BlazeLink from '../../../../src/components/BlazeLink';
|
|
9
|
-
|
|
9
|
+
// TODO fix breaking test
|
|
10
10
|
const mockedProps = {
|
|
11
11
|
children: <div>child div</div>,
|
|
12
12
|
href: '/test-href',
|
|
@@ -41,13 +41,10 @@ describe('BlazeLink component', () => {
|
|
|
41
41
|
await waitFor(() => {
|
|
42
42
|
expect(asFragment()).toMatchSnapshot();
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
await act(() => promise);
|
|
46
44
|
});
|
|
47
45
|
|
|
48
46
|
it('should use default props value when hasGTM is set to false', async () => {
|
|
49
47
|
const promise = Promise.resolve();
|
|
50
|
-
|
|
51
48
|
const { getByRole } = await renderWithContext();
|
|
52
49
|
|
|
53
50
|
await waitFor(() => {
|
|
@@ -14,6 +14,9 @@ exports[`Breadcrumb component should match snapshot 1`] = `
|
|
|
14
14
|
<a
|
|
15
15
|
aria-label="Home"
|
|
16
16
|
href="/"
|
|
17
|
+
/>
|
|
18
|
+
<a
|
|
19
|
+
href="/"
|
|
17
20
|
>
|
|
18
21
|
Home
|
|
19
22
|
</a>
|
|
@@ -21,6 +24,9 @@ exports[`Breadcrumb component should match snapshot 1`] = `
|
|
|
21
24
|
<li
|
|
22
25
|
class="breadcrumb__item"
|
|
23
26
|
>
|
|
27
|
+
<a
|
|
28
|
+
href="/Resolver"
|
|
29
|
+
/>
|
|
24
30
|
<a />
|
|
25
31
|
</li>
|
|
26
32
|
</ul>
|
|
@@ -42,6 +48,9 @@ exports[`Breadcrumb component should not render if loading, err or no data exist
|
|
|
42
48
|
<a
|
|
43
49
|
aria-label="Home"
|
|
44
50
|
href="/"
|
|
51
|
+
/>
|
|
52
|
+
<a
|
|
53
|
+
href="/"
|
|
45
54
|
>
|
|
46
55
|
Home
|
|
47
56
|
</a>
|
|
@@ -49,6 +58,9 @@ exports[`Breadcrumb component should not render if loading, err or no data exist
|
|
|
49
58
|
<li
|
|
50
59
|
class="breadcrumb__item"
|
|
51
60
|
>
|
|
61
|
+
<a
|
|
62
|
+
href="/Resolver"
|
|
63
|
+
/>
|
|
52
64
|
<a />
|
|
53
65
|
</li>
|
|
54
66
|
</ul>
|
|
@@ -70,6 +82,9 @@ exports[`Breadcrumb component should render 1`] = `
|
|
|
70
82
|
<a
|
|
71
83
|
aria-label="Home"
|
|
72
84
|
href="/"
|
|
85
|
+
/>
|
|
86
|
+
<a
|
|
87
|
+
href="/"
|
|
73
88
|
>
|
|
74
89
|
Home
|
|
75
90
|
</a>
|
|
@@ -77,6 +92,9 @@ exports[`Breadcrumb component should render 1`] = `
|
|
|
77
92
|
<li
|
|
78
93
|
class="breadcrumb__item"
|
|
79
94
|
>
|
|
95
|
+
<a
|
|
96
|
+
href="/Resolver"
|
|
97
|
+
/>
|
|
80
98
|
<a />
|
|
81
99
|
</li>
|
|
82
100
|
</ul>
|
|
@@ -4,10 +4,16 @@
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { render as _render, act, waitFor, screen } from '@testing-library/react';
|
|
6
6
|
import '@testing-library/jest-dom/extend-expect';
|
|
7
|
+
import { useRouter } from 'next/router';
|
|
7
8
|
import { setEnvs, deleteEnvs } from '@blaze-cms/tools/test-helpers/test-files/test-env';
|
|
8
9
|
import Card from '../../../../../src/components/Card/Card';
|
|
9
10
|
import { pageBuilderComponentsMocks } from './mockData';
|
|
10
11
|
|
|
12
|
+
jest.mock('react', () => ({
|
|
13
|
+
...jest.requireActual('react'),
|
|
14
|
+
useContext: () => ({ itemId: 'contextItemId', isPreview: false })
|
|
15
|
+
}));
|
|
16
|
+
|
|
11
17
|
const render = async (Component, props) => {
|
|
12
18
|
let renderResults;
|
|
13
19
|
|
|
@@ -27,7 +33,9 @@ const propsToDisplay = [
|
|
|
27
33
|
htmlAttribute: 'data-testid'
|
|
28
34
|
}
|
|
29
35
|
];
|
|
30
|
-
const getMockedParsedProp = children =>
|
|
36
|
+
const getMockedParsedProp = children => {
|
|
37
|
+
children;
|
|
38
|
+
};
|
|
31
39
|
const firstPropValue = 'some description';
|
|
32
40
|
const secondPropValue = 'extra props';
|
|
33
41
|
const firstPropToDisplay = getMockedParsedProp(['', '', firstPropValue, '', '']);
|
|
@@ -66,11 +74,16 @@ const preHeaderName = 'Pre header';
|
|
|
66
74
|
const alternativeHeadline = 'Alternative headline';
|
|
67
75
|
|
|
68
76
|
// eslint-disable-next-line react/prop-types
|
|
69
|
-
jest.mock(
|
|
70
|
-
|
|
71
|
-
)
|
|
77
|
+
jest.mock(
|
|
78
|
+
'../../../../../src/components/LazyImage',
|
|
79
|
+
() =>
|
|
80
|
+
function ({ src, alt }) {
|
|
81
|
+
return <img src={src} alt={alt} />;
|
|
82
|
+
}
|
|
83
|
+
);
|
|
72
84
|
|
|
73
85
|
describe('Card component', () => {
|
|
86
|
+
const router = useRouter();
|
|
74
87
|
it('should render without throwing an error and match snapshot', async () => {
|
|
75
88
|
const { asFragment, getByTestId } = await render(Card, componentProps);
|
|
76
89
|
expect(getByTestId(encodeURIComponent(firstPropValue))).toBeDefined();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { render, act, waitFor } from '@testing-library/react';
|
|
6
|
-
|
|
6
|
+
import { useRouter } from 'next/router';
|
|
7
7
|
import '@testing-library/jest-dom/extend-expect';
|
|
8
8
|
import CardsContainer from '../../../../../src/components/Card/CardsContainer';
|
|
9
9
|
import { cardDataMockedOptions } from './mockData';
|
|
@@ -12,6 +12,11 @@ jest.mock('@blaze-cms/utils-handlebars', () => ({
|
|
|
12
12
|
useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
|
+
jest.mock('react', () => ({
|
|
16
|
+
...jest.requireActual('react'),
|
|
17
|
+
useContext: () => ({ itemId: 'contextItemId', isPreview: false })
|
|
18
|
+
}));
|
|
19
|
+
|
|
15
20
|
// eslint-disable-next-line react/prop-types
|
|
16
21
|
jest.mock('../../../../../src/components/LazyImage', () => () => null);
|
|
17
22
|
|
|
@@ -30,6 +35,7 @@ const renderComponent = async props => {
|
|
|
30
35
|
};
|
|
31
36
|
|
|
32
37
|
describe('CardsContainer component', () => {
|
|
38
|
+
useRouter();
|
|
33
39
|
it('should render without throwing error and match snapshot', async () => {
|
|
34
40
|
const { asFragment } = await renderComponent({
|
|
35
41
|
...cardDataMockedOptions,
|
|
@@ -38,6 +38,9 @@ exports[`Card component should not render alternative headline if alternativePre
|
|
|
38
38
|
<a
|
|
39
39
|
aria-label="mock name"
|
|
40
40
|
href="/mockurl"
|
|
41
|
+
/>
|
|
42
|
+
<a
|
|
43
|
+
href="/mockurl"
|
|
41
44
|
>
|
|
42
45
|
mock name
|
|
43
46
|
</a>
|
|
@@ -109,6 +112,9 @@ exports[`Card component should not render alternative headline if displayCategor
|
|
|
109
112
|
<a
|
|
110
113
|
aria-label="mock name"
|
|
111
114
|
href="/mockurl"
|
|
115
|
+
/>
|
|
116
|
+
<a
|
|
117
|
+
href="/mockurl"
|
|
112
118
|
>
|
|
113
119
|
mock name
|
|
114
120
|
</a>
|
|
@@ -187,6 +193,9 @@ exports[`Card component should not render preHeader if alternativeHeadline is no
|
|
|
187
193
|
<a
|
|
188
194
|
aria-label="mock name"
|
|
189
195
|
href="/mockurl"
|
|
196
|
+
/>
|
|
197
|
+
<a
|
|
198
|
+
href="/mockurl"
|
|
190
199
|
>
|
|
191
200
|
mock name
|
|
192
201
|
</a>
|
|
@@ -263,6 +272,9 @@ exports[`Card component should render customPreheader and alternativeHeadline in
|
|
|
263
272
|
<a
|
|
264
273
|
aria-label="Alternative headline"
|
|
265
274
|
href="/mockurl"
|
|
275
|
+
/>
|
|
276
|
+
<a
|
|
277
|
+
href="/mockurl"
|
|
266
278
|
>
|
|
267
279
|
Alternative headline
|
|
268
280
|
</a>
|
|
@@ -424,6 +436,9 @@ exports[`Card component should render without throwing an error and match snapsh
|
|
|
424
436
|
<a
|
|
425
437
|
aria-label="mock name"
|
|
426
438
|
href="/mockurl"
|
|
439
|
+
/>
|
|
440
|
+
<a
|
|
441
|
+
href="/mockurl"
|
|
427
442
|
>
|
|
428
443
|
mock name
|
|
429
444
|
</a>
|
|
@@ -43,6 +43,9 @@ exports[`CardsContainer component should render with carousel if option is enabl
|
|
|
43
43
|
<a
|
|
44
44
|
aria-label="Swan 78"
|
|
45
45
|
href="/nautors-swan/swan-78"
|
|
46
|
+
/>
|
|
47
|
+
<a
|
|
48
|
+
href="/nautors-swan/swan-78"
|
|
46
49
|
>
|
|
47
50
|
Swan 78
|
|
48
51
|
</a>
|
|
@@ -82,6 +85,9 @@ exports[`CardsContainer component should render with carousel if option is enabl
|
|
|
82
85
|
<a
|
|
83
86
|
aria-label="Swan 98"
|
|
84
87
|
href="/nautors-swan/swan-98"
|
|
88
|
+
/>
|
|
89
|
+
<a
|
|
90
|
+
href="/nautors-swan/swan-98"
|
|
85
91
|
>
|
|
86
92
|
Swan 98
|
|
87
93
|
</a>
|
|
@@ -135,6 +141,9 @@ exports[`CardsContainer component should render without throwing error and match
|
|
|
135
141
|
<a
|
|
136
142
|
aria-label="Swan 78"
|
|
137
143
|
href="/nautors-swan/swan-78"
|
|
144
|
+
/>
|
|
145
|
+
<a
|
|
146
|
+
href="/nautors-swan/swan-78"
|
|
138
147
|
>
|
|
139
148
|
Swan 78
|
|
140
149
|
</a>
|
|
@@ -174,6 +183,9 @@ exports[`CardsContainer component should render without throwing error and match
|
|
|
174
183
|
<a
|
|
175
184
|
aria-label="Swan 98"
|
|
176
185
|
href="/nautors-swan/swan-98"
|
|
186
|
+
/>
|
|
187
|
+
<a
|
|
188
|
+
href="/nautors-swan/swan-98"
|
|
177
189
|
>
|
|
178
190
|
Swan 98
|
|
179
191
|
</a>
|
|
@@ -4,8 +4,7 @@ const cardDataMockedOptions = {
|
|
|
4
4
|
name: 'Swan 78',
|
|
5
5
|
url: '/nautors-swan/swan-78',
|
|
6
6
|
image: {
|
|
7
|
-
url:
|
|
8
|
-
'https://cdn-events.boatinternational.com/files/2020/04/2506afd0-879a-11ea-aab3-6d01477a82d7-180807_esk_0267.jpg',
|
|
7
|
+
url: 'https://cdn-events.boatinternational.com/files/2020/04/2506afd0-879a-11ea-aab3-6d01477a82d7-180807_esk_0267.jpg',
|
|
9
8
|
data: {
|
|
10
9
|
altText: 'Swan 78 | Exterior',
|
|
11
10
|
caption: ''
|
|
@@ -25,8 +24,7 @@ const cardDataMockedOptions = {
|
|
|
25
24
|
url: '/nautors-swan/swan-98',
|
|
26
25
|
arrowSize: 14,
|
|
27
26
|
image: {
|
|
28
|
-
url:
|
|
29
|
-
'https://cdn-events.boatinternational.com/files/2020/04/2f8c4030-879c-11ea-aab3-6d01477a82d7-Swan 98 - 1.jpg',
|
|
27
|
+
url: 'https://cdn-events.boatinternational.com/files/2020/04/2f8c4030-879c-11ea-aab3-6d01477a82d7-Swan 98 - 1.jpg',
|
|
30
28
|
data: {
|
|
31
29
|
altText: 'Swan 98 | Exterior',
|
|
32
30
|
caption: ''
|
|
@@ -3,71 +3,72 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import '@testing-library/jest-dom/extend-expect';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
6
|
+
import { useRouter } from 'next/router';
|
|
7
|
+
import { render, waitFor } from '@testing-library/react';
|
|
8
|
+
import { MockedRoot } from '@blaze-cms/tools/test-helpers/test-functions';
|
|
9
|
+
import { MOCK_BASIC, MOCK_RELATION } from '../../Image/mocks';
|
|
8
10
|
import CarouselRender from '../../../../../../src/components/Carousel/CarouselRender';
|
|
9
|
-
|
|
11
|
+
// TODO fix test breaking
|
|
10
12
|
jest.mock('@blaze-cms/utils-handlebars', () => ({
|
|
11
|
-
useStringTemplate: jest.fn((
|
|
13
|
+
useStringTemplate: jest.fn((_, [title]) => ({ loadig: false, data: [title] }))
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
jest.mock('react', () => ({
|
|
17
|
+
...jest.requireActual('react'),
|
|
18
|
+
useContext: () => ({ isPreview: false })
|
|
12
19
|
}));
|
|
13
20
|
|
|
14
|
-
const
|
|
21
|
+
const getMockedProps = overrides => ({
|
|
15
22
|
imageIds: ['test-id', 'test-altText', 'test-caption'],
|
|
16
23
|
displayCount: true,
|
|
17
24
|
enableLightbox: true,
|
|
18
25
|
toggleModal: jest.fn(),
|
|
19
26
|
handleSelectedImage: jest.fn(),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
direction: {
|
|
23
|
-
next: true,
|
|
24
|
-
back: false
|
|
25
|
-
},
|
|
26
|
-
handleNavigation: jest.fn()
|
|
27
|
-
};
|
|
27
|
+
...overrides
|
|
28
|
+
});
|
|
28
29
|
|
|
29
30
|
describe('CarouselRender component', () => {
|
|
30
|
-
|
|
31
|
+
const router = useRouter();
|
|
32
|
+
const mockedProps = getMockedProps();
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
34
|
+
it('should render one image button if there is one image to display', async () => {
|
|
35
|
+
const overrides = { imageIds: ['test1'] };
|
|
36
|
+
const { getByText } = render(
|
|
37
|
+
<MockedRoot mocks={MOCK_BASIC}>
|
|
38
|
+
<CarouselRender {...mockedProps} {...overrides} />
|
|
39
|
+
</MockedRoot>
|
|
40
|
+
);
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
await waitFor(() => {
|
|
43
|
+
expect(getByText('1 image')).toBeInTheDocument();
|
|
44
|
+
});
|
|
44
45
|
});
|
|
45
46
|
|
|
46
|
-
it('should render
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
it('should render n images button if there is more than one image to display', async () => {
|
|
48
|
+
const overrides = { imageIds: ['test-id', 'test-id-2'] };
|
|
49
|
+
const { getByText } = render(
|
|
50
|
+
<MockedRoot mocks={MOCK_RELATION}>
|
|
51
|
+
<CarouselRender {...mockedProps} {...overrides} />
|
|
52
|
+
</MockedRoot>
|
|
53
|
+
);
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
await waitFor(() => {
|
|
56
|
+
expect(getByText('2 images')).toBeInTheDocument();
|
|
57
|
+
});
|
|
52
58
|
});
|
|
53
59
|
|
|
54
|
-
it('should not render number count if display count is disabled', () => {
|
|
55
|
-
const overrides = {
|
|
56
|
-
const
|
|
57
|
-
<
|
|
60
|
+
it('should not render number count if display count is disabled', async () => {
|
|
61
|
+
const overrides = { displayCount: false };
|
|
62
|
+
const { asFragment, container } = render(
|
|
63
|
+
<MockedRoot mocks={MOCK_BASIC}>
|
|
64
|
+
<CarouselRender {...mockedProps} {...overrides} />
|
|
65
|
+
</MockedRoot>
|
|
58
66
|
);
|
|
59
|
-
expect(wrapperCountDisabled.find('p').length).toEqual(0);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('should not display number count after clicking previous image', () => {
|
|
63
|
-
const wrapperPrevClick = shallow(<CarouselRender.WrappedComponent {...mockedProps} />);
|
|
64
|
-
wrapperPrevClick.find('div.carousel__button--previous').simulate('click');
|
|
65
|
-
expect(mockedProps.handleNavigation).toHaveBeenCalledWith(mockedProps.direction.back);
|
|
66
|
-
});
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
await waitFor(() => {
|
|
69
|
+
const countDisplay = container.querySelector('p');
|
|
70
|
+
expect(countDisplay).toBe(null);
|
|
71
|
+
expect(asFragment()).toMatchSnapshot();
|
|
72
|
+
});
|
|
72
73
|
});
|
|
73
74
|
});
|
package/tests/unit/src/components/Carousel/CarouselRender/__snapshots__/CarouselRender.test.js.snap
CHANGED
|
@@ -1,3 +1,47 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`CarouselRender component should
|
|
3
|
+
exports[`CarouselRender component should not render number count if display count is disabled 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="carousel"
|
|
7
|
+
>
|
|
8
|
+
<div>
|
|
9
|
+
<div
|
|
10
|
+
class="carousel__button carousel__button--previous"
|
|
11
|
+
role="button"
|
|
12
|
+
>
|
|
13
|
+
<div
|
|
14
|
+
class="arrow arrow--left"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
<div
|
|
18
|
+
class="carousel__list"
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
class="carousel__slide"
|
|
22
|
+
>
|
|
23
|
+
<div />
|
|
24
|
+
</div>
|
|
25
|
+
<div
|
|
26
|
+
class="carousel__slide"
|
|
27
|
+
>
|
|
28
|
+
<div />
|
|
29
|
+
</div>
|
|
30
|
+
<div
|
|
31
|
+
class="carousel__slide"
|
|
32
|
+
>
|
|
33
|
+
<div />
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div
|
|
37
|
+
class="carousel__button carousel__button--next"
|
|
38
|
+
role="button"
|
|
39
|
+
>
|
|
40
|
+
<div
|
|
41
|
+
class="arrow arrow--right"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</DocumentFragment>
|
|
47
|
+
`;
|
|
File without changes
|
|
@@ -13,7 +13,10 @@ const mockedProps = {
|
|
|
13
13
|
name: 'testTabs',
|
|
14
14
|
contentType: 'tab',
|
|
15
15
|
groupSections: [<div>section one</div>, <div>section two</div>],
|
|
16
|
-
sectionsData: [
|
|
16
|
+
sectionsData: [
|
|
17
|
+
['section-one', 'sectionOne'],
|
|
18
|
+
['section-two', 'sectionTwo']
|
|
19
|
+
]
|
|
17
20
|
};
|
|
18
21
|
|
|
19
22
|
describe('ContentGroupTabs component', () => {
|
|
@@ -15,7 +15,10 @@ describe('getSectionsData helper', () => {
|
|
|
15
15
|
it('should return section name and label', () => {
|
|
16
16
|
const match = getSectionsData(mockedSections);
|
|
17
17
|
|
|
18
|
-
expect(match).toEqual([
|
|
18
|
+
expect(match).toEqual([
|
|
19
|
+
['nameone', 'labelonne'],
|
|
20
|
+
['nameTwo', 'labelTwo']
|
|
21
|
+
]);
|
|
19
22
|
});
|
|
20
23
|
|
|
21
24
|
it('should return section name and label propertly formated when spaces are present', () => {
|