@linzjs/step-ag-grid 17.0.1 → 17.0.3
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/README.md +1 -1
- package/dist/GridTheme.scss +2 -2
- package/dist/src/utils/storybookTestUtil.d.ts +3 -0
- package/dist/src/utils/testUtil.d.ts +8 -0
- package/dist/step-ag-grid.cjs.js +18 -8
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +17 -9
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +2 -2
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +1 -0
- package/src/contexts/GridContextProvider.tsx +11 -10
- package/src/stories/grid/GridFilterButtons.stories.tsx +2 -7
- package/src/stories/grid/GridNonEditableRow.stories.tsx +4 -12
- package/src/stories/grid/GridPopoutContextMenu.stories.tsx +2 -7
- package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +2 -7
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +2 -7
- package/src/stories/grid/GridPopoverEditBearing.stories.tsx +2 -7
- package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +3 -7
- package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +2 -7
- package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +2 -7
- package/src/stories/grid/GridReadOnly.stories.tsx +2 -7
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +2 -3
- package/src/styles/GridTheme.scss +2 -2
- package/src/utils/storybookTestUtil.ts +5 -0
- package/src/utils/testUtil.ts +10 -0
package/package.json
CHANGED
package/src/components/Grid.tsx
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" },
|
|
@@ -193,7 +193,7 @@ export const GridContextProvider = <RowType extends GridBaseRow>(props: PropsWit
|
|
|
193
193
|
(
|
|
194
194
|
filterDef: keyof ColDef | ((r: ColDef) => boolean | undefined | null | number | string) = () => true,
|
|
195
195
|
): ColDefT<RowType>[] =>
|
|
196
|
-
filter(columnApi?.
|
|
196
|
+
filter(columnApi?.getColumns()?.map((col) => col.getColDef()) ?? [], filterDef) as ColDefT<RowType>[],
|
|
197
197
|
[columnApi],
|
|
198
198
|
);
|
|
199
199
|
|
|
@@ -589,15 +589,16 @@ export const GridContextProvider = <RowType extends GridBaseRow>(props: PropsWit
|
|
|
589
589
|
[gridApiOp, modifyUpdating, selectNextEditableCell],
|
|
590
590
|
);
|
|
591
591
|
|
|
592
|
-
const redrawRows =
|
|
593
|
-
(
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
592
|
+
const redrawRows = useMemo(
|
|
593
|
+
() =>
|
|
594
|
+
debounce((rowNodes?: IRowNode[]) => {
|
|
595
|
+
try {
|
|
596
|
+
gridApi && gridApi.redrawRows(rowNodes ? { rowNodes } : undefined);
|
|
597
|
+
} catch (ex) {
|
|
598
|
+
// Hide errors in jest, but log them in browser
|
|
599
|
+
if (typeof jest === "undefined") console.error(ex);
|
|
600
|
+
}
|
|
601
|
+
}, 50),
|
|
601
602
|
[gridApi],
|
|
602
603
|
);
|
|
603
604
|
|
|
@@ -2,9 +2,7 @@ import "../../styles/GridTheme.scss";
|
|
|
2
2
|
import "../../styles/index.scss";
|
|
3
3
|
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
4
|
|
|
5
|
-
import { expect } from "@storybook/jest";
|
|
6
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { waitFor } from "@storybook/testing-library";
|
|
8
6
|
import { useMemo, useState } from "react";
|
|
9
7
|
|
|
10
8
|
import "@linzjs/lui/dist/fonts";
|
|
@@ -21,6 +19,7 @@ import {
|
|
|
21
19
|
GridUpdatingContextProvider,
|
|
22
20
|
GridWrapper,
|
|
23
21
|
} from "../..";
|
|
22
|
+
import { waitForGridReady } from "../../utils/storybookTestUtil";
|
|
24
23
|
|
|
25
24
|
export default {
|
|
26
25
|
title: "Components / Grids",
|
|
@@ -106,8 +105,4 @@ const GridFilterButtonsTemplate: ComponentStory<typeof Grid> = (props: GridProps
|
|
|
106
105
|
};
|
|
107
106
|
|
|
108
107
|
export const _FilterButtonsExample = GridFilterButtonsTemplate.bind({});
|
|
109
|
-
_FilterButtonsExample.play =
|
|
110
|
-
await waitFor(() => {
|
|
111
|
-
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
112
|
-
});
|
|
113
|
-
};
|
|
108
|
+
_FilterButtonsExample.play = waitForGridReady;
|
|
@@ -2,9 +2,7 @@ import "../../styles/GridTheme.scss";
|
|
|
2
2
|
import "../../styles/index.scss";
|
|
3
3
|
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
4
|
|
|
5
|
-
import { expect } from "@storybook/jest";
|
|
6
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { waitFor } from "@storybook/testing-library";
|
|
8
6
|
import { ColDef } from "ag-grid-community";
|
|
9
7
|
import { GridPopoverEditDropDown } from "components/gridPopoverEdit/GridPopoverEditDropDown";
|
|
10
8
|
import { GridPopoverTextArea } from "components/gridPopoverEdit/GridPopoverTextArea";
|
|
@@ -25,16 +23,15 @@ import {
|
|
|
25
23
|
MenuOption,
|
|
26
24
|
wait,
|
|
27
25
|
} from "../..";
|
|
26
|
+
import { waitForGridReady } from "../../utils/storybookTestUtil";
|
|
28
27
|
|
|
29
28
|
export default {
|
|
30
29
|
title: "Components / Grids",
|
|
31
30
|
component: Grid,
|
|
32
31
|
args: {
|
|
33
|
-
|
|
34
|
-
quickFilterValue: "",
|
|
35
|
-
quickFilterPlaceholder: "Quick filter...",
|
|
36
|
-
selectable: false,
|
|
32
|
+
selectable: true,
|
|
37
33
|
rowSelection: "single",
|
|
34
|
+
autoSelectFirstRow: true,
|
|
38
35
|
},
|
|
39
36
|
decorators: [
|
|
40
37
|
(Story) => (
|
|
@@ -179,9 +176,4 @@ const GridNonEditableRowTemplate: ComponentStory<typeof Grid> = (props: GridProp
|
|
|
179
176
|
};
|
|
180
177
|
|
|
181
178
|
export const _NonEditableRow = GridNonEditableRowTemplate.bind({});
|
|
182
|
-
_NonEditableRow.
|
|
183
|
-
_NonEditableRow.play = async ({ canvasElement }) => {
|
|
184
|
-
await waitFor(() => {
|
|
185
|
-
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
186
|
-
});
|
|
187
|
-
};
|
|
179
|
+
_NonEditableRow.play = waitForGridReady;
|
|
@@ -2,9 +2,7 @@ import "../../styles/GridTheme.scss";
|
|
|
2
2
|
import "../../styles/index.scss";
|
|
3
3
|
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
4
|
|
|
5
|
-
import { expect } from "@storybook/jest";
|
|
6
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { waitFor } from "@storybook/testing-library";
|
|
8
6
|
import { ReactElement, useCallback, useContext, useMemo, useState } from "react";
|
|
9
7
|
|
|
10
8
|
import "@linzjs/lui/dist/fonts";
|
|
@@ -22,6 +20,7 @@ import {
|
|
|
22
20
|
MenuItem,
|
|
23
21
|
wait,
|
|
24
22
|
} from "../..";
|
|
23
|
+
import { waitForGridReady } from "../../utils/storybookTestUtil";
|
|
25
24
|
import { IFormTestRow } from "./FormTest";
|
|
26
25
|
|
|
27
26
|
export default {
|
|
@@ -137,8 +136,4 @@ const GridPopoutContextMenuTemplate: ComponentStory<typeof Grid> = (props: GridP
|
|
|
137
136
|
};
|
|
138
137
|
|
|
139
138
|
export const _EditContextMenu = GridPopoutContextMenuTemplate.bind({});
|
|
140
|
-
_EditContextMenu.play =
|
|
141
|
-
await waitFor(() => {
|
|
142
|
-
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
143
|
-
});
|
|
144
|
-
};
|
|
139
|
+
_EditContextMenu.play = waitForGridReady;
|
|
@@ -2,14 +2,13 @@ import "../../styles/GridTheme.scss";
|
|
|
2
2
|
import "../../styles/index.scss";
|
|
3
3
|
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
4
|
|
|
5
|
-
import { expect } from "@storybook/jest";
|
|
6
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { waitFor } from "@storybook/testing-library";
|
|
8
6
|
import { useMemo, useState } from "react";
|
|
9
7
|
|
|
10
8
|
import "@linzjs/lui/dist/fonts";
|
|
11
9
|
|
|
12
10
|
import { ColDefT, Grid, GridCell, GridContextProvider, GridProps, GridUpdatingContextProvider } from "../..";
|
|
11
|
+
import { waitForGridReady } from "../../utils/storybookTestUtil";
|
|
13
12
|
import { FormTest, IFormTestRow } from "./FormTest";
|
|
14
13
|
|
|
15
14
|
export default {
|
|
@@ -73,8 +72,4 @@ const GridPopoutEditGenericTemplate: ComponentStory<typeof Grid> = (props: GridP
|
|
|
73
72
|
};
|
|
74
73
|
|
|
75
74
|
export const _EditGeneric = GridPopoutEditGenericTemplate.bind({});
|
|
76
|
-
_EditGeneric.play =
|
|
77
|
-
await waitFor(() => {
|
|
78
|
-
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
79
|
-
});
|
|
80
|
-
};
|
|
75
|
+
_EditGeneric.play = waitForGridReady;
|
|
@@ -2,9 +2,7 @@ import "../../styles/GridTheme.scss";
|
|
|
2
2
|
import "../../styles/index.scss";
|
|
3
3
|
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
4
|
|
|
5
|
-
import { expect } from "@storybook/jest";
|
|
6
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { waitFor } from "@storybook/testing-library";
|
|
8
6
|
import { useCallback, useContext, useMemo, useState } from "react";
|
|
9
7
|
|
|
10
8
|
import "@linzjs/lui/dist/fonts";
|
|
@@ -28,6 +26,7 @@ import {
|
|
|
28
26
|
isFloat,
|
|
29
27
|
wait,
|
|
30
28
|
} from "../..";
|
|
29
|
+
import { waitForGridReady } from "../../utils/storybookTestUtil";
|
|
31
30
|
import { IFormTestRow } from "./FormTest";
|
|
32
31
|
|
|
33
32
|
export default {
|
|
@@ -228,8 +227,4 @@ const GridPopoutEditGenericTemplate: ComponentStory<typeof Grid> = (props: GridP
|
|
|
228
227
|
};
|
|
229
228
|
|
|
230
229
|
export const _EditGenericTextArea = GridPopoutEditGenericTemplate.bind({});
|
|
231
|
-
_EditGenericTextArea.play =
|
|
232
|
-
await waitFor(() => {
|
|
233
|
-
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
234
|
-
});
|
|
235
|
-
};
|
|
230
|
+
_EditGenericTextArea.play = waitForGridReady;
|
|
@@ -2,9 +2,7 @@ import "../../styles/GridTheme.scss";
|
|
|
2
2
|
import "../../styles/index.scss";
|
|
3
3
|
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
4
|
|
|
5
|
-
import { expect } from "@storybook/jest";
|
|
6
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { waitFor } from "@storybook/testing-library";
|
|
8
6
|
import { useMemo, useState } from "react";
|
|
9
7
|
|
|
10
8
|
import "@linzjs/lui/dist/fonts";
|
|
@@ -25,6 +23,7 @@ import {
|
|
|
25
23
|
GridWrapper,
|
|
26
24
|
wait,
|
|
27
25
|
} from "../..";
|
|
26
|
+
import { waitForGridReady } from "../../utils/storybookTestUtil";
|
|
28
27
|
|
|
29
28
|
export default {
|
|
30
29
|
title: "Components / Grids",
|
|
@@ -124,8 +123,4 @@ const GridPopoverEditBearingTemplate: ComponentStory<typeof Grid> = (props: Grid
|
|
|
124
123
|
};
|
|
125
124
|
|
|
126
125
|
export const _GridPopoverEditBearing = GridPopoverEditBearingTemplate.bind({});
|
|
127
|
-
_GridPopoverEditBearing.play =
|
|
128
|
-
await waitFor(() => {
|
|
129
|
-
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
130
|
-
});
|
|
131
|
-
};
|
|
126
|
+
_GridPopoverEditBearing.play = waitForGridReady;
|
|
@@ -2,9 +2,7 @@ import "../../styles/GridTheme.scss";
|
|
|
2
2
|
import "../../styles/index.scss";
|
|
3
3
|
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
4
|
|
|
5
|
-
import { expect } from "@storybook/jest";
|
|
6
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { waitFor } from "@storybook/testing-library";
|
|
8
6
|
import { useCallback, useMemo, useState } from "react";
|
|
9
7
|
|
|
10
8
|
import "@linzjs/lui/dist/fonts";
|
|
@@ -30,6 +28,7 @@ import {
|
|
|
30
28
|
MenuSeparatorString,
|
|
31
29
|
wait,
|
|
32
30
|
} from "../..";
|
|
31
|
+
import { waitForGridReady } from "../../utils/storybookTestUtil";
|
|
33
32
|
|
|
34
33
|
export default {
|
|
35
34
|
title: "Components / Grids",
|
|
@@ -156,6 +155,7 @@ const GridEditDropDownTemplate: ComponentStory<typeof Grid> = (props: GridProps)
|
|
|
156
155
|
),
|
|
157
156
|
GridPopoverEditDropDown(
|
|
158
157
|
{
|
|
158
|
+
colId: "position3filtered",
|
|
159
159
|
field: "position3",
|
|
160
160
|
headerName: "Filtered",
|
|
161
161
|
editable: false,
|
|
@@ -316,8 +316,4 @@ const GridEditDropDownTemplate: ComponentStory<typeof Grid> = (props: GridProps)
|
|
|
316
316
|
};
|
|
317
317
|
|
|
318
318
|
export const EditDropdown = GridEditDropDownTemplate.bind({});
|
|
319
|
-
EditDropdown.play =
|
|
320
|
-
await waitFor(() => {
|
|
321
|
-
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
322
|
-
});
|
|
323
|
-
};
|
|
319
|
+
EditDropdown.play = waitForGridReady;
|
|
@@ -2,9 +2,7 @@ import "../../styles/GridTheme.scss";
|
|
|
2
2
|
import "../../styles/index.scss";
|
|
3
3
|
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
4
|
|
|
5
|
-
import { expect } from "@storybook/jest";
|
|
6
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { waitFor } from "@storybook/testing-library";
|
|
8
6
|
import { isEmpty, partition } from "lodash-es";
|
|
9
7
|
import { useMemo, useState } from "react";
|
|
10
8
|
|
|
@@ -23,6 +21,7 @@ import {
|
|
|
23
21
|
MultiSelectOption,
|
|
24
22
|
wait,
|
|
25
23
|
} from "../..";
|
|
24
|
+
import { waitForGridReady } from "../../utils/storybookTestUtil";
|
|
26
25
|
|
|
27
26
|
export default {
|
|
28
27
|
title: "Components / Grids",
|
|
@@ -196,8 +195,4 @@ const GridEditMultiSelectTemplate: ComponentStory<typeof Grid> = (props: GridPro
|
|
|
196
195
|
};
|
|
197
196
|
|
|
198
197
|
export const EditMultiSelect = GridEditMultiSelectTemplate.bind({});
|
|
199
|
-
EditMultiSelect.play =
|
|
200
|
-
await waitFor(() => {
|
|
201
|
-
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
202
|
-
});
|
|
203
|
-
};
|
|
198
|
+
EditMultiSelect.play = waitForGridReady;
|
|
@@ -2,9 +2,7 @@ import "../../styles/GridTheme.scss";
|
|
|
2
2
|
import "../../styles/index.scss";
|
|
3
3
|
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
4
|
|
|
5
|
-
import { expect } from "@storybook/jest";
|
|
6
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { waitFor } from "@storybook/testing-library";
|
|
8
6
|
import { countBy, mergeWith, pull, range, union } from "lodash-es";
|
|
9
7
|
import { useMemo, useState } from "react";
|
|
10
8
|
|
|
@@ -13,6 +11,7 @@ import "@linzjs/lui/dist/fonts";
|
|
|
13
11
|
import { ColDefT, Grid, GridCell, GridContextProvider, GridProps, GridUpdatingContextProvider } from "../..";
|
|
14
12
|
import { MultiSelectGridOption } from "../../components/gridForm/GridFormMultiSelectGrid";
|
|
15
13
|
import { GridPopoutEditMultiSelectGrid } from "../../components/gridPopoverEdit/GridPopoutEditMultiSelectGrid";
|
|
14
|
+
import { waitForGridReady } from "../../utils/storybookTestUtil";
|
|
16
15
|
import { EditMultiSelect } from "./GridPopoverEditMultiSelect.stories";
|
|
17
16
|
|
|
18
17
|
export default {
|
|
@@ -111,8 +110,4 @@ const GridEditMultiSelectGridTemplate: ComponentStory<typeof Grid> = (props: Gri
|
|
|
111
110
|
};
|
|
112
111
|
|
|
113
112
|
export const EditMultiSelectGrid = GridEditMultiSelectGridTemplate.bind({});
|
|
114
|
-
EditMultiSelect.play =
|
|
115
|
-
await waitFor(() => {
|
|
116
|
-
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
117
|
-
});
|
|
118
|
-
};
|
|
113
|
+
EditMultiSelect.play = waitForGridReady;
|
|
@@ -2,9 +2,7 @@ import "../../styles/GridTheme.scss";
|
|
|
2
2
|
import "../../styles/index.scss";
|
|
3
3
|
import "@linzjs/lui/dist/scss/base.scss";
|
|
4
4
|
|
|
5
|
-
import { expect } from "@storybook/jest";
|
|
6
5
|
import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
|
|
7
|
-
import { waitFor } from "@storybook/testing-library";
|
|
8
6
|
import { ReactElement, useCallback, useMemo, useState } from "react";
|
|
9
7
|
|
|
10
8
|
import "@linzjs/lui/dist/fonts";
|
|
@@ -31,6 +29,7 @@ import {
|
|
|
31
29
|
import { GridFilterColumnsToggle } from "../../components";
|
|
32
30
|
import { GridFilterDownloadCsvButton } from "../../components";
|
|
33
31
|
import { GridCellFiller } from "../../components/GridCellFiller";
|
|
32
|
+
import { waitForGridReady } from "../../utils/storybookTestUtil";
|
|
34
33
|
|
|
35
34
|
export default {
|
|
36
35
|
title: "Components / Grids",
|
|
@@ -280,8 +279,4 @@ const GridFilterLessThan = (props: { field: keyof ITestRow; text: string }): Rea
|
|
|
280
279
|
};
|
|
281
280
|
|
|
282
281
|
export const ReadOnlySingleSelection = GridReadOnlyTemplate.bind({});
|
|
283
|
-
ReadOnlySingleSelection.play =
|
|
284
|
-
await waitFor(() => {
|
|
285
|
-
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
286
|
-
});
|
|
287
|
-
};
|
|
282
|
+
ReadOnlySingleSelection.play = waitForGridReady;
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
MenuOption,
|
|
25
25
|
wait,
|
|
26
26
|
} from "../../../";
|
|
27
|
+
import { waitForGridReady } from "../../../utils/storybookTestUtil";
|
|
27
28
|
|
|
28
29
|
export default {
|
|
29
30
|
title: "Components / Grids",
|
|
@@ -225,9 +226,7 @@ GridKeyboardInteractions.play = async ({ canvasElement }) => {
|
|
|
225
226
|
multiEditAction.mockReset();
|
|
226
227
|
eAction.mockReset();
|
|
227
228
|
|
|
228
|
-
await
|
|
229
|
-
expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument();
|
|
230
|
-
});
|
|
229
|
+
await waitForGridReady({ canvasElement });
|
|
231
230
|
|
|
232
231
|
// Ensure first row/cell is selected on render
|
|
233
232
|
await waitFor(async () => {
|
|
@@ -81,7 +81,7 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
.ag-header .ag-header-cell[aria-colindex="1"] {
|
|
84
|
-
padding-left:
|
|
84
|
+
padding-left: 17px;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
.ag-cell[role="gridcell"] {
|
|
@@ -90,7 +90,7 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.ag-cell[aria-colindex="1"] {
|
|
93
|
-
border-left:
|
|
93
|
+
border-left: 1px solid transparent;
|
|
94
94
|
padding-left: lui.$unit-rg;
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { expect } from "@storybook/jest";
|
|
2
|
+
import { waitFor } from "@storybook/testing-library";
|
|
3
|
+
|
|
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 ({ grid, timeout = 5000 }: { grid?: HTMLElement; timeout: number }) =>
|
|
220
|
+
waitFor(() => expect(getAllQuick({ classes: ".Grid-ready" }, grid)).toBeInTheDocument(), {
|
|
221
|
+
timeout,
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
export const waitForGridRows = async ({ grid, timeout = 5000 }: { grid?: HTMLElement; timeout: number }) =>
|
|
225
|
+
waitFor(async () => expect(getAllQuick({ classes: ".ag-row" }, grid).length > 0).toBe(true), {
|
|
226
|
+
timeout,
|
|
227
|
+
});
|