@linzjs/step-ag-grid 7.18.0 → 7.19.1
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
|
@@ -13,7 +13,9 @@ export const GridPopoverMenu = <RowType extends GridBaseRow>(
|
|
|
13
13
|
): ColDefT<RowType> =>
|
|
14
14
|
GridCell<RowType, GridFormPopoutMenuProps<RowType>>(
|
|
15
15
|
{
|
|
16
|
+
minWidth: 40,
|
|
16
17
|
maxWidth: 40,
|
|
18
|
+
width: 40,
|
|
17
19
|
editable: colDef.editable != null ? colDef.editable : true,
|
|
18
20
|
cellStyle: { justifyContent: "center" },
|
|
19
21
|
cellRenderer: GridRenderPopoutMenuCell,
|
package/src/utils/testUtil.ts
CHANGED
|
@@ -73,7 +73,7 @@ export const editCell = async (rowId: number | string, colId: string, within?: H
|
|
|
73
73
|
const cell = await findCell(rowId, colId, within);
|
|
74
74
|
userEvent.dblClick(cell);
|
|
75
75
|
});
|
|
76
|
-
await waitFor(
|
|
76
|
+
await waitFor(findOpenPopover);
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
export const isCellReadOnly = async (rowId: number | string, colId: string, within?: HTMLElement): Promise<boolean> => {
|
|
@@ -81,10 +81,10 @@ export const isCellReadOnly = async (rowId: number | string, colId: string, with
|
|
|
81
81
|
return cell.className.includes("GridCell-readonly");
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
const
|
|
84
|
+
export const findOpenPopover = async (): Promise<HTMLElement> => findQuick({ classes: ".szh-menu--state-open" });
|
|
85
85
|
|
|
86
86
|
export const queryMenuOption = async (menuOptionText: string | RegExp): Promise<HTMLElement | null> => {
|
|
87
|
-
const openMenu = await
|
|
87
|
+
const openMenu = await findOpenPopover();
|
|
88
88
|
const els = await within(openMenu).findAllByRole("menuitem");
|
|
89
89
|
const matcher = getMatcher(menuOptionText);
|
|
90
90
|
const result = els.find(matcher);
|
|
@@ -110,7 +110,7 @@ export const validateMenuOptions = async (
|
|
|
110
110
|
expectedMenuOptions: Array<string>,
|
|
111
111
|
): Promise<boolean> => {
|
|
112
112
|
await editCell(rowId, colId);
|
|
113
|
-
const openMenu = await
|
|
113
|
+
const openMenu = await findOpenPopover();
|
|
114
114
|
const actualOptions = (await within(openMenu).findAllByRole("menuitem")).map((menuItem) => menuItem.textContent);
|
|
115
115
|
return isEqual(actualOptions, expectedMenuOptions);
|
|
116
116
|
};
|
|
@@ -143,7 +143,7 @@ export const openAndFindMenuOption = async (
|
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
export const getMultiSelectOptions = async () => {
|
|
146
|
-
const openMenu = await
|
|
146
|
+
const openMenu = await findOpenPopover();
|
|
147
147
|
return getAllQuick<HTMLInputElement>({ role: "menuitem", child: { tagName: "input,textarea" } }, openMenu).map(
|
|
148
148
|
(input) => {
|
|
149
149
|
return {
|
|
@@ -155,7 +155,7 @@ export const getMultiSelectOptions = async () => {
|
|
|
155
155
|
};
|
|
156
156
|
|
|
157
157
|
export const findMultiSelectOption = async (value: string): Promise<HTMLElement> => {
|
|
158
|
-
const openMenu = await
|
|
158
|
+
const openMenu = await findOpenPopover();
|
|
159
159
|
return getQuick({ role: "menuitem", child: { tagName: `input[value='${value}']` } }, openMenu);
|
|
160
160
|
};
|
|
161
161
|
|
|
@@ -164,18 +164,16 @@ export const clickMultiSelectOption = async (value: string): Promise<void> => {
|
|
|
164
164
|
menuItem.parentElement && userEvent.click(menuItem.parentElement);
|
|
165
165
|
};
|
|
166
166
|
|
|
167
|
-
const typeInput = async (value: string, filter: IQueryQuick): Promise<void> =>
|
|
168
|
-
|
|
169
|
-
const openMenu = await
|
|
167
|
+
const typeInput = async (value: string, filter: IQueryQuick): Promise<void> =>
|
|
168
|
+
act(async () => {
|
|
169
|
+
const openMenu = await findOpenPopover();
|
|
170
170
|
const input = await findQuick(filter, openMenu);
|
|
171
171
|
userEvent.clear(input);
|
|
172
172
|
userEvent.type(input, value);
|
|
173
173
|
});
|
|
174
|
-
};
|
|
175
174
|
|
|
176
|
-
export const typeOnlyInput = async (value: string): Promise<void> =>
|
|
177
|
-
|
|
178
|
-
};
|
|
175
|
+
export const typeOnlyInput = async (value: string): Promise<void> =>
|
|
176
|
+
typeInput(value, { child: { tagName: "input[type='text'], textarea" } });
|
|
179
177
|
|
|
180
178
|
export const typeInputByLabel = async (value: string, labelText: string): Promise<void> => {
|
|
181
179
|
const labels = getAllQuick({ child: { tagName: "label" } }).filter((l) => l.textContent == labelText);
|
|
@@ -189,28 +187,24 @@ export const typeInputByLabel = async (value: string, labelText: string): Promis
|
|
|
189
187
|
await typeInput(value, { child: { tagName: `input[id='${inputId}'], textarea[id='${inputId}']` } });
|
|
190
188
|
};
|
|
191
189
|
|
|
192
|
-
export const typeInputByPlaceholder = async (value: string, placeholder: string): Promise<void> =>
|
|
193
|
-
|
|
190
|
+
export const typeInputByPlaceholder = async (value: string, placeholder: string): Promise<void> =>
|
|
191
|
+
typeInput(value, {
|
|
194
192
|
child: { tagName: `input[placeholder='${placeholder}'], textarea[placeholder='${placeholder}']` },
|
|
195
193
|
});
|
|
196
|
-
};
|
|
197
194
|
|
|
198
|
-
export const typeOtherInput = async (value: string): Promise<void> =>
|
|
199
|
-
|
|
200
|
-
};
|
|
195
|
+
export const typeOtherInput = async (value: string): Promise<void> =>
|
|
196
|
+
typeInput(value, { classes: ".subComponent", child: { tagName: "input[type='text']" } });
|
|
201
197
|
|
|
202
|
-
export const typeOtherTextArea = async (value: string): Promise<void> =>
|
|
203
|
-
|
|
204
|
-
};
|
|
198
|
+
export const typeOtherTextArea = async (value: string): Promise<void> =>
|
|
199
|
+
typeInput(value, { classes: ".subComponent", child: { tagName: "textarea" } });
|
|
205
200
|
|
|
206
|
-
export const closeMenu = (): void =>
|
|
207
|
-
|
|
208
|
-
};
|
|
201
|
+
export const closeMenu = (): void => userEvent.click(document.body);
|
|
202
|
+
export const closePopover = (): void => userEvent.click(document.body);
|
|
209
203
|
|
|
210
|
-
export const findActionButton = (text: string, container
|
|
204
|
+
export const findActionButton = (text: string, container?: HTMLElement): Promise<HTMLElement> =>
|
|
211
205
|
findQuick({ tagName: "button", child: { classes: ".ActionButton-minimalAreaDisplay", text: text } }, container);
|
|
212
206
|
|
|
213
|
-
export const clickActionButton = async (text: string, container
|
|
207
|
+
export const clickActionButton = async (text: string, container?: HTMLElement): Promise<void> => {
|
|
214
208
|
await act(async () => {
|
|
215
209
|
const button = await findActionButton(text, container);
|
|
216
210
|
userEvent.click(button);
|