Skip to content
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

[EuiDataGrid] Update jest environment rendering to include all cells #4589

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/datagrid/__snapshots__/data_grid.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ Array [
>
<div
class="euiDataGrid__virtualized"
style="position:relative;height:500px;width:500px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:transform;direction:ltr"
style="position:relative;height:9007199254740991px;width:9007199254740991px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:transform;direction:ltr"
>
<div
style="height:102px;width:200px"
Expand Down Expand Up @@ -1386,7 +1386,7 @@ Array [
>
<div
class="euiDataGrid__virtualized"
style="position:relative;height:500px;width:500px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:transform;direction:ltr"
style="position:relative;height:9007199254740991px;width:9007199254740991px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:transform;direction:ltr"
>
<div
style="height:102px;width:300px"
Expand Down Expand Up @@ -2018,7 +2018,7 @@ Array [
>
<div
class="euiDataGrid__virtualized"
style="position:relative;height:500px;width:500px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:transform;direction:ltr"
style="position:relative;height:9007199254740991px;width:9007199254740991px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:transform;direction:ltr"
>
<div
style="height:102px;width:200px"
Expand Down Expand Up @@ -2352,7 +2352,7 @@ Array [
>
<div
class="euiDataGrid__virtualized"
style="position:relative;height:500px;width:500px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:transform;direction:ltr"
style="position:relative;height:9007199254740991px;width:9007199254740991px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:transform;direction:ltr"
>
<div
style="height:102px;width:200px"
Expand Down
1 change: 1 addition & 0 deletions src/components/datagrid/data_grid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ describe('EuiDataGrid', () => {
"euiDataGridRowCell euiDataGridRowCell--datetime",
"euiDataGridRowCell euiDataGridRowCell--datetime",
"euiDataGridRowCell euiDataGridRowCell--datetime",
"euiDataGridRowCell euiDataGridRowCell--datetime euiDataGridRowCell--lastColumn",
]
`);
});
Expand Down
8 changes: 6 additions & 2 deletions src/components/datagrid/data_grid_body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,12 @@ export const EuiDataGridBody: FunctionComponent<EuiDataGridBodyProps> = (
}
}, [wrapperRef]);

let finalHeight = IS_JEST_ENVIRONMENT ? 500 : height || unconstrainedHeight;
let finalWidth = IS_JEST_ENVIRONMENT ? 500 : width || unconstrainedWidth;
let finalHeight = IS_JEST_ENVIRONMENT
? Number.MAX_SAFE_INTEGER
: height || unconstrainedHeight;
let finalWidth = IS_JEST_ENVIRONMENT
? Number.MAX_SAFE_INTEGER
: width || unconstrainedWidth;
if (isFullScreen) {
finalHeight =
window.innerHeight - toolbarHeight - headerRowHeight - footerRowHeight;
Expand Down