Skip to content

Commit 3c612bc

Browse files
Table - testId update
1 parent c5c03c0 commit 3c612bc

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

src/components/Atomic/SimpleStripTable/SimpleStripTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const SimpleStripTable: FC<Props> = (props) => {
7878
lastRowBorder === false && key === rows.length - 1 && styles.noLastRowBorder,
7979
noSidePadding && styles.noLeftPadding,
8080
]}
81-
data-test-id={getDataTestId(r, 'attribute', key)}
81+
data-test-id={getDataTestId(r, '-attribute', key)}
8282
>
8383
{r.attribute}
8484
{r.required && <span css={styles.required}> *</span>}
@@ -94,7 +94,7 @@ const SimpleStripTable: FC<Props> = (props) => {
9494
lastRowBorder === false && key === rows.length - 1 && styles.noLastRowBorder,
9595
noSidePadding && styles.noRightPadding,
9696
]}
97-
data-test-id={getDataTestId(r, 'value', key)}
97+
data-test-id={getDataTestId(r, '-value', key)}
9898
>
9999
{r.value}
100100
{r.copyValue && (

src/components/Atomic/TableNew/Table.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
// @ts-nocheck
22
import React, { ChangeEvent, FC, useEffect, useMemo, useState, useRef, useCallback } from 'react'
3+
import { createPortal } from 'react-dom'
4+
import { usePagination, useRowSelect, useSortBy, useTable, useGlobalFilter } from 'react-table'
5+
import get from 'lodash/get'
6+
import isEqual from 'lodash/isEqual'
7+
import isEmpty from 'lodash/isEmpty'
8+
import classNames from 'classnames'
9+
310
import { Props, defaultProps } from './Table.types'
411
import * as styles from './Table.styles'
5-
import { usePagination, useRowSelect, useSortBy, useTable, useGlobalFilter } from 'react-table'
612
import { compareIgnoreCase } from './Utils'
7-
import classNames from 'classnames'
813
import { IconTableArrowDown, IconTableArrowUp, convertSize } from '../Icon'
914
import Checkbox from '../Checkbox'
10-
import { createPortal } from 'react-dom'
1115
import Pagination from '../../Layout/Footer/Pagination/Pagination'
12-
import isEqual from 'lodash/isEqual'
13-
import isEmpty from 'lodash/isEmpty'
1416
import TableGlobalFilter from './TableGlobalFilter'
1517
import { GLOBAL_FILTER_HEIGHT, HEADER_HEIGHT } from './constants'
1618
import ConditionalWrapper from '../ConditionalWrapper'
1719
import IconLoader from '../Loader/IconLoader'
18-
import get from 'lodash/get'
1920

2021
const Table: FC<Props> = (props) => {
2122
const {

src/components/Atomic/TableNew/TableGlobalFilter/TableGlobalFilter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const TableGlobalFilter: FC<Props> = (props) => {
1414
}, 200)
1515

1616
return (
17-
<div css={styles.globalFilter}>
17+
<div css={styles.globalFilter} data-test-id={dataTestId}>
1818
<div css={styles.left}>
1919
<IconSearch css={styles.icon} />
2020
<input
@@ -30,7 +30,7 @@ const TableGlobalFilter: FC<Props> = (props) => {
3030
</div>
3131
{showFilterButton && (
3232
<div>
33-
<Button onClick={() => onChange(value)} size='small' variant='filter'>
33+
<Button data-test-id={dataTestId?.concat('-button')} onClick={() => onChange(value)} size='small' variant='filter'>
3434
{i18n.search}
3535
</Button>
3636
</div>

0 commit comments

Comments
 (0)