@orangesk/orange-design-system 2.0.0-beta.0 → 2.0.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/build/components/index.css +1 -2
- package/build/components/index.css.map +1 -1
- package/build/components/index.js +7 -7
- package/build/components/index.js.map +1 -1
- package/build/components/tsconfig.tsbuildinfo +1 -1
- package/build/components/types/index.d.ts +1508 -0
- package/build/components/types/src/components/Accordion/Accordion.d.ts +2 -0
- package/build/components/types/src/components/Accordion/AccordionHeader.d.ts +2 -1
- package/build/components/types/src/components/Accordion/AccordionItem.d.ts +2 -1
- package/build/components/types/src/components/AnchorNavigation/AnchorNavigation.d.ts +1 -1
- package/build/components/types/src/components/AnchorNavigation/AnchorNavigation.static.d.ts +19 -17
- package/build/components/types/src/components/AnchorNavigation/index.d.ts +0 -1
- package/build/components/types/src/components/BlockAction/index.d.ts +0 -1
- package/build/components/types/src/components/BodyBanner/index.d.ts +0 -1
- package/build/components/types/src/components/Button/Button.d.ts +1 -0
- package/build/components/types/src/components/Button/index.d.ts +0 -1
- package/build/components/types/src/components/Card/Card.d.ts +2 -4
- package/build/components/types/src/components/Card/CardSection.d.ts +2 -2
- package/build/components/types/src/components/Carousel/Carousel.d.ts +4 -0
- package/build/components/types/src/components/Carousel/Carousel.static.d.ts +1 -0
- package/build/components/types/src/components/Carousel/constants.d.ts +2 -0
- package/build/components/types/src/components/CarouselHero/CarouselHero.d.ts +18 -0
- package/build/components/types/src/components/CarouselHero/CarouselHero.static.d.ts +47 -0
- package/build/components/types/src/components/CarouselHero/CarouselHeroItem.d.ts +8 -0
- package/build/components/types/src/components/CarouselHero/constants.d.ts +33 -0
- package/build/components/types/src/components/CarouselHero/index.d.ts +2 -0
- package/build/components/types/src/components/Cover/index.d.ts +1 -2
- package/build/components/types/src/components/Divider/Divider.d.ts +0 -4
- package/build/components/types/src/components/Expander/Expander.d.ts +2 -2
- package/build/components/types/src/components/Footer/Footer.d.ts +1 -5
- package/build/components/types/src/components/Footer/constants.d.ts +9 -0
- package/build/components/types/src/components/Forms/Select/index.d.ts +0 -1
- package/build/components/types/src/components/Icon/iconSearchTags.d.ts +253 -251
- package/build/components/types/src/components/IconList/index.d.ts +2 -3
- package/build/components/types/src/components/List/index.d.ts +2 -3
- package/build/components/types/src/components/Megamenu/MegaMenuIcon.d.ts +13 -0
- package/build/components/types/src/components/Megamenu/Megamenu.d.ts +1 -9
- package/build/components/types/src/components/Megamenu/Megamenu.static.d.ts +47 -0
- package/build/components/types/src/components/Megamenu/MegamenuBlog.d.ts +1 -0
- package/build/components/types/src/components/Megamenu/constants.d.ts +48 -0
- package/build/components/types/src/components/Megamenu/index.d.ts +2 -3
- package/build/components/types/src/components/Megamenu/static.d.ts +22 -0
- package/build/components/types/src/components/Modal/Modal.d.ts +6 -0
- package/build/components/types/src/components/Modal/ModalBody.d.ts +4 -3
- package/build/components/types/src/components/Modal/ModalProductBody.d.ts +10 -0
- package/build/components/types/src/components/Modal/ModalProductFooter.d.ts +10 -0
- package/build/components/types/src/components/Modal/index.d.ts +2 -0
- package/build/components/types/src/components/Pagination/Pagination.d.ts +2 -3
- package/build/components/types/src/components/Pill/Pill.d.ts +4 -1
- package/build/components/types/src/components/Preview/PreviewGenerator.d.ts +1 -1
- package/build/components/types/src/components/PromoBanner/PromoBanner.d.ts +9 -5
- package/build/components/types/src/components/PromotionCard/PromotionCard.d.ts +2 -2
- package/build/components/types/src/components/Section/Section.d.ts +4 -1
- package/build/components/types/src/components/Tag/Tag.d.ts +9 -2
- package/build/components/types/src/components/index.d.ts +3 -5
- package/build/components/types/src/scripts/index.d.ts +10 -0
- package/build/lib/after-components.css +1 -1
- package/build/lib/after-components.css.map +1 -1
- package/build/lib/before-components.css +1 -1
- package/build/lib/before-components.css.map +1 -1
- package/build/lib/components.css +1 -1
- package/build/lib/components.css.map +1 -1
- package/build/lib/footer.css +2 -0
- package/build/lib/footer.css.map +1 -0
- package/build/lib/megamenu.css +2 -0
- package/build/lib/megamenu.css.map +1 -0
- package/build/lib/megamenu.js +2 -0
- package/build/lib/megamenu.js.map +1 -0
- package/build/lib/scripts.css +1 -1
- package/build/lib/scripts.css.map +1 -1
- package/build/lib/scripts.js +5 -5
- package/build/lib/scripts.js.map +1 -1
- package/build/lib/style.css +1 -1
- package/build/lib/style.css.map +1 -1
- package/build/lib/tsconfig.tsbuildinfo +1 -1
- package/build/logo-line.svg +5 -0
- package/build/sprite.svg +1 -1
- package/package.json +35 -29
- package/src/assets/icons/ai.svg +6 -0
- package/src/assets/icons/article.svg +7 -0
- package/src/assets/icons/pictogram-activation--dark.svg +10 -11
- package/src/assets/icons/pictogram-activation-free--dark.svg +4 -5
- package/src/assets/icons/pictogram-activation-free.svg +4 -5
- package/src/assets/icons/pictogram-activation.svg +10 -11
- package/src/assets/icons/pictogram-archive--dark.svg +3 -4
- package/src/assets/icons/pictogram-archive.svg +3 -4
- package/src/assets/icons/pictogram-calling-minutes--dark.svg +3 -4
- package/src/assets/icons/pictogram-calling-minutes.svg +3 -4
- package/src/assets/icons/pictogram-canal-plus--dark.svg +3 -4
- package/src/assets/icons/pictogram-canal-plus.svg +3 -4
- package/src/assets/icons/pictogram-competition-tickets--dark.svg +11 -12
- package/src/assets/icons/pictogram-competition-tickets.svg +11 -12
- package/src/assets/icons/pictogram-device-discount--dark.svg +7 -6
- package/src/assets/icons/pictogram-device-discount.svg +5 -6
- package/src/assets/icons/pictogram-discount-general--dark.svg +5 -6
- package/src/assets/icons/pictogram-discount-general.svg +5 -6
- package/src/assets/icons/pictogram-discount-price--dark.svg +5 -6
- package/src/assets/icons/pictogram-discount-price.svg +5 -6
- package/src/assets/icons/pictogram-extra-data--dark.svg +6 -7
- package/src/assets/icons/pictogram-extra-data.svg +6 -7
- package/src/assets/icons/pictogram-free-payment--dark.svg +5 -6
- package/src/assets/icons/pictogram-free-payment.svg +3 -6
- package/src/assets/icons/pictogram-gift--dark.svg +12 -13
- package/src/assets/icons/pictogram-gift-one-benefit--dark.svg +7 -8
- package/src/assets/icons/pictogram-gift-one-benefit.svg +7 -8
- package/src/assets/icons/pictogram-gift-two-benefits--dark.svg +8 -9
- package/src/assets/icons/pictogram-gift-two-benefits.svg +8 -9
- package/src/assets/icons/pictogram-gift.svg +3 -4
- package/src/assets/icons/pictogram-hbo-max--dark.svg +5 -6
- package/src/assets/icons/pictogram-hbo-max.svg +5 -6
- package/src/assets/icons/pictogram-infinite-sms--dark.svg +3 -4
- package/src/assets/icons/pictogram-infinite-sms.svg +3 -4
- package/src/assets/icons/pictogram-installation--dark.svg +4 -5
- package/src/assets/icons/pictogram-installation-free--dark.svg +4 -5
- package/src/assets/icons/pictogram-installation-free.svg +4 -5
- package/src/assets/icons/pictogram-installation.svg +4 -5
- package/src/assets/icons/pictogram-max--dark.svg +3 -4
- package/src/assets/icons/pictogram-max-canal-plus--dark.svg +5 -6
- package/src/assets/icons/pictogram-max-canal-plus.svg +5 -6
- package/src/assets/icons/pictogram-max.svg +3 -4
- package/src/assets/icons/pictogram-moj-orange-app--dark.svg +3 -4
- package/src/assets/icons/pictogram-moj-orange-app.svg +3 -4
- package/src/assets/icons/pictogram-movie-storage--dark.svg +4 -5
- package/src/assets/icons/pictogram-movie-storage.svg +4 -5
- package/src/assets/icons/pictogram-online-protection--dark.svg +3 -4
- package/src/assets/icons/pictogram-online-protection.svg +3 -4
- package/src/assets/icons/pictogram-random-damage--dark.svg +4 -8
- package/src/assets/icons/pictogram-random-damage.svg +4 -8
- package/src/assets/icons/pictogram-recycling--dark.svg +7 -8
- package/src/assets/icons/pictogram-recycling.svg +14 -15
- package/src/assets/icons/pictogram-repair--dark.svg +12 -13
- package/src/assets/icons/pictogram-repair.svg +12 -13
- package/src/assets/icons/pictogram-roaming--dark.svg +3 -4
- package/src/assets/icons/pictogram-roaming-discount--dark.svg +3 -16
- package/src/assets/icons/pictogram-roaming-discount.svg +15 -16
- package/src/assets/icons/pictogram-roaming.svg +3 -4
- package/src/assets/icons/pictogram-skylink--dark.svg +10 -11
- package/src/assets/icons/pictogram-skylink-live-tv--dark.svg +7 -8
- package/src/assets/icons/pictogram-skylink-live-tv.svg +7 -8
- package/src/assets/icons/pictogram-skylink.svg +10 -11
- package/src/assets/icons/pictogram-sms--dark.svg +5 -6
- package/src/assets/icons/pictogram-sms.svg +5 -6
- package/src/assets/icons/pictogram-theft--dark.svg +3 -7
- package/src/assets/icons/pictogram-theft.svg +3 -7
- package/src/assets/icons/pictogram-three-devices--dark.svg +4 -8
- package/src/assets/icons/pictogram-three-devices.svg +4 -8
- package/src/assets/icons/pictogram-trust--dark.svg +3 -4
- package/src/assets/icons/pictogram-trust.svg +3 -4
- package/src/assets/icons/pictogram-water-damage--dark.svg +5 -6
- package/src/assets/icons/pictogram-water-damage.svg +5 -6
- package/src/components/Accordion/Accordion.tsx +4 -0
- package/src/components/Accordion/AccordionHeader.tsx +9 -2
- package/src/components/Accordion/AccordionItem.tsx +5 -2
- package/src/components/Accordion/styles/config.scss +4 -4
- package/src/components/Accordion/styles/mixins.scss +9 -3
- package/src/components/Accordion/styles/style.scss +4 -0
- package/src/components/Accordion/tests/Accordion.unit.test.js +11 -0
- package/src/components/AnchorNavigation/AnchorNavigation.static.ts +253 -73
- package/src/components/AnchorNavigation/AnchorNavigation.tsx +20 -16
- package/src/components/AnchorNavigation/index.tsx +0 -2
- package/src/components/AnchorNavigation/styles/mixins.scss +14 -27
- package/src/components/AnchorNavigation/tests/AnchorNavigation.conformance.test.js +67 -0
- package/src/components/AnchorNavigation/tests/AnchorNavigation.unit.test.js +163 -0
- package/src/components/Bar/styles/config.scss +4 -5
- package/src/components/BlockAction/index.tsx +0 -2
- package/src/components/BlockAction/styles/mixins.scss +0 -6
- package/src/components/BodyBanner/index.tsx +0 -2
- package/src/components/Breadcrumbs/styles/mixins.scss +2 -4
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/Button/index.tsx +0 -2
- package/src/components/Button/styles/config.scss +1 -1
- package/src/components/Button/styles/mixins.scss +5 -0
- package/src/components/Button/styles/style.scss +4 -0
- package/src/components/Card/Card.tsx +20 -8
- package/src/components/Card/CardSection.tsx +7 -11
- package/src/components/Card/styles/config.scss +1 -1
- package/src/components/Card/styles/mixins.scss +8 -6
- package/src/components/Card/styles/style.scss +4 -0
- package/src/components/Card/tests/Card.unit.test.js +45 -11
- package/src/components/Card/tests/CardSection.unit.test.js +36 -3
- package/src/components/Carousel/Carousel.static.ts +67 -1
- package/src/components/Carousel/Carousel.tsx +41 -19
- package/src/components/Carousel/constants.ts +2 -0
- package/src/components/Carousel/styles/config.scss +1 -2
- package/src/components/Carousel/styles/mixins.scss +35 -2
- package/src/components/Carousel/styles/style.scss +8 -0
- package/src/components/CarouselHero/CarouselHero.static.ts +528 -0
- package/src/components/CarouselHero/CarouselHero.tsx +147 -0
- package/src/components/CarouselHero/CarouselHeroItem.tsx +40 -0
- package/src/components/CarouselHero/constants.ts +36 -0
- package/src/components/CarouselHero/index.ts +2 -0
- package/src/components/CarouselHero/styles/config.scss +54 -0
- package/src/components/CarouselHero/styles/mixins.scss +278 -0
- package/src/components/CarouselHero/styles/style.scss +63 -0
- package/src/components/CarouselHero/tests/CarouselHero.conformance.test.js +130 -0
- package/src/components/CarouselHero/tests/CarouselHero.unit.test.js +346 -0
- package/src/components/CarouselHero/tests/CarouselHeroItem.conformance.test.js +135 -0
- package/src/components/CarouselHero/tests/CarouselHeroItem.unit.test.js +143 -0
- package/src/components/CarouselPromotions/styles/mixins.scss +10 -3
- package/src/components/CartTable/FooterPriceColumn.tsx +5 -3
- package/src/components/CartTable/Price.tsx +1 -1
- package/src/components/Controls/styles/config.scss +2 -2
- package/src/components/Controls/tests/Controls.test.js +0 -9
- package/src/components/Cover/index.ts +1 -2
- package/src/components/Divider/Divider.tsx +2 -16
- package/src/components/Divider/styles/config.scss +0 -17
- package/src/components/Divider/styles/mixins.scss +8 -10
- package/src/components/Divider/styles/style.scss +2 -16
- package/src/components/Divider/tests/Divider.conformance.test.js +1 -1
- package/src/components/Divider/tests/Divider.unit.test.js +0 -17
- package/src/components/Dropdown/styles/mixins.scss +1 -1
- package/src/components/Expander/Expander.tsx +4 -2
- package/src/components/Expander/styles/style.scss +7 -0
- package/src/components/Footer/Footer.tsx +86 -70
- package/src/components/Footer/constants.ts +10 -0
- package/src/components/Footer/styles/config.scss +1 -0
- package/src/components/Footer/styles/mixins.scss +172 -0
- package/src/components/Footer/styles/style.scss +48 -0
- package/src/components/Footer/tests/Footer.conformance.test.js +133 -8
- package/src/components/Footer/tests/Footer.unit.test.js +71 -6
- package/src/components/Forms/DatePicker/styles/style.scss +1 -1
- package/src/components/Forms/File/styles/mixins.scss +1 -1
- package/src/components/Forms/InputStepper/styles/style.scss +0 -66
- package/src/components/Forms/RangeSlider/styles/mixins.scss +1 -1
- package/src/components/Forms/Select/index.tsx +0 -2
- package/src/components/Forms/TextInput/styles/config.scss +1 -1
- package/src/components/Forms/styles/config.scss +3 -3
- package/src/components/Icon/iconSearchTags.ts +434 -432
- package/src/components/Icon/styles/style.scss +15 -0
- package/src/components/Icon/tests/Pictogram.unit.test.js +38 -0
- package/src/components/IconList/index.ts +2 -3
- package/src/components/Link/styles/style.scss +6 -2
- package/src/components/Link/tests/Link.conformance.test.js +5 -20
- package/src/components/Link/tests/Link.unit.test.js +1 -10
- package/src/components/List/index.ts +2 -3
- package/src/components/Loader/Loader.tsx +2 -10
- package/src/components/Loader/styles/mixins.scss +1 -1
- package/src/components/Loader/styles/style.scss +6 -4
- package/src/components/Megamenu/MegaMenuIcon.tsx +48 -0
- package/src/components/Megamenu/Megamenu.static.ts +600 -0
- package/src/components/Megamenu/Megamenu.tsx +799 -356
- package/src/components/Megamenu/MegamenuBlog.tsx +309 -0
- package/src/components/Megamenu/constants.ts +56 -0
- package/src/components/Megamenu/index.ts +2 -5
- package/src/components/Megamenu/static.ts +73 -0
- package/src/components/Megamenu/styles/config.scss +2 -13
- package/src/components/Megamenu/styles/mixins.scss +647 -208
- package/src/components/Megamenu/styles/style.scss +173 -61
- package/src/components/Modal/Modal.tsx +17 -2
- package/src/components/Modal/ModalBody.tsx +29 -14
- package/src/components/Modal/ModalProductBody.tsx +52 -0
- package/src/components/Modal/ModalProductFooter.tsx +38 -0
- package/src/components/Modal/index.ts +2 -0
- package/src/components/Modal/styles/config.scss +7 -0
- package/src/components/Modal/styles/mixins.scss +121 -14
- package/src/components/Modal/styles/style.scss +28 -0
- package/src/components/Modal/tests/Modal.unit.test.js +73 -0
- package/src/components/Modal/tests/ModalBody.unit.test.js +28 -12
- package/src/components/Pagination/Pagination.tsx +2 -2
- package/src/components/Pill/Pill.tsx +8 -3
- package/src/components/Pill/styles/config.scss +22 -2
- package/src/components/Pill/styles/style.scss +7 -3
- package/src/components/Pill/tests/Pill.conformance.test.js +7 -3
- package/src/components/Pill/tests/Pill.unit.test.js +45 -7
- package/src/components/Preview/PreviewGenerator.tsx +78 -34
- package/src/components/PromoBanner/PromoBanner.tsx +52 -34
- package/src/components/PromoBanner/styles/mixins.scss +37 -20
- package/src/components/PromoBanner/styles/style.scss +5 -11
- package/src/components/PromoBanner/tests/PromoBanner.conformance.test.js +781 -0
- package/src/components/PromoBanner/tests/PromoBanner.unit.test.js +529 -0
- package/src/components/PromotionCard/PromotionCard.tsx +13 -12
- package/src/components/PromotionCard/tests/PromotionCard.conformance.test.js +567 -0
- package/src/components/PromotionCard/tests/PromotionCard.unit.test.js +500 -0
- package/src/components/Section/Section.tsx +20 -4
- package/src/components/Section/styles/config.scss +18 -16
- package/src/components/Section/styles/mixins.scss +16 -13
- package/src/components/Section/styles/style.scss +1 -0
- package/src/components/Section/tests/Section.conformance.test.js +27 -10
- package/src/components/Section/tests/Section.unit.test.js +73 -25
- package/src/components/Tag/Tag.tsx +27 -3
- package/src/components/Tag/styles/config.scss +31 -0
- package/src/components/Tag/styles/mixins.scss +39 -3
- package/src/components/Tag/styles/style.scss +28 -2
- package/src/components/Tag/tests/Tag.conformance.test.js +19 -1
- package/src/components/Tag/tests/Tag.unit.test.js +93 -0
- package/src/components/Tile/styles/style.scss +1 -1
- package/src/components/index.ts +5 -6
- package/src/styles/base/globals.scss +19 -0
- package/src/styles/base/styleguide.scss +17 -17
- package/src/styles/export/base.js +2 -2
- package/src/styles/export/color.js +2 -2
- package/src/styles/shame.scss +2 -1
- package/src/styles/tokens/base.scss +1 -1
- package/src/styles/tokens/color.scss +12 -8
- package/src/styles/typography/mixins.scss +3 -2
- package/src/styles/utilities/border.scss +1 -1
- package/src/styles/utilities/color.scss +113 -20
- package/src/styles/utilities/index.scss +1 -0
- package/src/styles/utilities/layout.scss +9 -0
- package/src/styles/utilities/ordering.scss +44 -0
- package/build/components/Accordion/index.js +0 -16
- package/build/components/Accordion/index.js.map +0 -1
- package/build/components/Accordion/tsconfig.tsbuildinfo +0 -1
- package/build/components/Alert/index.js +0 -16
- package/build/components/Alert/index.js.map +0 -1
- package/build/components/Alert/tsconfig.tsbuildinfo +0 -1
- package/build/components/AnchorNavigation/index.js +0 -16
- package/build/components/AnchorNavigation/index.js.map +0 -1
- package/build/components/AnchorNavigation/style.css +0 -2
- package/build/components/AnchorNavigation/style.css.map +0 -1
- package/build/components/AnchorNavigation/tsconfig.tsbuildinfo +0 -1
- package/build/components/Bar/index.js +0 -16
- package/build/components/Bar/index.js.map +0 -1
- package/build/components/Bar/tsconfig.tsbuildinfo +0 -1
- package/build/components/BlockAction/index.js +0 -16
- package/build/components/BlockAction/index.js.map +0 -1
- package/build/components/BlockAction/style.css +0 -2
- package/build/components/BlockAction/style.css.map +0 -1
- package/build/components/BlockAction/tsconfig.tsbuildinfo +0 -1
- package/build/components/BodyBanner/index.js +0 -16
- package/build/components/BodyBanner/index.js.map +0 -1
- package/build/components/BodyBanner/style.css +0 -2
- package/build/components/BodyBanner/style.css.map +0 -1
- package/build/components/BodyBanner/tsconfig.tsbuildinfo +0 -1
- package/build/components/Breadcrumbs/index.js +0 -16
- package/build/components/Breadcrumbs/index.js.map +0 -1
- package/build/components/Breadcrumbs/tsconfig.tsbuildinfo +0 -1
- package/build/components/Button/index.js +0 -16
- package/build/components/Button/index.js.map +0 -1
- package/build/components/Button/style.css +0 -2
- package/build/components/Button/style.css.map +0 -1
- package/build/components/Button/tsconfig.tsbuildinfo +0 -1
- package/build/components/Buttons/index.js +0 -16
- package/build/components/Buttons/index.js.map +0 -1
- package/build/components/Buttons/tsconfig.tsbuildinfo +0 -1
- package/build/components/Card/index.js +0 -16
- package/build/components/Card/index.js.map +0 -1
- package/build/components/Card/tsconfig.tsbuildinfo +0 -1
- package/build/components/Carousel/index.js +0 -16
- package/build/components/Carousel/index.js.map +0 -1
- package/build/components/Carousel/style.css +0 -2
- package/build/components/Carousel/style.css.map +0 -1
- package/build/components/Carousel/tsconfig.tsbuildinfo +0 -1
- package/build/components/CarouselPromotions/index.js +0 -16
- package/build/components/CarouselPromotions/index.js.map +0 -1
- package/build/components/CarouselPromotions/tsconfig.tsbuildinfo +0 -1
- package/build/components/CartTable/index.js +0 -16
- package/build/components/CartTable/index.js.map +0 -1
- package/build/components/CartTable/style.css +0 -2
- package/build/components/CartTable/style.css.map +0 -1
- package/build/components/CartTable/tsconfig.tsbuildinfo +0 -1
- package/build/components/Code/index.js +0 -11
- package/build/components/Code/index.js.map +0 -1
- package/build/components/Code/style.css +0 -2
- package/build/components/Code/style.css.map +0 -1
- package/build/components/Code/tsconfig.tsbuildinfo +0 -1
- package/build/components/Container/index.js +0 -16
- package/build/components/Container/index.js.map +0 -1
- package/build/components/Container/tsconfig.tsbuildinfo +0 -1
- package/build/components/Controls/index.js +0 -16
- package/build/components/Controls/index.js.map +0 -1
- package/build/components/Controls/tsconfig.tsbuildinfo +0 -1
- package/build/components/Cover/index.js +0 -16
- package/build/components/Cover/index.js.map +0 -1
- package/build/components/Cover/style.css +0 -2
- package/build/components/Cover/style.css.map +0 -1
- package/build/components/Cover/tsconfig.tsbuildinfo +0 -1
- package/build/components/Divider/index.js +0 -16
- package/build/components/Divider/index.js.map +0 -1
- package/build/components/Divider/tsconfig.tsbuildinfo +0 -1
- package/build/components/DocumentationSidebar/index.js +0 -16
- package/build/components/DocumentationSidebar/index.js.map +0 -1
- package/build/components/DocumentationSidebar/style.css +0 -2
- package/build/components/DocumentationSidebar/style.css.map +0 -1
- package/build/components/DocumentationSidebar/tsconfig.tsbuildinfo +0 -1
- package/build/components/Dropdown/index.js +0 -16
- package/build/components/Dropdown/index.js.map +0 -1
- package/build/components/Dropdown/style.css +0 -2
- package/build/components/Dropdown/style.css.map +0 -1
- package/build/components/Dropdown/tsconfig.tsbuildinfo +0 -1
- package/build/components/Expander/index.js +0 -16
- package/build/components/Expander/index.js.map +0 -1
- package/build/components/Expander/tsconfig.tsbuildinfo +0 -1
- package/build/components/FeatureAccordion/index.js +0 -16
- package/build/components/FeatureAccordion/index.js.map +0 -1
- package/build/components/FeatureAccordion/style.css +0 -2
- package/build/components/FeatureAccordion/style.css.map +0 -1
- package/build/components/FeatureAccordion/tsconfig.tsbuildinfo +0 -1
- package/build/components/Footer/index.js +0 -16
- package/build/components/Footer/index.js.map +0 -1
- package/build/components/Footer/style.css +0 -2
- package/build/components/Footer/style.css.map +0 -1
- package/build/components/Footer/tsconfig.tsbuildinfo +0 -1
- package/build/components/Forms/index.js +0 -20
- package/build/components/Forms/index.js.map +0 -1
- package/build/components/Forms/style.css +0 -2
- package/build/components/Forms/style.css.map +0 -1
- package/build/components/Forms/tsconfig.tsbuildinfo +0 -1
- package/build/components/Gauge/index.js +0 -16
- package/build/components/Gauge/index.js.map +0 -1
- package/build/components/Gauge/tsconfig.tsbuildinfo +0 -1
- package/build/components/Grid/index.js +0 -16
- package/build/components/Grid/index.js.map +0 -1
- package/build/components/Grid/style.css +0 -2
- package/build/components/Grid/style.css.map +0 -1
- package/build/components/Grid/tsconfig.tsbuildinfo +0 -1
- package/build/components/Hero/index.js +0 -16
- package/build/components/Hero/index.js.map +0 -1
- package/build/components/Hero/style.css +0 -2
- package/build/components/Hero/style.css.map +0 -1
- package/build/components/Hero/tsconfig.tsbuildinfo +0 -1
- package/build/components/Icon/index.js +0 -11
- package/build/components/Icon/index.js.map +0 -1
- package/build/components/Icon/tsconfig.tsbuildinfo +0 -1
- package/build/components/IconList/index.js +0 -16
- package/build/components/IconList/index.js.map +0 -1
- package/build/components/IconList/style.css +0 -2
- package/build/components/IconList/style.css.map +0 -1
- package/build/components/IconList/tsconfig.tsbuildinfo +0 -1
- package/build/components/Image/index.js +0 -16
- package/build/components/Image/index.js.map +0 -1
- package/build/components/Image/tsconfig.tsbuildinfo +0 -1
- package/build/components/Link/index.js +0 -7
- package/build/components/Link/index.js.map +0 -1
- package/build/components/Link/tsconfig.tsbuildinfo +0 -1
- package/build/components/List/index.js +0 -16
- package/build/components/List/index.js.map +0 -1
- package/build/components/List/style.css +0 -2
- package/build/components/List/style.css.map +0 -1
- package/build/components/List/tsconfig.tsbuildinfo +0 -1
- package/build/components/Loader/index.js +0 -16
- package/build/components/Loader/index.js.map +0 -1
- package/build/components/Loader/tsconfig.tsbuildinfo +0 -1
- package/build/components/Megamenu/index.js +0 -20
- package/build/components/Megamenu/index.js.map +0 -1
- package/build/components/Megamenu/style.css +0 -2
- package/build/components/Megamenu/style.css.map +0 -1
- package/build/components/Megamenu/tsconfig.tsbuildinfo +0 -1
- package/build/components/Modal/index.js +0 -20
- package/build/components/Modal/index.js.map +0 -1
- package/build/components/Modal/style.css +0 -2
- package/build/components/Modal/style.css.map +0 -1
- package/build/components/Modal/tsconfig.tsbuildinfo +0 -1
- package/build/components/Pagination/index.js +0 -16
- package/build/components/Pagination/index.js.map +0 -1
- package/build/components/Pagination/tsconfig.tsbuildinfo +0 -1
- package/build/components/Pill/index.js +0 -16
- package/build/components/Pill/index.js.map +0 -1
- package/build/components/Pill/tsconfig.tsbuildinfo +0 -1
- package/build/components/Preview/index.js +0 -77
- package/build/components/Preview/index.js.map +0 -1
- package/build/components/Preview/style.css +0 -2
- package/build/components/Preview/style.css.map +0 -1
- package/build/components/Preview/tsconfig.tsbuildinfo +0 -1
- package/build/components/Progress/index.js +0 -16
- package/build/components/Progress/index.js.map +0 -1
- package/build/components/Progress/tsconfig.tsbuildinfo +0 -1
- package/build/components/PromoBanner/index.js +0 -16
- package/build/components/PromoBanner/index.js.map +0 -1
- package/build/components/PromoBanner/style.css +0 -2
- package/build/components/PromoBanner/style.css.map +0 -1
- package/build/components/PromoBanner/tsconfig.tsbuildinfo +0 -1
- package/build/components/PromotionCard/index.js +0 -16
- package/build/components/PromotionCard/index.js.map +0 -1
- package/build/components/PromotionCard/tsconfig.tsbuildinfo +0 -1
- package/build/components/Section/index.js +0 -16
- package/build/components/Section/index.js.map +0 -1
- package/build/components/Section/tsconfig.tsbuildinfo +0 -1
- package/build/components/Skeleton/index.js +0 -16
- package/build/components/Skeleton/index.js.map +0 -1
- package/build/components/Skeleton/tsconfig.tsbuildinfo +0 -1
- package/build/components/SkipLink/index.js +0 -16
- package/build/components/SkipLink/index.js.map +0 -1
- package/build/components/SkipLink/tsconfig.tsbuildinfo +0 -1
- package/build/components/Stepbar/index.js +0 -16
- package/build/components/Stepbar/index.js.map +0 -1
- package/build/components/Stepbar/tsconfig.tsbuildinfo +0 -1
- package/build/components/Sticker/index.js +0 -16
- package/build/components/Sticker/index.js.map +0 -1
- package/build/components/Sticker/tsconfig.tsbuildinfo +0 -1
- package/build/components/Table/index.js +0 -16
- package/build/components/Table/index.js.map +0 -1
- package/build/components/Table/style.css +0 -2
- package/build/components/Table/style.css.map +0 -1
- package/build/components/Table/tsconfig.tsbuildinfo +0 -1
- package/build/components/Tabs/index.js +0 -16
- package/build/components/Tabs/index.js.map +0 -1
- package/build/components/Tabs/tsconfig.tsbuildinfo +0 -1
- package/build/components/Tag/index.js +0 -16
- package/build/components/Tag/index.js.map +0 -1
- package/build/components/Tag/tsconfig.tsbuildinfo +0 -1
- package/build/components/Testimonial/index.js +0 -16
- package/build/components/Testimonial/index.js.map +0 -1
- package/build/components/Testimonial/tsconfig.tsbuildinfo +0 -1
- package/build/components/Tile/index.js +0 -16
- package/build/components/Tile/index.js.map +0 -1
- package/build/components/Tile/tsconfig.tsbuildinfo +0 -1
- package/build/components/Tooltip/index.js +0 -16
- package/build/components/Tooltip/index.js.map +0 -1
- package/build/components/Tooltip/style.css +0 -2
- package/build/components/Tooltip/style.css.map +0 -1
- package/build/components/Tooltip/tsconfig.tsbuildinfo +0 -1
- package/build/components/static.css +0 -2
- package/build/components/static.css.map +0 -1
- package/build/components/static.js +0 -10
- package/build/components/static.js.map +0 -1
- package/build/components/types/src/components/Hero/HeroPlayground.d.ts +0 -2
- package/build/components/types/src/components/Megamenu/MegamenuDropdown.d.ts +0 -17
- package/src/components/Accordion/Accordion.mdx +0 -222
- package/src/components/Alert/Alert.mdx +0 -141
- package/src/components/Bar/Bar.mdx +0 -203
- package/src/components/BlockAction/BlockAction.mdx +0 -244
- package/src/components/BodyBanner/BodyBanner.mdx +0 -268
- package/src/components/Breadcrumbs/Breadcrumbs.mdx +0 -84
- package/src/components/Button/Button.mdx +0 -273
- package/src/components/Buttons/Buttons.mdx +0 -39
- package/src/components/Card/Card.mdx +0 -334
- package/src/components/Carousel/Carousel.mdx +0 -159
- package/src/components/CarouselPromotions/CarouselPromotions.mdx +0 -246
- package/src/components/CartTable/CartTable.mdx +0 -129
- package/src/components/Container/Container.mdx +0 -73
- package/src/components/Controls/Controls.mdx +0 -469
- package/src/components/Cover/Cover.mdx +0 -87
- package/src/components/Divider/Divider.mdx +0 -65
- package/src/components/Dropdown/Dropdown.mdx +0 -260
- package/src/components/Expander/Expander.mdx +0 -153
- package/src/components/FeatureAccordion/FeatureAccordion.mdx +0 -33
- package/src/components/Forms/Autocomplete/Autocomplete.mdx +0 -198
- package/src/components/Forms/Checkbox/Checkbox.mdx +0 -139
- package/src/components/Forms/DatePicker/DatePicker.mdx +0 -149
- package/src/components/Forms/Field/Field.mdx +0 -383
- package/src/components/Forms/Fieldset/Fieldset.mdx +0 -178
- package/src/components/Forms/File/File.mdx +0 -88
- package/src/components/Forms/FormTooltip.mdx +0 -51
- package/src/components/Forms/Forms.mdx +0 -48
- package/src/components/Forms/Group/Group.mdx +0 -146
- package/src/components/Forms/Hint/Hint.mdx +0 -40
- package/src/components/Forms/InputStepper/InputStepper.mdx +0 -147
- package/src/components/Forms/Label/Label.mdx +0 -95
- package/src/components/Forms/Message/Message.mdx +0 -40
- package/src/components/Forms/Radio/Radio.mdx +0 -98
- package/src/components/Forms/RangeSlider/RangeSlider.mdx +0 -304
- package/src/components/Forms/Select/Select.mdx +0 -106
- package/src/components/Forms/TextArea/TextArea.mdx +0 -109
- package/src/components/Forms/TextInput/TextInput.mdx +0 -153
- package/src/components/Gauge/Gauge.mdx +0 -35
- package/src/components/Grid/Grid.mdx +0 -320
- package/src/components/Hero/Hero.mdx +0 -168
- package/src/components/Hero/HeroPlayground.tsx +0 -369
- package/src/components/Icon/Icon.mdx +0 -172
- package/src/components/IconList/IconList.mdx +0 -53
- package/src/components/Image/Image.mdx +0 -175
- package/src/components/Link/Link.mdx +0 -224
- package/src/components/List/List.mdx +0 -216
- package/src/components/Loader/Loader.mdx +0 -148
- package/src/components/Megamenu/MegamenuDropdown.tsx +0 -64
- package/src/components/Modal/Modal.mdx +0 -565
- package/src/components/Pagination/Pagination.mdx +0 -45
- package/src/components/Pill/Pill.mdx +0 -41
- package/src/components/Progress/Progress.mdx +0 -119
- package/src/components/PromotionCard/PromotionCard.mdx +0 -191
- package/src/components/Section/Section.mdx +0 -397
- package/src/components/Skeleton/Skeleton.mdx +0 -90
- package/src/components/SkipLink/SkipLink.mdx +0 -23
- package/src/components/Stepbar/Stepbar.mdx +0 -137
- package/src/components/Sticker/Sticker.mdx +0 -50
- package/src/components/Table/Table.mdx +0 -199
- package/src/components/Tabs/Tabs.mdx +0 -373
- package/src/components/Tag/Tag.mdx +0 -52
- package/src/components/Testimonial/Testimonial.mdx +0 -41
- package/src/components/Tile/Tile.mdx +0 -163
- package/src/components/Tooltip/Tooltip.mdx +0 -227
|
@@ -0,0 +1,781 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import { axe } from "jest-axe";
|
|
4
|
+
import userEvent from "@testing-library/user-event";
|
|
5
|
+
|
|
6
|
+
import { PromoBanner } from "../";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* PromoBanner Component Conformance Tests
|
|
10
|
+
*
|
|
11
|
+
* These tests verify the complete functionality of the PromoBanner component including:
|
|
12
|
+
*
|
|
13
|
+
* 🎯 HTML VALIDITY
|
|
14
|
+
* - HTML validity with various prop combinations
|
|
15
|
+
* - Semantic HTML structure
|
|
16
|
+
* - Complex JSX structure validation
|
|
17
|
+
* - Grid layout structure
|
|
18
|
+
* - Image element validation
|
|
19
|
+
*
|
|
20
|
+
* ♿ ACCESSIBILITY (A11y)
|
|
21
|
+
* - WCAG 2.1 compliance using jest-axe
|
|
22
|
+
* - Proper use of semantic HTML elements
|
|
23
|
+
* - Image alt attributes
|
|
24
|
+
* - Interactive elements (buttons, links)
|
|
25
|
+
* - Focus management and keyboard navigation
|
|
26
|
+
* - Screen reader compatibility
|
|
27
|
+
* - Color contrast compliance
|
|
28
|
+
* - Grid layout accessibility
|
|
29
|
+
*
|
|
30
|
+
* 🎨 FUNCTIONAL BEHAVIOR
|
|
31
|
+
* - Correct application of CSS classes (promo-banner)
|
|
32
|
+
* - Color scheme variants: light, dark
|
|
33
|
+
* - Layout variants: default (horizontal), vertical
|
|
34
|
+
* - Image alignment: top, bottom
|
|
35
|
+
* - Image bleeding effect
|
|
36
|
+
* - Full width image functionality
|
|
37
|
+
* - Custom className merging
|
|
38
|
+
* - Grid and GridCol integration
|
|
39
|
+
* - Image component integration
|
|
40
|
+
*
|
|
41
|
+
* 📝 CONTENT RENDERING
|
|
42
|
+
* - Text children rendering
|
|
43
|
+
* - Complex JSX children
|
|
44
|
+
* - Multiple children
|
|
45
|
+
* - Empty content handling
|
|
46
|
+
* - Image rendering with various props
|
|
47
|
+
*
|
|
48
|
+
* ⚠️ EDGE CASES
|
|
49
|
+
* - Null, undefined, boolean children
|
|
50
|
+
* - Number and array children
|
|
51
|
+
* - Invalid props graceful handling
|
|
52
|
+
* - Empty image URLs
|
|
53
|
+
* - Boundary usage cases
|
|
54
|
+
*
|
|
55
|
+
* 🔗 INTEGRATION TESTS
|
|
56
|
+
* - Working with interactive elements
|
|
57
|
+
* - Grid component integration
|
|
58
|
+
* - Image component integration
|
|
59
|
+
* - Event handling
|
|
60
|
+
* - Focus management
|
|
61
|
+
* - Responsive behavior
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
describe("PromoBanner Component Conformance Tests", () => {
|
|
65
|
+
describe("HTML Validity", () => {
|
|
66
|
+
it("is valid HTML with default props", () => {
|
|
67
|
+
const { container } = render(<PromoBanner />);
|
|
68
|
+
expect(container).toHTMLValidate();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("is valid HTML with all props", () => {
|
|
72
|
+
const { container } = render(
|
|
73
|
+
<PromoBanner
|
|
74
|
+
colorScheme="dark"
|
|
75
|
+
className="test-class"
|
|
76
|
+
image="https://example.com/test.jpg"
|
|
77
|
+
alignImage="top"
|
|
78
|
+
bleedImage
|
|
79
|
+
imageFullWidth
|
|
80
|
+
variant="vertical"
|
|
81
|
+
itemClassName="custom-item"
|
|
82
|
+
imageClassName="custom-image"
|
|
83
|
+
data-testid="test-promo-banner"
|
|
84
|
+
>
|
|
85
|
+
<h2>Promotion Title</h2>
|
|
86
|
+
<p>Promotion description with detailed content</p>
|
|
87
|
+
<button type="button">Call to Action</button>
|
|
88
|
+
</PromoBanner>,
|
|
89
|
+
);
|
|
90
|
+
expect(container).toHTMLValidate();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("is valid HTML with complex content structure", () => {
|
|
94
|
+
const { container } = render(
|
|
95
|
+
<PromoBanner image="https://example.com/banner.jpg">
|
|
96
|
+
<header>
|
|
97
|
+
<h1>Special Offer</h1>
|
|
98
|
+
<p className="subtitle">Limited time promotion</p>
|
|
99
|
+
</header>
|
|
100
|
+
<main>
|
|
101
|
+
<section>
|
|
102
|
+
<h2>Details</h2>
|
|
103
|
+
<p>
|
|
104
|
+
Comprehensive promotion details with <strong>emphasis</strong>{" "}
|
|
105
|
+
and <em>italic text</em>.
|
|
106
|
+
</p>
|
|
107
|
+
<ul>
|
|
108
|
+
<li>Feature 1</li>
|
|
109
|
+
<li>Feature 2</li>
|
|
110
|
+
<li>Feature 3</li>
|
|
111
|
+
</ul>
|
|
112
|
+
<div>
|
|
113
|
+
<button type="button">Primary Action</button>
|
|
114
|
+
<button type="button">Secondary Action</button>
|
|
115
|
+
</div>
|
|
116
|
+
</section>
|
|
117
|
+
</main>
|
|
118
|
+
</PromoBanner>,
|
|
119
|
+
);
|
|
120
|
+
expect(container).toHTMLValidate();
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("is valid HTML with Grid layout structure", () => {
|
|
124
|
+
const { container } = render(
|
|
125
|
+
<PromoBanner>
|
|
126
|
+
<div className="content-wrapper">
|
|
127
|
+
<h2>Grid Layout Content</h2>
|
|
128
|
+
<p>Content rendered within Grid component structure</p>
|
|
129
|
+
</div>
|
|
130
|
+
</PromoBanner>,
|
|
131
|
+
);
|
|
132
|
+
expect(container).toHTMLValidate();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it("is valid HTML with Image component", () => {
|
|
136
|
+
const { container } = render(
|
|
137
|
+
<PromoBanner image="https://example.com/test.jpg" alignImage="bottom">
|
|
138
|
+
<h2>Content with Image</h2>
|
|
139
|
+
<p>Banner with properly structured Image component</p>
|
|
140
|
+
</PromoBanner>,
|
|
141
|
+
);
|
|
142
|
+
expect(container).toHTMLValidate();
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it("is valid HTML with vertical variant", () => {
|
|
146
|
+
const { container } = render(
|
|
147
|
+
<PromoBanner
|
|
148
|
+
variant="vertical"
|
|
149
|
+
image="https://example.com/vertical.jpg"
|
|
150
|
+
>
|
|
151
|
+
<h2>Vertical Layout</h2>
|
|
152
|
+
<p>Content in vertical layout structure</p>
|
|
153
|
+
</PromoBanner>,
|
|
154
|
+
);
|
|
155
|
+
expect(container).toHTMLValidate();
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("is valid HTML with bleeding image", () => {
|
|
159
|
+
const { container } = render(
|
|
160
|
+
<PromoBanner image="https://example.com/bleed.jpg" bleedImage>
|
|
161
|
+
<h2>Bleeding Image</h2>
|
|
162
|
+
<p>Content with bleeding image effect</p>
|
|
163
|
+
</PromoBanner>,
|
|
164
|
+
);
|
|
165
|
+
expect(container).toHTMLValidate();
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it("is valid HTML with full width image", () => {
|
|
169
|
+
const { container } = render(
|
|
170
|
+
<PromoBanner
|
|
171
|
+
variant="vertical"
|
|
172
|
+
image="https://example.com/fullwidth.jpg"
|
|
173
|
+
imageFullWidth
|
|
174
|
+
>
|
|
175
|
+
<h2>Full Width Image</h2>
|
|
176
|
+
<p>Content with full width image</p>
|
|
177
|
+
</PromoBanner>,
|
|
178
|
+
);
|
|
179
|
+
expect(container).toHTMLValidate();
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
describe("Accessibility (A11y)", () => {
|
|
184
|
+
it("is accessible with default props", async () => {
|
|
185
|
+
const { container } = render(
|
|
186
|
+
<PromoBanner>
|
|
187
|
+
<h2>Accessible Content</h2>
|
|
188
|
+
<p>This content is accessible by default</p>
|
|
189
|
+
</PromoBanner>,
|
|
190
|
+
);
|
|
191
|
+
expect(await axe(container)).toHaveNoViolations();
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
it("is accessible with all props", async () => {
|
|
195
|
+
const { container } = render(
|
|
196
|
+
<PromoBanner
|
|
197
|
+
colorScheme="dark"
|
|
198
|
+
image="https://example.com/test.jpg"
|
|
199
|
+
alignImage="top"
|
|
200
|
+
bleedImage
|
|
201
|
+
variant="vertical"
|
|
202
|
+
>
|
|
203
|
+
<h2>Accessible Banner</h2>
|
|
204
|
+
<p>Banner content with all accessibility features</p>
|
|
205
|
+
<button type="button">Accessible Button</button>
|
|
206
|
+
</PromoBanner>,
|
|
207
|
+
);
|
|
208
|
+
expect(await axe(container)).toHaveNoViolations();
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it("is accessible with complex interactive content", async () => {
|
|
212
|
+
const { container } = render(
|
|
213
|
+
<PromoBanner image="https://example.com/interactive.jpg">
|
|
214
|
+
<h1>Interactive Promotion</h1>
|
|
215
|
+
<p>
|
|
216
|
+
Promotion with multiple interactive elements and proper
|
|
217
|
+
accessibility
|
|
218
|
+
</p>
|
|
219
|
+
<form>
|
|
220
|
+
<label htmlFor="email">Email Address</label>
|
|
221
|
+
<input type="email" id="email" name="email" required />
|
|
222
|
+
<button type="submit">Subscribe</button>
|
|
223
|
+
</form>
|
|
224
|
+
<nav aria-label="Promotion navigation">
|
|
225
|
+
<ul>
|
|
226
|
+
<li>
|
|
227
|
+
<a href="#details">Details</a>
|
|
228
|
+
</li>
|
|
229
|
+
<li>
|
|
230
|
+
<a href="#terms">Terms</a>
|
|
231
|
+
</li>
|
|
232
|
+
<li>
|
|
233
|
+
<a href="#contact">Contact</a>
|
|
234
|
+
</li>
|
|
235
|
+
</ul>
|
|
236
|
+
</nav>
|
|
237
|
+
</PromoBanner>,
|
|
238
|
+
);
|
|
239
|
+
expect(await axe(container)).toHaveNoViolations();
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
it("has proper image alt attribute", async () => {
|
|
243
|
+
const { container } = render(
|
|
244
|
+
<PromoBanner image="https://example.com/promo.jpg">
|
|
245
|
+
<h2>Banner with Image</h2>
|
|
246
|
+
</PromoBanner>,
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
const image = screen.getByRole("img");
|
|
250
|
+
expect(image).toHaveAttribute("alt", "Obrázok");
|
|
251
|
+
expect(await axe(container)).toHaveNoViolations();
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it("is accessible with heading hierarchy", async () => {
|
|
255
|
+
const { container } = render(
|
|
256
|
+
<PromoBanner>
|
|
257
|
+
<h1>Main Banner Title</h1>
|
|
258
|
+
<h2>Subtitle</h2>
|
|
259
|
+
<h3>Section Title</h3>
|
|
260
|
+
<p>Content with proper heading hierarchy</p>
|
|
261
|
+
</PromoBanner>,
|
|
262
|
+
);
|
|
263
|
+
expect(await axe(container)).toHaveNoViolations();
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it("is accessible with form elements", async () => {
|
|
267
|
+
const { container } = render(
|
|
268
|
+
<PromoBanner>
|
|
269
|
+
<h2>Newsletter Signup</h2>
|
|
270
|
+
<form>
|
|
271
|
+
<fieldset>
|
|
272
|
+
<legend>Contact Information</legend>
|
|
273
|
+
<div>
|
|
274
|
+
<label htmlFor="promo-name">Name</label>
|
|
275
|
+
<input type="text" id="promo-name" name="name" required />
|
|
276
|
+
</div>
|
|
277
|
+
<div>
|
|
278
|
+
<label htmlFor="promo-email">Email</label>
|
|
279
|
+
<input type="email" id="promo-email" name="email" required />
|
|
280
|
+
</div>
|
|
281
|
+
<button type="submit">Submit</button>
|
|
282
|
+
</fieldset>
|
|
283
|
+
</form>
|
|
284
|
+
</PromoBanner>,
|
|
285
|
+
);
|
|
286
|
+
expect(await axe(container)).toHaveNoViolations();
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it("is accessible with ARIA attributes", async () => {
|
|
290
|
+
const { container } = render(
|
|
291
|
+
<PromoBanner>
|
|
292
|
+
<div role="banner" aria-labelledby="promo-title">
|
|
293
|
+
<h2 id="promo-title">Special Promotion</h2>
|
|
294
|
+
<p aria-describedby="promo-details">Limited time offer</p>
|
|
295
|
+
<div id="promo-details">
|
|
296
|
+
Valid until end of month. Terms and conditions apply.
|
|
297
|
+
</div>
|
|
298
|
+
<button
|
|
299
|
+
type="button"
|
|
300
|
+
aria-expanded="false"
|
|
301
|
+
aria-controls="promo-details"
|
|
302
|
+
>
|
|
303
|
+
Learn More
|
|
304
|
+
</button>
|
|
305
|
+
</div>
|
|
306
|
+
</PromoBanner>,
|
|
307
|
+
);
|
|
308
|
+
expect(await axe(container)).toHaveNoViolations();
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
describe("Functional Behavior", () => {
|
|
313
|
+
it("applies correct CSS classes for default state", () => {
|
|
314
|
+
const { container } = render(<PromoBanner>Content</PromoBanner>);
|
|
315
|
+
|
|
316
|
+
const banner = container.querySelector(".promo-banner");
|
|
317
|
+
const item = container.querySelector(".promo-banner__item");
|
|
318
|
+
|
|
319
|
+
expect(banner).toHaveClass("promo-banner");
|
|
320
|
+
expect(item).toHaveClass("promo-banner__item");
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
it("applies color scheme classes correctly", () => {
|
|
324
|
+
const { container: lightContainer } = render(
|
|
325
|
+
<PromoBanner colorScheme="light">Light Content</PromoBanner>,
|
|
326
|
+
);
|
|
327
|
+
const { container: darkContainer } = render(
|
|
328
|
+
<PromoBanner colorScheme="dark">Dark Content</PromoBanner>,
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
expect(lightContainer.querySelector(".promo-banner")).toHaveClass(
|
|
332
|
+
"is-light",
|
|
333
|
+
);
|
|
334
|
+
expect(darkContainer.querySelector(".promo-banner")).toHaveClass(
|
|
335
|
+
"is-dark",
|
|
336
|
+
);
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
it("applies variant classes correctly", () => {
|
|
340
|
+
const { container: horizontalContainer } = render(
|
|
341
|
+
<PromoBanner>Horizontal Content</PromoBanner>,
|
|
342
|
+
);
|
|
343
|
+
const { container: verticalContainer } = render(
|
|
344
|
+
<PromoBanner variant="vertical">Vertical Content</PromoBanner>,
|
|
345
|
+
);
|
|
346
|
+
|
|
347
|
+
const horizontalItem = horizontalContainer.querySelector(
|
|
348
|
+
".promo-banner__item",
|
|
349
|
+
);
|
|
350
|
+
const verticalItem = verticalContainer.querySelector(
|
|
351
|
+
".promo-banner__item",
|
|
352
|
+
);
|
|
353
|
+
|
|
354
|
+
expect(horizontalItem).not.toHaveClass(
|
|
355
|
+
"align-items-center",
|
|
356
|
+
"align-center",
|
|
357
|
+
"align-self-center",
|
|
358
|
+
);
|
|
359
|
+
expect(verticalItem).toHaveClass(
|
|
360
|
+
"align-items-center",
|
|
361
|
+
"align-center",
|
|
362
|
+
"align-self-center",
|
|
363
|
+
);
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
it("applies image-related classes correctly", () => {
|
|
367
|
+
const { container } = render(
|
|
368
|
+
<PromoBanner
|
|
369
|
+
image="test.jpg"
|
|
370
|
+
alignImage="top"
|
|
371
|
+
bleedImage
|
|
372
|
+
imageFullWidth
|
|
373
|
+
>
|
|
374
|
+
Content
|
|
375
|
+
</PromoBanner>,
|
|
376
|
+
);
|
|
377
|
+
|
|
378
|
+
const imageContainer = container.querySelector(".promo-banner__image");
|
|
379
|
+
const image = screen.getByRole("img");
|
|
380
|
+
|
|
381
|
+
expect(imageContainer).toHaveClass(
|
|
382
|
+
"promo-banner__image",
|
|
383
|
+
"promo-banner__image--bleed-right",
|
|
384
|
+
"align-self-top",
|
|
385
|
+
);
|
|
386
|
+
expect(image).toHaveClass("mb-none", "fullwidth");
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
it("merges custom classes correctly", () => {
|
|
390
|
+
const { container } = render(
|
|
391
|
+
<PromoBanner
|
|
392
|
+
className="custom-banner"
|
|
393
|
+
itemClassName="custom-item"
|
|
394
|
+
imageClassName="custom-image"
|
|
395
|
+
image="test.jpg"
|
|
396
|
+
>
|
|
397
|
+
Content
|
|
398
|
+
</PromoBanner>,
|
|
399
|
+
);
|
|
400
|
+
|
|
401
|
+
const banner = container.querySelector(".promo-banner");
|
|
402
|
+
const item = container.querySelector(".promo-banner__item");
|
|
403
|
+
const imageContainer = container.querySelector(".promo-banner__image");
|
|
404
|
+
|
|
405
|
+
expect(banner).toHaveClass("promo-banner", "custom-banner");
|
|
406
|
+
expect(item).toHaveClass("promo-banner__item", "custom-item");
|
|
407
|
+
expect(imageContainer).toHaveClass("promo-banner__image", "custom-image");
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
it("handles Grid component integration correctly", () => {
|
|
411
|
+
const { container } = render(<PromoBanner>Grid Content</PromoBanner>);
|
|
412
|
+
|
|
413
|
+
const grid = container.querySelector(".grid");
|
|
414
|
+
const gridCols = container.querySelectorAll(".grid__col");
|
|
415
|
+
|
|
416
|
+
expect(grid).toBeInTheDocument();
|
|
417
|
+
expect(gridCols).toHaveLength(1); // Only content column when no image
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
it("handles GridCol sizes correctly", () => {
|
|
421
|
+
const { container: noImageContainer } = render(
|
|
422
|
+
<PromoBanner>No image content</PromoBanner>,
|
|
423
|
+
);
|
|
424
|
+
const { container: withImageContainer } = render(
|
|
425
|
+
<PromoBanner image="test.jpg">With image content</PromoBanner>,
|
|
426
|
+
);
|
|
427
|
+
const { container: verticalContainer } = render(
|
|
428
|
+
<PromoBanner variant="vertical">Vertical content</PromoBanner>,
|
|
429
|
+
);
|
|
430
|
+
|
|
431
|
+
const noImageCol = noImageContainer.querySelector(".grid__col");
|
|
432
|
+
const withImageContentCol = withImageContainer
|
|
433
|
+
.querySelector(".promo-banner__item")
|
|
434
|
+
.closest(".grid__col");
|
|
435
|
+
const verticalCol = verticalContainer.querySelector(".grid__col");
|
|
436
|
+
|
|
437
|
+
expect(noImageCol).toHaveClass("grid__col");
|
|
438
|
+
expect(withImageContentCol).toHaveClass("grid__col");
|
|
439
|
+
expect(verticalCol).toHaveClass("grid__col");
|
|
440
|
+
});
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
describe("Content Rendering", () => {
|
|
444
|
+
it("renders text content correctly", () => {
|
|
445
|
+
render(<PromoBanner>Simple text content</PromoBanner>);
|
|
446
|
+
expect(screen.getByText("Simple text content")).toBeInTheDocument();
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
it("renders complex JSX content correctly", () => {
|
|
450
|
+
render(
|
|
451
|
+
<PromoBanner>
|
|
452
|
+
<div data-testid="complex-wrapper">
|
|
453
|
+
<h1>Complex Title</h1>
|
|
454
|
+
<p>
|
|
455
|
+
Complex description with <strong>bold</strong> and <em>italic</em>{" "}
|
|
456
|
+
text
|
|
457
|
+
</p>
|
|
458
|
+
<ul>
|
|
459
|
+
<li>List item 1</li>
|
|
460
|
+
<li>List item 2</li>
|
|
461
|
+
</ul>
|
|
462
|
+
<button type="button">Action Button</button>
|
|
463
|
+
</div>
|
|
464
|
+
</PromoBanner>,
|
|
465
|
+
);
|
|
466
|
+
|
|
467
|
+
expect(screen.getByTestId("complex-wrapper")).toBeInTheDocument();
|
|
468
|
+
expect(screen.getByRole("heading", { level: 1 })).toHaveTextContent(
|
|
469
|
+
"Complex Title",
|
|
470
|
+
);
|
|
471
|
+
expect(screen.getByRole("button")).toHaveTextContent("Action Button");
|
|
472
|
+
expect(screen.getByRole("list")).toBeInTheDocument();
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
it("renders multiple children correctly", () => {
|
|
476
|
+
render(
|
|
477
|
+
<PromoBanner>
|
|
478
|
+
<h2>Title</h2>
|
|
479
|
+
<p>Description</p>
|
|
480
|
+
<div>Additional content</div>
|
|
481
|
+
<button type="button">Button</button>
|
|
482
|
+
</PromoBanner>,
|
|
483
|
+
);
|
|
484
|
+
|
|
485
|
+
expect(screen.getByRole("heading")).toBeInTheDocument();
|
|
486
|
+
expect(screen.getByText("Description")).toBeInTheDocument();
|
|
487
|
+
expect(screen.getByText("Additional content")).toBeInTheDocument();
|
|
488
|
+
expect(screen.getByRole("button")).toBeInTheDocument();
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
it("renders image with correct attributes", () => {
|
|
492
|
+
render(
|
|
493
|
+
<PromoBanner image="https://example.com/banner.jpg" imageFullWidth>
|
|
494
|
+
Content with image
|
|
495
|
+
</PromoBanner>,
|
|
496
|
+
);
|
|
497
|
+
|
|
498
|
+
const image = screen.getByRole("img");
|
|
499
|
+
expect(image).toHaveAttribute("src", "https://example.com/banner.jpg");
|
|
500
|
+
expect(image).toHaveAttribute("alt", "Obrázok");
|
|
501
|
+
expect(image).toHaveClass("mb-none", "fullwidth");
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
it("renders content without image correctly", () => {
|
|
505
|
+
render(<PromoBanner>Content without image</PromoBanner>);
|
|
506
|
+
|
|
507
|
+
expect(screen.getByText("Content without image")).toBeInTheDocument();
|
|
508
|
+
expect(screen.queryByRole("img")).not.toBeInTheDocument();
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
it("handles dynamic content updates", () => {
|
|
512
|
+
const { rerender } = render(<PromoBanner>Initial content</PromoBanner>);
|
|
513
|
+
expect(screen.getByText("Initial content")).toBeInTheDocument();
|
|
514
|
+
|
|
515
|
+
rerender(<PromoBanner>Updated content</PromoBanner>);
|
|
516
|
+
expect(screen.getByText("Updated content")).toBeInTheDocument();
|
|
517
|
+
expect(screen.queryByText("Initial content")).not.toBeInTheDocument();
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
describe("Edge Cases", () => {
|
|
522
|
+
it("handles null children gracefully", () => {
|
|
523
|
+
const { container } = render(<PromoBanner>{null}</PromoBanner>);
|
|
524
|
+
const banner = container.querySelector(".promo-banner");
|
|
525
|
+
expect(banner).toBeInTheDocument();
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
it("handles undefined children gracefully", () => {
|
|
529
|
+
const { container } = render(<PromoBanner>{undefined}</PromoBanner>);
|
|
530
|
+
const banner = container.querySelector(".promo-banner");
|
|
531
|
+
expect(banner).toBeInTheDocument();
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
it("handles boolean children gracefully", () => {
|
|
535
|
+
const { container } = render(<PromoBanner>{true}</PromoBanner>);
|
|
536
|
+
const banner = container.querySelector(".promo-banner");
|
|
537
|
+
expect(banner).toBeInTheDocument();
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
it("handles number children", () => {
|
|
541
|
+
render(<PromoBanner>{42}</PromoBanner>);
|
|
542
|
+
expect(screen.getByText("42")).toBeInTheDocument();
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
it("handles array children", () => {
|
|
546
|
+
render(<PromoBanner>{["Banner 1", "Banner 2", "Banner 3"]}</PromoBanner>);
|
|
547
|
+
expect(screen.getByText(/Banner 1/)).toBeInTheDocument();
|
|
548
|
+
expect(screen.getByText(/Banner 2/)).toBeInTheDocument();
|
|
549
|
+
expect(screen.getByText(/Banner 3/)).toBeInTheDocument();
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
it("handles empty string children", () => {
|
|
553
|
+
const { container } = render(<PromoBanner>{""}</PromoBanner>);
|
|
554
|
+
const banner = container.querySelector(".promo-banner");
|
|
555
|
+
expect(banner).toBeInTheDocument();
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
it("handles invalid colorScheme prop gracefully", () => {
|
|
559
|
+
const { container } = render(
|
|
560
|
+
<PromoBanner colorScheme="invalid-scheme" data-testid="test-banner">
|
|
561
|
+
Content
|
|
562
|
+
</PromoBanner>,
|
|
563
|
+
);
|
|
564
|
+
const banner = container.querySelector(".promo-banner");
|
|
565
|
+
expect(banner).toHaveClass("promo-banner");
|
|
566
|
+
expect(banner).not.toHaveClass("is-light");
|
|
567
|
+
expect(banner).not.toHaveClass("is-dark");
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
it("handles invalid alignImage prop gracefully", () => {
|
|
571
|
+
const { container } = render(
|
|
572
|
+
<PromoBanner image="test.jpg" alignImage="invalid">
|
|
573
|
+
Content
|
|
574
|
+
</PromoBanner>,
|
|
575
|
+
);
|
|
576
|
+
const imageContainer = container.querySelector(".promo-banner__image");
|
|
577
|
+
expect(imageContainer).toHaveClass("promo-banner__image");
|
|
578
|
+
// Invalid align values are passed through
|
|
579
|
+
expect(imageContainer).toHaveClass("align-self-invalid");
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
it("handles invalid variant prop gracefully", () => {
|
|
583
|
+
const { container } = render(
|
|
584
|
+
<PromoBanner variant="invalid">Content</PromoBanner>,
|
|
585
|
+
);
|
|
586
|
+
const contentCol = container
|
|
587
|
+
.querySelector(".promo-banner__item")
|
|
588
|
+
.closest(".grid__col");
|
|
589
|
+
// Should use default horizontal behavior
|
|
590
|
+
expect(contentCol).toHaveClass("grid__col");
|
|
591
|
+
const item = container.querySelector(".promo-banner__item");
|
|
592
|
+
expect(item).not.toHaveClass(
|
|
593
|
+
"align-items-center",
|
|
594
|
+
"align-center",
|
|
595
|
+
"align-self-center",
|
|
596
|
+
);
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
it("handles empty image URL", () => {
|
|
600
|
+
render(<PromoBanner image="">Content with empty image</PromoBanner>);
|
|
601
|
+
// Empty image URL should not render an image element
|
|
602
|
+
expect(screen.queryByRole("img")).not.toBeInTheDocument();
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
it("handles very long content gracefully", () => {
|
|
606
|
+
const longContent = "Very long content ".repeat(100);
|
|
607
|
+
render(<PromoBanner>{longContent}</PromoBanner>);
|
|
608
|
+
expect(screen.getByText(/Very long content/)).toBeInTheDocument();
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
it("handles special characters in content", () => {
|
|
612
|
+
const specialContent =
|
|
613
|
+
"Content with special chars: áčďéíľňóôšťúžý @#$%^&*()";
|
|
614
|
+
render(<PromoBanner>{specialContent}</PromoBanner>);
|
|
615
|
+
expect(screen.getByText(specialContent)).toBeInTheDocument();
|
|
616
|
+
});
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
describe("Integration Tests", () => {
|
|
620
|
+
it("works with interactive elements", async () => {
|
|
621
|
+
const user = userEvent.setup();
|
|
622
|
+
const handleClick = jest.fn();
|
|
623
|
+
|
|
624
|
+
render(
|
|
625
|
+
<PromoBanner>
|
|
626
|
+
<h2>Interactive Banner</h2>
|
|
627
|
+
<button type="button" onClick={handleClick}>
|
|
628
|
+
Click me
|
|
629
|
+
</button>
|
|
630
|
+
</PromoBanner>,
|
|
631
|
+
);
|
|
632
|
+
|
|
633
|
+
const button = screen.getByRole("button");
|
|
634
|
+
await user.click(button);
|
|
635
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
it("handles form submission within banner", async () => {
|
|
639
|
+
const user = userEvent.setup();
|
|
640
|
+
const handleSubmit = jest.fn((e) => e.preventDefault());
|
|
641
|
+
|
|
642
|
+
render(
|
|
643
|
+
<PromoBanner>
|
|
644
|
+
<form onSubmit={handleSubmit}>
|
|
645
|
+
<label htmlFor="test-input">Test Input</label>
|
|
646
|
+
<input type="text" id="test-input" />
|
|
647
|
+
<button type="submit">Submit</button>
|
|
648
|
+
</form>
|
|
649
|
+
</PromoBanner>,
|
|
650
|
+
);
|
|
651
|
+
|
|
652
|
+
const input = screen.getByLabelText("Test Input");
|
|
653
|
+
const submitButton = screen.getByRole("button", { name: "Submit" });
|
|
654
|
+
|
|
655
|
+
await user.type(input, "test value");
|
|
656
|
+
await user.click(submitButton);
|
|
657
|
+
|
|
658
|
+
expect(handleSubmit).toHaveBeenCalledTimes(1);
|
|
659
|
+
expect(input).toHaveValue("test value");
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
it("handles focus management correctly", async () => {
|
|
663
|
+
const user = userEvent.setup();
|
|
664
|
+
|
|
665
|
+
render(
|
|
666
|
+
<PromoBanner>
|
|
667
|
+
<button type="button">Button 1</button>
|
|
668
|
+
<button type="button">Button 2</button>
|
|
669
|
+
<a href="#">Link</a>
|
|
670
|
+
</PromoBanner>,
|
|
671
|
+
);
|
|
672
|
+
|
|
673
|
+
const button1 = screen.getByRole("button", { name: "Button 1" });
|
|
674
|
+
const button2 = screen.getByRole("button", { name: "Button 2" });
|
|
675
|
+
const link = screen.getByRole("link");
|
|
676
|
+
|
|
677
|
+
await user.tab();
|
|
678
|
+
expect(button1).toHaveFocus();
|
|
679
|
+
|
|
680
|
+
await user.tab();
|
|
681
|
+
expect(button2).toHaveFocus();
|
|
682
|
+
|
|
683
|
+
await user.tab();
|
|
684
|
+
expect(link).toHaveFocus();
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
it("works with keyboard navigation", async () => {
|
|
688
|
+
const user = userEvent.setup();
|
|
689
|
+
const handleClick = jest.fn();
|
|
690
|
+
|
|
691
|
+
render(
|
|
692
|
+
<PromoBanner>
|
|
693
|
+
<button type="button" onClick={handleClick}>
|
|
694
|
+
Keyboard accessible button
|
|
695
|
+
</button>
|
|
696
|
+
</PromoBanner>,
|
|
697
|
+
);
|
|
698
|
+
|
|
699
|
+
const button = screen.getByRole("button");
|
|
700
|
+
button.focus();
|
|
701
|
+
await user.keyboard("{Enter}");
|
|
702
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
703
|
+
|
|
704
|
+
await user.keyboard(" ");
|
|
705
|
+
expect(handleClick).toHaveBeenCalledTimes(2);
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
it("maintains proper Grid component behavior", () => {
|
|
709
|
+
const { container } = render(
|
|
710
|
+
<PromoBanner className="test-grid">
|
|
711
|
+
<div>Grid content</div>
|
|
712
|
+
</PromoBanner>,
|
|
713
|
+
);
|
|
714
|
+
|
|
715
|
+
const grid = container.querySelector(".grid");
|
|
716
|
+
const gridCol = container.querySelector(".grid__col");
|
|
717
|
+
|
|
718
|
+
expect(grid).toHaveClass("grid", "promo-banner", "test-grid");
|
|
719
|
+
expect(gridCol).toHaveClass("grid__col");
|
|
720
|
+
});
|
|
721
|
+
|
|
722
|
+
it("handles event propagation correctly", async () => {
|
|
723
|
+
const user = userEvent.setup();
|
|
724
|
+
const bannerClick = jest.fn();
|
|
725
|
+
const buttonClick = jest.fn((e) => e.stopPropagation());
|
|
726
|
+
|
|
727
|
+
render(
|
|
728
|
+
<PromoBanner onClick={bannerClick}>
|
|
729
|
+
<button type="button" onClick={buttonClick}>
|
|
730
|
+
Stop propagation button
|
|
731
|
+
</button>
|
|
732
|
+
</PromoBanner>,
|
|
733
|
+
);
|
|
734
|
+
|
|
735
|
+
const button = screen.getByRole("button");
|
|
736
|
+
await user.click(button);
|
|
737
|
+
|
|
738
|
+
expect(buttonClick).toHaveBeenCalledTimes(1);
|
|
739
|
+
expect(bannerClick).not.toHaveBeenCalled(); // Should be stopped
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
it("works with responsive image behavior", () => {
|
|
743
|
+
render(
|
|
744
|
+
<PromoBanner image="responsive.jpg" imageFullWidth>
|
|
745
|
+
Responsive content
|
|
746
|
+
</PromoBanner>,
|
|
747
|
+
);
|
|
748
|
+
|
|
749
|
+
const image = screen.getByRole("img");
|
|
750
|
+
expect(image).toHaveClass("fullwidth");
|
|
751
|
+
expect(image).toHaveAttribute("src", "responsive.jpg");
|
|
752
|
+
});
|
|
753
|
+
|
|
754
|
+
it("handles complex nested component structure", () => {
|
|
755
|
+
render(
|
|
756
|
+
<PromoBanner image="complex.jpg" variant="vertical">
|
|
757
|
+
<header>
|
|
758
|
+
<h1>Complex Structure</h1>
|
|
759
|
+
</header>
|
|
760
|
+
<main>
|
|
761
|
+
<section>
|
|
762
|
+
<h2>Section Title</h2>
|
|
763
|
+
<article>
|
|
764
|
+
<h3>Article Title</h3>
|
|
765
|
+
<p>Article content</p>
|
|
766
|
+
</article>
|
|
767
|
+
</section>
|
|
768
|
+
</main>
|
|
769
|
+
<aside>
|
|
770
|
+
<p>Sidebar content</p>
|
|
771
|
+
</aside>
|
|
772
|
+
</PromoBanner>,
|
|
773
|
+
);
|
|
774
|
+
|
|
775
|
+
expect(screen.getByRole("banner")).toBeInTheDocument();
|
|
776
|
+
expect(screen.getByRole("main")).toBeInTheDocument();
|
|
777
|
+
expect(screen.getByRole("complementary")).toBeInTheDocument();
|
|
778
|
+
expect(screen.getByRole("article")).toBeInTheDocument();
|
|
779
|
+
});
|
|
780
|
+
});
|
|
781
|
+
});
|