chore: Added data-test attributes for testing (#11254)

* Added data-test attributes for testing

* fixed incorrect naming change

* review changes
This commit is contained in:
adam-stasiak-polidea
2020-10-15 01:12:01 +02:00
committed by GitHub
parent 0262daa228
commit fc03549299
51 changed files with 229 additions and 72 deletions

View File

@@ -211,7 +211,11 @@ export default function TableCollection({
highlightRowId,
}: TableCollectionProps) {
return (
<Table {...getTableProps()} className="table table-hover">
<Table
{...getTableProps()}
className="table table-hover"
data-test="listview-table"
>
<thead>
{headerGroups.map(headerGroup => (
<tr {...headerGroup.getHeaderGroupProps()}>
@@ -272,6 +276,7 @@ export default function TableCollection({
const rowId = row.original.id;
return (
<tr
data-test="table-row"
{...row.getRowProps()}
className={cx('table-row', {
'table-row-selected':
@@ -285,6 +290,7 @@ export default function TableCollection({
const columnCellProps = cell.column.cellProps || {};
return (
<td
data-test="table-cell"
className={cx('table-cell', {
'table-cell-loader': loading,
[cell.column.size || '']: cell.column.size,
@@ -293,7 +299,7 @@ export default function TableCollection({
{...columnCellProps}
>
<span className={cx({ 'loading-bar': loading })}>
<span>{cell.render('Cell')}</span>
<span data-test="cell-text">{cell.render('Cell')}</span>
</span>
</td>
);