Skip to content

Commit

Permalink
fix: adjust the way used to set data-test-id for table
Browse files Browse the repository at this point in the history
  • Loading branch information
ts1994tw authored and petyosi committed Apr 18, 2024
1 parent f9127e8 commit 0010df4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/TableVirtuoso.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const Items = /*#__PURE__*/ React.memo(function VirtuosoItems() {

return React.createElement(
TableBodyComponent,
{ ref: callbackRef, 'data-test-id': 'virtuoso-item-list', ...contextPropIfNotDomElement(TableBodyComponent, context) },
{ ref: callbackRef, 'data-testid': 'virtuoso-item-list', ...contextPropIfNotDomElement(TableBodyComponent, context) },
[paddingTopEl, ...items, paddingBottomEl]
)
})
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export type TableProps = Pick<React.ComponentProps<'table'>, 'style' | 'children
* Passed to the Components.TableBody custom component
*/
export type TableBodyProps = Pick<React.ComponentProps<'tbody'>, 'style' | 'children' | 'className'> & {
'data-test-id': string
'data-testid': string
} & React.RefAttributes<HTMLTableSectionElement>

/**
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/VirtuosoMockContext.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ exports[`VirtuosoMockContext > Table > correctly renders items 1`] = `
style="border-spacing: 0; overflow-anchor: none;"
>
<tbody
data-test-id="virtuoso-item-list"
data-testid="virtuoso-item-list"
>
<tr
data-index="0"
Expand Down Expand Up @@ -281,7 +281,7 @@ exports[`VirtuosoMockContext > Table > correctly renders items with useWindowScr
style="border-spacing: 0; overflow-anchor: none;"
>
<tbody
data-test-id="virtuoso-item-list"
data-testid="virtuoso-item-list"
>
<tr
data-index="0"
Expand Down

0 comments on commit 0010df4

Please sign in to comment.