Skip to content

Commit

Permalink
FIX failing tests by using suppressColumnVirtualisation - https://sta…
Browse files Browse the repository at this point in the history
  • Loading branch information
olore committed Nov 8, 2020
1 parent 615a6e3 commit 07357b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ describe("the tests", () => {
const { getByText } = render(<GridExample />);
expect(getByText("Make")).toBeInTheDocument(); // PASS
expect(getByText("Model")).toBeInTheDocument(); // PASS
expect(getByText("Price")).toBeInTheDocument(); // FAIL
expect(getByText("Color")).toBeInTheDocument(); // FAIL
expect(getByText("Price")).toBeInTheDocument(); // PASS
expect(getByText("Color")).toBeInTheDocument(); // PASS
});
});

Expand Down
6 changes: 2 additions & 4 deletions src/GridExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import 'ag-grid-community/dist/styles/ag-theme-alpine.css';

const GridExample = () => {

// NOTE: adding `cellRenderer: "agGroupCellRenderer",`
// to any field makes it not findable

return (

<div className="ag-theme-alpine" style={{ height: '300px', width: '800px' }}>
<AgGridReact
columnDefs={ /* First 2 always findable, others never */
suppressColumnVirtualisation={process.env.NODE_ENV === "test"}
columnDefs={
[
{ field: "make" },
{ field: "model" },
Expand Down

0 comments on commit 07357b6

Please sign in to comment.