@linzjs/step-ag-grid 17.0.2 → 17.0.4

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.0.2",
5
+ "version": "17.0.4",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -16,6 +16,7 @@ export const GridPopoverMenu = <RowType extends GridBaseRow>(
16
16
  minWidth: 48,
17
17
  maxWidth: 48,
18
18
  width: 40,
19
+ sortable: false,
19
20
  editable: colDef.editable != null ? colDef.editable : true,
20
21
  exportable: false,
21
22
  cellStyle: { flex: 1, justifyContent: "center" },
@@ -595,7 +595,8 @@ export const GridContextProvider = <RowType extends GridBaseRow>(props: PropsWit
595
595
  try {
596
596
  gridApi && gridApi.redrawRows(rowNodes ? { rowNodes } : undefined);
597
597
  } catch (ex) {
598
- console.error(ex);
598
+ // Hide errors in jest, but log them in browser
599
+ if (typeof jest === "undefined") console.error(ex);
599
600
  }
600
601
  }, 50),
601
602
  [gridApi],
@@ -1,6 +1,5 @@
1
1
  import { expect } from "@storybook/jest";
2
2
  import { waitFor } from "@storybook/testing-library";
3
3
 
4
- export const waitForGridReady = async ({ canvasElement }: { canvasElement: HTMLElement }) => {
5
- await waitFor(() => expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument(), { timeout: 5000 });
6
- };
4
+ export const waitForGridReady = ({ canvasElement }: { canvasElement: HTMLElement }) =>
5
+ waitFor(() => expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument(), { timeout: 5000 });
@@ -215,3 +215,13 @@ export const clickActionButton = async (text: string, container?: HTMLElement):
215
215
  const button = await findActionButton(text, container);
216
216
  await user.click(button);
217
217
  };
218
+
219
+ export const waitForGridReady = async (props?: { grid?: HTMLElement; timeout: number }) =>
220
+ waitFor(() => expect(getAllQuick({ classes: ".Grid-ready" }, props?.grid)).toBeInTheDocument(), {
221
+ timeout: props?.timeout ?? 5000,
222
+ });
223
+
224
+ export const waitForGridRows = async (props?: { grid?: HTMLElement; timeout: number }) =>
225
+ waitFor(async () => expect(getAllQuick({ classes: ".ag-row" }, props?.grid).length > 0).toBe(true), {
226
+ timeout: props?.timeout ?? 5000,
227
+ });