Skip to content

Commit

Permalink
fix: adjust the way used to set data-test-id for GridList
Browse files Browse the repository at this point in the history
  • Loading branch information
ts1994tw committed Apr 18, 2024
1 parent 825f9eb commit fd7c283
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/VirtuosoGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const GridItems: React.FC = /*#__PURE__*/ React.memo(function GridItems() {
className: listClassName,
...contextPropIfNotDomElement(ListComponent, context),
style: { paddingTop: gridState.offsetTop, paddingBottom: gridState.offsetBottom },
'data-test-id': 'virtuoso-item-list',
'data-testid': 'virtuoso-item-list',
},
gridState.items.map((item) => {
const key = computeItemKey(item.index, item.data, context)
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type ListProps = Pick<React.ComponentProps<'div'>, 'style' | 'children'>
* Passed to the Components.List custom component
*/
export type GridListProps = Pick<React.ComponentProps<'div'>, 'style' | 'children' | 'className'> & {
'data-test-id': string
'data-testid': string
} & React.RefAttributes<HTMLDivElement>

/**
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 @@ -13,7 +13,7 @@ exports[`VirtuosoMockContext > Grid > correctly renders items 1`] = `
>
<div
class="virtuoso-grid-list"
data-test-id="virtuoso-item-list"
data-testid="virtuoso-item-list"
style="padding-top: 0px; padding-bottom: 100px;"
>
<div
Expand Down Expand Up @@ -69,7 +69,7 @@ exports[`VirtuosoMockContext > Grid > correctly renders items with useWindowScro
>
<div
class="virtuoso-grid-list"
data-test-id="virtuoso-item-list"
data-testid="virtuoso-item-list"
style="padding-top: 0px; padding-bottom: 100px;"
>
<div
Expand Down

0 comments on commit fd7c283

Please sign in to comment.