Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*feat data-test property for Carousel #516

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading