@linzjs/step-ag-grid 28.1.1 → 28.2.0

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 CHANGED
@@ -278,4 +278,4 @@ This will throw an exception if the row id is not found.
278
278
 
279
279
  ```tsx
280
280
  window.__stepAgGrid.grids[dataTestId].scrollRowIntoViewById("1000")
281
- ```
281
+ ```
@@ -135,8 +135,13 @@ export const findCellContains = async (
135
135
  };
136
136
 
137
137
  export const selectCell = async (rowId: string | number, colId: string, within?: HTMLElement): Promise<void> => {
138
- const cell = await findCell(rowId, colId, within);
139
- await user.click(cell);
138
+ await waitFor(
139
+ async () => {
140
+ const cell = await findCell(rowId, colId, within);
141
+ await user.click(cell);
142
+ },
143
+ { timeout: 10000 },
144
+ );
140
145
  };
141
146
 
142
147
  export const editCell = async (rowId: number | string, colId: string, within?: HTMLElement): Promise<void> => {
@@ -178,7 +183,7 @@ export const findMenuOption = async (menuOptionText: string | RegExp): Promise<H
178
183
  );
179
184
  };
180
185
 
181
- export const validateMenuOptions = async (
186
+ export const editValidateMenuOptions = async (
182
187
  rowId: number | string,
183
188
  colId: string,
184
189
  expectedMenuOptions: Array<string>,
@@ -189,12 +194,23 @@ export const validateMenuOptions = async (
189
194
  return isEqual(actualOptions, expectedMenuOptions);
190
195
  };
191
196
 
197
+ export const validateMenuOptions = async (
198
+ rowId: number | string,
199
+ colId: string,
200
+ expectedMenuOptions: Array<string>,
201
+ ): Promise<boolean> => {
202
+ await selectCell(rowId, colId);
203
+ const openMenu = await findOpenPopover();
204
+ const actualOptions = (await within(openMenu).findAllByRole('menuitem')).map((menuItem) => menuItem.textContent);
205
+ return isEqual(actualOptions, expectedMenuOptions);
206
+ };
207
+
192
208
  export const clickMenuOption = async (menuOptionText: string | RegExp): Promise<void> => {
193
209
  const menuOption = await findMenuOption(menuOptionText);
194
210
  await user.click(menuOption);
195
211
  };
196
212
 
197
- export const openAndClickMenuOption = async (
213
+ export const editAndClickMenuOption = async (
198
214
  rowId: number | string,
199
215
  colId: string,
200
216
  menuOptionText: string | RegExp,
@@ -204,13 +220,23 @@ export const openAndClickMenuOption = async (
204
220
  await clickMenuOption(menuOptionText);
205
221
  };
206
222
 
223
+ export const openAndClickMenuOption = async (
224
+ rowId: number | string,
225
+ colId: string,
226
+ menuOptionText: string | RegExp,
227
+ within?: HTMLElement,
228
+ ): Promise<void> => {
229
+ await selectCell(rowId, colId, within);
230
+ await clickMenuOption(menuOptionText);
231
+ };
232
+
207
233
  export const openAndFindMenuOption = async (
208
234
  rowId: number | string,
209
235
  colId: string,
210
236
  menuOptionText: string | RegExp,
211
237
  within?: HTMLElement,
212
238
  ): Promise<HTMLElement> => {
213
- await editCell(rowId, colId, within);
239
+ await selectCell(rowId, colId, within);
214
240
  return await findMenuOption(menuOptionText);
215
241
  };
216
242
 
@@ -136,8 +136,13 @@ export const findCellContains = async (
136
136
  };
137
137
 
138
138
  export const selectCell = async (rowId: string | number, colId: string, within?: HTMLElement): Promise<void> => {
139
- const cell = await findCell(rowId, colId, within);
140
- await user.click(cell);
139
+ await waitFor(
140
+ async () => {
141
+ const cell = await findCell(rowId, colId, within);
142
+ await user.click(cell);
143
+ },
144
+ { timeout: 10000 },
145
+ );
141
146
  };
142
147
 
143
148
  export const editCell = async (rowId: number | string, colId: string, within?: HTMLElement): Promise<void> => {
@@ -179,7 +184,7 @@ export const findMenuOption = async (menuOptionText: string | RegExp): Promise<H
179
184
  );
180
185
  };
181
186
 
182
- export const validateMenuOptions = async (
187
+ export const editValidateMenuOptions = async (
183
188
  rowId: number | string,
184
189
  colId: string,
185
190
  expectedMenuOptions: Array<string>,
@@ -190,12 +195,23 @@ export const validateMenuOptions = async (
190
195
  return isEqual(actualOptions, expectedMenuOptions);
191
196
  };
192
197
 
198
+ export const validateMenuOptions = async (
199
+ rowId: number | string,
200
+ colId: string,
201
+ expectedMenuOptions: Array<string>,
202
+ ): Promise<boolean> => {
203
+ await selectCell(rowId, colId);
204
+ const openMenu = await findOpenPopover();
205
+ const actualOptions = (await within(openMenu).findAllByRole('menuitem')).map((menuItem) => menuItem.textContent);
206
+ return isEqual(actualOptions, expectedMenuOptions);
207
+ };
208
+
193
209
  export const clickMenuOption = async (menuOptionText: string | RegExp): Promise<void> => {
194
210
  const menuOption = await findMenuOption(menuOptionText);
195
211
  await user.click(menuOption);
196
212
  };
197
213
 
198
- export const openAndClickMenuOption = async (
214
+ export const editAndClickMenuOption = async (
199
215
  rowId: number | string,
200
216
  colId: string,
201
217
  menuOptionText: string | RegExp,
@@ -205,13 +221,23 @@ export const openAndClickMenuOption = async (
205
221
  await clickMenuOption(menuOptionText);
206
222
  };
207
223
 
224
+ export const openAndClickMenuOption = async (
225
+ rowId: number | string,
226
+ colId: string,
227
+ menuOptionText: string | RegExp,
228
+ within?: HTMLElement,
229
+ ): Promise<void> => {
230
+ await selectCell(rowId, colId, within);
231
+ await clickMenuOption(menuOptionText);
232
+ };
233
+
208
234
  export const openAndFindMenuOption = async (
209
235
  rowId: number | string,
210
236
  colId: string,
211
237
  menuOptionText: string | RegExp,
212
238
  within?: HTMLElement,
213
239
  ): Promise<HTMLElement> => {
214
- await editCell(rowId, colId, within);
240
+ await selectCell(rowId, colId, within);
215
241
  return await findMenuOption(menuOptionText);
216
242
  };
217
243
 
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": "28.1.1",
5
+ "version": "28.2.0",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -125,7 +125,7 @@
125
125
  "rollup-plugin-peer-deps-external": "^2.2.4",
126
126
  "rollup-plugin-postcss": "^4.0.2",
127
127
  "rollup-plugin-typescript2": "^0.36.0",
128
- "sass": "^1.89.2",
128
+ "sass": "^1.90.0",
129
129
  "sass-loader": "^16.0.5",
130
130
  "semantic-release": "^24.2.7",
131
131
  "storybook": "^9.1.0",
@@ -135,8 +135,13 @@ export const findCellContains = async (
135
135
  };
136
136
 
137
137
  export const selectCell = async (rowId: string | number, colId: string, within?: HTMLElement): Promise<void> => {
138
- const cell = await findCell(rowId, colId, within);
139
- await user.click(cell);
138
+ await waitFor(
139
+ async () => {
140
+ const cell = await findCell(rowId, colId, within);
141
+ await user.click(cell);
142
+ },
143
+ { timeout: 10000 },
144
+ );
140
145
  };
141
146
 
142
147
  export const editCell = async (rowId: number | string, colId: string, within?: HTMLElement): Promise<void> => {
@@ -178,7 +183,7 @@ export const findMenuOption = async (menuOptionText: string | RegExp): Promise<H
178
183
  );
179
184
  };
180
185
 
181
- export const validateMenuOptions = async (
186
+ export const editValidateMenuOptions = async (
182
187
  rowId: number | string,
183
188
  colId: string,
184
189
  expectedMenuOptions: Array<string>,
@@ -189,12 +194,23 @@ export const validateMenuOptions = async (
189
194
  return isEqual(actualOptions, expectedMenuOptions);
190
195
  };
191
196
 
197
+ export const validateMenuOptions = async (
198
+ rowId: number | string,
199
+ colId: string,
200
+ expectedMenuOptions: Array<string>,
201
+ ): Promise<boolean> => {
202
+ await selectCell(rowId, colId);
203
+ const openMenu = await findOpenPopover();
204
+ const actualOptions = (await within(openMenu).findAllByRole('menuitem')).map((menuItem) => menuItem.textContent);
205
+ return isEqual(actualOptions, expectedMenuOptions);
206
+ };
207
+
192
208
  export const clickMenuOption = async (menuOptionText: string | RegExp): Promise<void> => {
193
209
  const menuOption = await findMenuOption(menuOptionText);
194
210
  await user.click(menuOption);
195
211
  };
196
212
 
197
- export const openAndClickMenuOption = async (
213
+ export const editAndClickMenuOption = async (
198
214
  rowId: number | string,
199
215
  colId: string,
200
216
  menuOptionText: string | RegExp,
@@ -204,13 +220,23 @@ export const openAndClickMenuOption = async (
204
220
  await clickMenuOption(menuOptionText);
205
221
  };
206
222
 
223
+ export const openAndClickMenuOption = async (
224
+ rowId: number | string,
225
+ colId: string,
226
+ menuOptionText: string | RegExp,
227
+ within?: HTMLElement,
228
+ ): Promise<void> => {
229
+ await selectCell(rowId, colId, within);
230
+ await clickMenuOption(menuOptionText);
231
+ };
232
+
207
233
  export const openAndFindMenuOption = async (
208
234
  rowId: number | string,
209
235
  colId: string,
210
236
  menuOptionText: string | RegExp,
211
237
  within?: HTMLElement,
212
238
  ): Promise<HTMLElement> => {
213
- await editCell(rowId, colId, within);
239
+ await selectCell(rowId, colId, within);
214
240
  return await findMenuOption(menuOptionText);
215
241
  };
216
242
 
@@ -136,8 +136,13 @@ export const findCellContains = async (
136
136
  };
137
137
 
138
138
  export const selectCell = async (rowId: string | number, colId: string, within?: HTMLElement): Promise<void> => {
139
- const cell = await findCell(rowId, colId, within);
140
- await user.click(cell);
139
+ await waitFor(
140
+ async () => {
141
+ const cell = await findCell(rowId, colId, within);
142
+ await user.click(cell);
143
+ },
144
+ { timeout: 10000 },
145
+ );
141
146
  };
142
147
 
143
148
  export const editCell = async (rowId: number | string, colId: string, within?: HTMLElement): Promise<void> => {
@@ -179,7 +184,7 @@ export const findMenuOption = async (menuOptionText: string | RegExp): Promise<H
179
184
  );
180
185
  };
181
186
 
182
- export const validateMenuOptions = async (
187
+ export const editValidateMenuOptions = async (
183
188
  rowId: number | string,
184
189
  colId: string,
185
190
  expectedMenuOptions: Array<string>,
@@ -190,12 +195,23 @@ export const validateMenuOptions = async (
190
195
  return isEqual(actualOptions, expectedMenuOptions);
191
196
  };
192
197
 
198
+ export const validateMenuOptions = async (
199
+ rowId: number | string,
200
+ colId: string,
201
+ expectedMenuOptions: Array<string>,
202
+ ): Promise<boolean> => {
203
+ await selectCell(rowId, colId);
204
+ const openMenu = await findOpenPopover();
205
+ const actualOptions = (await within(openMenu).findAllByRole('menuitem')).map((menuItem) => menuItem.textContent);
206
+ return isEqual(actualOptions, expectedMenuOptions);
207
+ };
208
+
193
209
  export const clickMenuOption = async (menuOptionText: string | RegExp): Promise<void> => {
194
210
  const menuOption = await findMenuOption(menuOptionText);
195
211
  await user.click(menuOption);
196
212
  };
197
213
 
198
- export const openAndClickMenuOption = async (
214
+ export const editAndClickMenuOption = async (
199
215
  rowId: number | string,
200
216
  colId: string,
201
217
  menuOptionText: string | RegExp,
@@ -205,13 +221,23 @@ export const openAndClickMenuOption = async (
205
221
  await clickMenuOption(menuOptionText);
206
222
  };
207
223
 
224
+ export const openAndClickMenuOption = async (
225
+ rowId: number | string,
226
+ colId: string,
227
+ menuOptionText: string | RegExp,
228
+ within?: HTMLElement,
229
+ ): Promise<void> => {
230
+ await selectCell(rowId, colId, within);
231
+ await clickMenuOption(menuOptionText);
232
+ };
233
+
208
234
  export const openAndFindMenuOption = async (
209
235
  rowId: number | string,
210
236
  colId: string,
211
237
  menuOptionText: string | RegExp,
212
238
  within?: HTMLElement,
213
239
  ): Promise<HTMLElement> => {
214
- await editCell(rowId, colId, within);
240
+ await selectCell(rowId, colId, within);
215
241
  return await findMenuOption(menuOptionText);
216
242
  };
217
243