@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/dist/src/utils/testUtil.d.ts +8 -0
- package/dist/step-ag-grid.cjs.js +13 -2
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +12 -3
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +1 -0
- package/src/contexts/GridContextProvider.tsx +2 -1
- package/src/utils/storybookTestUtil.ts +2 -3
- package/src/utils/testUtil.ts +10 -0
package/package.json
CHANGED
|
@@ -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
|
-
|
|
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 =
|
|
5
|
-
|
|
6
|
-
};
|
|
4
|
+
export const waitForGridReady = ({ canvasElement }: { canvasElement: HTMLElement }) =>
|
|
5
|
+
waitFor(() => expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument(), { timeout: 5000 });
|
package/src/utils/testUtil.ts
CHANGED
|
@@ -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
|
+
});
|