Skip to content

Commit

Permalink
*feat data-test property for Carousel
Browse files Browse the repository at this point in the history
  • Loading branch information
Sodik committed Sep 27, 2023
1 parent d231d00 commit 4c3ea40
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/ui/src/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import cn from 'classnames'
import * as NukaCarousel from 'nuka-carousel'
import { CarouselProps as NukaCarouselProps } from 'nuka-carousel'
import { ChevronLeft, ChevronRight } from 'react-feather'
import { DataTestProp } from '@hazelcast/helpers'

import styleConsts from '../styles/constants/export.module.scss'
import styles from './Carousel.module.scss'
Expand All @@ -28,7 +29,8 @@ export type CarouselProps = {
color?: string
wrapperClassName?: string
defaultControlsConfig?: ControlsConfig
} & Omit<NukaCarouselProps, 'defaultControlsConfig'>
} & Omit<NukaCarouselProps, 'defaultControlsConfig'> &
DataTestProp

export const Carousel: FC<CarouselProps> = ({
children,
Expand All @@ -37,10 +39,11 @@ export const Carousel: FC<CarouselProps> = ({
cellSpacing = 15,
slidesToShow = 1,
defaultControlsConfig,
'data-test': dataTest = 'carousel',
...props
}) => {
return (
<div className={cn(wrapperClassName, styles.wrapper)}>
<div data-test={dataTest} className={cn(wrapperClassName, styles.wrapper)}>
<NukaCarousel.default
slidesToShow={slidesToShow}
defaultControlsConfig={{
Expand Down

0 comments on commit 4c3ea40

Please sign in to comment.