Skip to content

Commit

Permalink
fix(StepProgress): add data-cy to buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
rschlaefli committed Jan 27, 2024
1 parent b210f64 commit 4f76b19
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/StepProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export function StepProgress({
{typeof displayOffsetLeft !== 'undefined' &&
value - displayOffsetLeft > 0 && (
<button
data-cy={data?.cy ? `${data?.cy}-left` : undefined}
className={twMerge(
className?.override,
'rounded-l px-3 py-1 hover:bg-primary-20 hover:text-primary',
Expand All @@ -138,6 +139,8 @@ export function StepProgress({
const formattedElement = formatter({ element, ix })
return (
<button
key={ix}
data-cy={data?.cy ? `${data?.cy}-${ix}` : undefined}
className={twMerge(
className?.override,
'flex flex-1 items-center justify-center border-r border-white p-1 last:border-r-0 hover:bg-primary-20 hover:text-primary',
Expand All @@ -163,6 +166,7 @@ export function StepProgress({
{typeof displayOffsetRight !== 'undefined' &&
length > value + displayOffsetRight + 1 && (
<button
data-cy={data?.cy ? `${data?.cy}-right` : undefined}
className={twMerge(
className?.override,
'rounded-r px-3 py-1 hover:bg-primary-20 hover:text-primary'
Expand Down

0 comments on commit 4f76b19

Please sign in to comment.