Skip to content

Commit

Permalink
SimpleStripTable dataTestId fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrikMatiasko committed Aug 18, 2024
1 parent 0abc7d5 commit b98df92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Atomic/SimpleStripTable/SimpleStripTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const SimpleStripTable: FC<Props> = (props) => {
const getDataTestId = useCallback(
(r: RowType, suffix: string, rowId: number) => {
if (r.hasOwnProperty('dataTestId')) {
return r.dataTestId?.concat(suffix)
return r.dataTestId?.concat(`-${suffix}`)
} else if (dataTestId) {
return dataTestId.concat(`-row-${rowId}-${suffix}`)
}
Expand Down Expand Up @@ -78,7 +78,7 @@ const SimpleStripTable: FC<Props> = (props) => {
lastRowBorder === false && key === rows.length - 1 && styles.noLastRowBorder,
noSidePadding && styles.noLeftPadding,
]}
data-test-id={getDataTestId(r, '-attribute', key)}
data-test-id={getDataTestId(r, 'attribute', key)}
>
{r.attribute}
{r.required && <span css={styles.required}> *</span>}
Expand All @@ -94,7 +94,7 @@ const SimpleStripTable: FC<Props> = (props) => {
lastRowBorder === false && key === rows.length - 1 && styles.noLastRowBorder,
noSidePadding && styles.noRightPadding,
]}
data-test-id={getDataTestId(r, '-value', key)}
data-test-id={getDataTestId(r, 'value', key)}
>
{r.value}
{r.copyValue && (
Expand Down

0 comments on commit b98df92

Please sign in to comment.