Skip to content

Commit

Permalink
Update datagrid's jest environment rendering to render all cells (#4589)
Browse files Browse the repository at this point in the history
  • Loading branch information
chandlerprall authored Mar 2, 2021
1 parent 6c005f4 commit 0545480
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
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 @@ -1011,7 +1011,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 @@ -1346,7 +1346,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 @@ -1978,7 +1978,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 @@ -2312,7 +2312,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

0 comments on commit 0545480

Please sign in to comment.