@linzjs/step-ag-grid 17.4.5 → 17.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@linzjs/step-ag-grid",
3
3
  "repository": "github:linz/step-ag-grid.git",
4
4
  "license": "MIT",
5
- "version": "17.4.5",
5
+ "version": "17.4.6",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -1,4 +1,4 @@
1
- import { waitFor, within } from "@testing-library/react";
1
+ import { act, waitFor, within } from "@testing-library/react";
2
2
  import userEvent from "@testing-library/user-event";
3
3
  import { isEqual } from "lodash-es";
4
4
 
@@ -21,7 +21,25 @@ export const findRow = async (rowId: number | string, within?: HTMLElement): Pro
21
21
  await waitFor(async () => {
22
22
  expect(getAllQuick({ classes: ".ag-row" }).length > 0).toBe(true);
23
23
  });
24
- return await findQuick<HTMLDivElement>({ tagName: `div[row-id='${rowId}']:not(:empty)` }, within);
24
+ //if this is not wrapped in an act console errors are logged during testing
25
+ let row!: HTMLDivElement;
26
+ await act(async () => {
27
+ row = await findQuick<HTMLDivElement>(
28
+ { tagName: `.ag-center-cols-container div[row-id='${rowId}']:not(:empty)` },
29
+ within,
30
+ );
31
+ const leftCols = await findQuick<HTMLDivElement>(
32
+ { tagName: `.ag-pinned-left-cols-container div[row-id='${rowId}']` },
33
+ within,
34
+ );
35
+ const rightCols = await findQuick<HTMLDivElement>(
36
+ { tagName: `.ag-pinned-right-cols-container div[row-id='${rowId}']` },
37
+ within,
38
+ );
39
+ const combineChildren = [...leftCols.children, ...row.children, ...rightCols.children];
40
+ row.replaceChildren(...combineChildren);
41
+ });
42
+ return row;
25
43
  };
26
44
 
27
45
  export const queryRow = async (rowId: number | string, within?: HTMLElement): Promise<HTMLDivElement | null> => {