Skip to content

Commit

Permalink
Merge branch 'main' into react19
Browse files Browse the repository at this point in the history
  • Loading branch information
amanmahajan7 authored Jan 7, 2025
2 parents d8c5f9a + fc63ace commit 801943a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,9 @@ export default [

// React Hooks Extra
// https://eslint-react.xyz/
'react-hooks-extra/no-redundant-custom-hook': 1,
'react-hooks-extra/no-unnecessary-use-callback': 1,
'react-hooks-extra/no-unnecessary-use-memo': 1,
'react-hooks-extra/no-useless-custom-hooks': 1,
'react-hooks-extra/prefer-use-state-lazy-initialization': 1,

// SonarJS rules
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
"@types/node": "^22.0.0",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@typescript-eslint/eslint-plugin": "^8.18.1",
"@typescript-eslint/parser": "^8.18.1",
"@typescript-eslint/eslint-plugin": "^8.19.1",
"@typescript-eslint/parser": "^8.19.1",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/browser": "^2.1.8",
"@vitest/coverage-v8": "^2.1.8",
Expand All @@ -82,10 +82,10 @@
"browserslist": "^4.24.3",
"eslint": "^9.17.0",
"eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-compiler": "^19.0.0-beta-201e55d-20241215",
"eslint-plugin-react": "^7.37.3",
"eslint-plugin-react-compiler": "^19.0.0-beta-63e3235-20250105",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-hooks-extra": "^1.20.0",
"eslint-plugin-react-hooks-extra": "^1.23.2",
"eslint-plugin-sonarjs": "^3.0.1",
"eslint-plugin-testing-library": "^7.1.1",
"jspdf": "^2.5.1",
Expand Down
5 changes: 4 additions & 1 deletion src/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export interface DataGridProps<R, SR = unknown, K extends Key = Key> extends Sha
/** @default 'ltr' */
direction?: Maybe<Direction>;
'data-testid'?: Maybe<string>;
'data-cy'?: Maybe<string>;
}

/**
Expand Down Expand Up @@ -269,7 +270,8 @@ export default function DataGrid<R, SR, K extends Key>(props: DataGridProps<R, S
'aria-description': ariaDescription,
'aria-describedby': ariaDescribedBy,
'aria-rowcount': rawAriaRowCount,
'data-testid': testId
'data-testid': testId,
'data-cy': dataCy
} = props;

/**
Expand Down Expand Up @@ -1127,6 +1129,7 @@ export default function DataGrid<R, SR, K extends Key>(props: DataGridProps<R, S
onScroll={handleScroll}
onKeyDown={handleKeyDown}
data-testid={testId}
data-cy={dataCy}
>
<DataGridDefaultRenderersContext value={defaultGridComponents}>
<HeaderRowSelectionChangeContext value={selectHeaderRowLatest}>
Expand Down
6 changes: 5 additions & 1 deletion test/browser/label.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ test('should set label and description', () => {
'aria-label': 'label',
'aria-labelledby': 'labelledby',
'aria-description': 'description',
'aria-describedby': 'describedby'
'aria-describedby': 'describedby',
'data-testid': 'testid',
'data-cy': 'cy'
});

const grid = getGrid().element();
expect(grid).toHaveAttribute('aria-label', 'label');
expect(grid).toHaveAttribute('aria-labelledby', 'labelledby');
expect(grid).toHaveAttribute('aria-description', 'description');
expect(grid).toHaveAttribute('aria-describedby', 'describedby');
expect(grid).toHaveAttribute('data-testid', 'testid');
expect(grid).toHaveAttribute('data-cy', 'cy');
});

0 comments on commit 801943a

Please sign in to comment.