-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGrid] Only three columns are rendered in jsdom #1519
Comments
@mattcarlotta Thanks for reporting this limitation. I can confirm with this test case: diff --git a/packages/grid/data-grid/src/tests/layout.DataGrid.test.tsx b/packages/grid/data-grid/src/tests/layout.DataGrid.test.tsx
index 984ec63b..eebe2074 100644
--- a/packages/grid/data-grid/src/tests/layout.DataGrid.test.tsx
+++ b/packages/grid/data-grid/src/tests/layout.DataGrid.test.tsx
@@ -8,7 +8,7 @@ import {
import { useFakeTimers, stub } from 'sinon';
import { expect } from 'chai';
import { DataGrid, GridValueGetterParams, GridToolbar } from '@material-ui/data-grid';
-import { getColumnValues, raf, sleep } from 'test/utils/helperFn';
+import { getColumnValues, raf, sleep, getRow } from 'test/utils/helperFn';
describe('<DataGrid /> - Layout & Warnings', () => {
// TODO v5: replace with createClientRender
@@ -32,6 +32,32 @@ describe('<DataGrid /> - Layout & Warnings', () => {
columns: [{ field: 'brand' }],
};
+ it.only('should support no virtualization', () => {
+ const columns = [
+ { field: 'id', headerName: 'ID', width: 70 },
+ { field: 'firstName', headerName: 'First name', width: 130 },
+ { field: 'lastName', headerName: 'Last name', width: 130 },
+ {
+ field: 'age',
+ headerName: 'Age',
+ type: 'number',
+ width: 90,
+ },
+ {
+ field: 'action',
+ renderCell: () => <button>Action</button>,
+ },
+ ];
+
+ const rows = [{ id: 1, lastName: 'Snow', firstName: 'Jon', age: 35 }];
+ render(
+ <div style={{ height: 400, width: '100%' }}>
+ <DataGrid autoHeight rows={rows} columns={columns} pageSize={5} />
+ </div>,
+ );
+ expect(getRow(0).querySelectorAll('[role="cell"]').length).to.equal(5);
+ });
+
describe('Layout', () => {
before(function beforeHook() {
if (/jsdom/.test(window.navigator.userAgent)) { |
It looks like we need an API to further disable virtualization: #1781, For benchmark: https://www.ag-grid.com/javascript-grid/dom-virtualisation/#column-virtualisation. |
We just purchased an x-grid license and replaced our tables with x-grid and are seeing this too. Unfortunately this bug blocks us as half of our tests fail now with only 3 columns being rendered. Would love to know when a fix might be available! |
Hi there, is anyone able to confirm that this bug is being actively addressed? We currently have about half of our tests disabled which is less than ideal! |
The solution is being discussed here |
This comment has been minimized.
This comment has been minimized.
@m4theushw we should be able to close this issue right ? |
Closed via #2326 In the next release, we will have a |
Current Behavior 😯
With the inclusion of #1361, jsdom appears to only be partially rendering columns. The first two (with checkbox) columns within the array are being rendered, while the rest are hidden.
Expected Behavior 🤔
All columns should be rendered and visible.
Steps to Reproduce 🕹
Repo here.
Instructions can be found here.
Context 🔦
Since not all columns are rendered, I can't test secondary actions (my table actions) nor can I achieve full columns coverage.
Your Environment 🌎
`npx @material-ui/envinfo`
The text was updated successfully, but these errors were encountered: