From 9389e1d01a29d584bfc61e07af5b567e9815b194 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Mon, 1 Mar 2021 13:04:20 -0700 Subject: [PATCH] Update datagrid's jest environment rendering to render all cells --- .../datagrid/__snapshots__/data_grid.test.tsx.snap | 8 ++++---- src/components/datagrid/data_grid.test.tsx | 1 + src/components/datagrid/data_grid_body.tsx | 8 ++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap b/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap index a89cd309577..040f914cf9b 100644 --- a/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap +++ b/src/components/datagrid/__snapshots__/data_grid.test.tsx.snap @@ -1051,7 +1051,7 @@ Array [ >
{ "euiDataGridRowCell euiDataGridRowCell--datetime", "euiDataGridRowCell euiDataGridRowCell--datetime", "euiDataGridRowCell euiDataGridRowCell--datetime", + "euiDataGridRowCell euiDataGridRowCell--datetime euiDataGridRowCell--lastColumn", ] `); }); diff --git a/src/components/datagrid/data_grid_body.tsx b/src/components/datagrid/data_grid_body.tsx index 5bccf9984d6..8dd2cce86de 100644 --- a/src/components/datagrid/data_grid_body.tsx +++ b/src/components/datagrid/data_grid_body.tsx @@ -560,8 +560,12 @@ export const EuiDataGridBody: FunctionComponent = ( } }, [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;