@linzjs/step-ag-grid 28.2.0 → 28.2.2

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": "28.2.0",
5
+ "version": "28.2.2",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -276,7 +276,6 @@ export const ControlledMenuFr = (
276
276
  );
277
277
 
278
278
  const onKeyUp = (e: KeyboardEvent) => {
279
- console.log(e);
280
279
  switch (e.key) {
281
280
  case Keys.ESC:
282
281
  e.preventDefault();
@@ -8,7 +8,13 @@ import { GridPopoverContext } from 'contexts/GridPopoverContext';
8
8
  import { useRef } from 'react';
9
9
  import { expect, fn, userEvent, within } from 'storybook/test';
10
10
 
11
- import { GridContext, GridFormDropDown, GridFormDropDownProps, GridFormSubComponentTextInput } from '../../..';
11
+ import {
12
+ GridBaseRow,
13
+ GridContext,
14
+ GridFormDropDown,
15
+ GridFormDropDownProps,
16
+ GridFormSubComponentTextInput,
17
+ } from '../../..';
12
18
 
13
19
  export default {
14
20
  title: 'GridForm / Interactions',
@@ -22,8 +28,10 @@ const updateValue = fn(async (saveFn: (selectedRows: any[]) => Promise<boolean>,
22
28
 
23
29
  const onSelectedItem = fn(async () => {});
24
30
 
25
- const Template: StoryFn<typeof GridFormDropDown> = (props: GridFormDropDownProps<any>) => {
26
- const config: GridFormDropDownProps<any> = {
31
+ const Template: StoryFn<typeof GridFormDropDown<GridBaseRow, number>> = (
32
+ props: GridFormDropDownProps<GridBaseRow, number>,
33
+ ) => {
34
+ const config: GridFormDropDownProps<GridBaseRow, number> = {
27
35
  filtered: 'local',
28
36
  onSelectedItem,
29
37
  options: [
@@ -72,7 +80,6 @@ const Template: StoryFn<typeof GridFormDropDown> = (props: GridFormDropDownProps
72
80
  );
73
81
  };
74
82
 
75
- //console.log({ extendedExpect });
76
83
  export const GridFormDropDownInteractions_: typeof Template = Template.bind({});
77
84
  GridFormDropDownInteractions_.play = async ({ canvasElement }) => {
78
85
  const canvas = within(canvasElement);
@@ -10,14 +10,12 @@ import * as test from 'storybook/test';
10
10
  import { expect, userEvent, within } from 'storybook/test';
11
11
 
12
12
  import {
13
- GridBaseRow,
14
13
  GridContext,
15
14
  GridFormPopoverMenu,
16
15
  GridFormPopoverMenuProps,
17
16
  GridFormSubComponentTextArea,
18
17
  GridFormSubComponentTextInput,
19
18
  PopoutMenuSeparator,
20
- SelectedMenuOptionResult,
21
19
  } from '../../..';
22
20
 
23
21
  export default {
@@ -30,13 +28,9 @@ const updateValue = test.fn((saveFn: (selectedRows: any[]) => Promise<boolean>,
30
28
  saveFn([]),
31
29
  );
32
30
 
33
- const enabledAction = test
34
- .fn<[{ selectedRows: GridBaseRow[]; menuOption: SelectedMenuOptionResult<GridBaseRow> }], Promise<void>>()
35
- .mockResolvedValue(undefined);
31
+ const enabledAction = test.fn().mockResolvedValue(undefined);
36
32
 
37
- const disabledAction = test
38
- .fn<[{ selectedRows: GridBaseRow[]; menuOption: SelectedMenuOptionResult<GridBaseRow> }], Promise<void>>()
39
- .mockResolvedValue(undefined);
33
+ const disabledAction = test.fn().mockResolvedValue(undefined);
40
34
 
41
35
  const Template: StoryFn<typeof GridFormPopoverMenu> = (props: GridFormPopoverMenuProps<any>) => {
42
36
  const anchorRef = useRef<HTMLHeadingElement>(null);
@@ -147,7 +147,7 @@ export const getQuick = (filter: IQueryQuick, container?: HTMLElement): HTMLElem
147
147
  * @return HTMLElement. Throws exception if not found.
148
148
  */
149
149
  export const findQuick = async <T extends HTMLElement>(filter: IQueryQuick, container?: HTMLElement): Promise<T> => {
150
- const endTime = Date.now() + 5000;
150
+ const endTime = Date.now() + 1000;
151
151
  while (Date.now() < endTime) {
152
152
  const el = queryQuick<T>(filter, container);
153
153
  if (el) return el;
@@ -130,7 +130,7 @@ export const findCellContains = async (
130
130
  const row = await findRow(rowId, within);
131
131
  return getQuick({ tagName: `[col-id='${colId}']`, text }, row);
132
132
  },
133
- { timeout: 10000 },
133
+ { timeout: 2200 },
134
134
  );
135
135
  };
136
136
 
@@ -140,7 +140,7 @@ export const selectCell = async (rowId: string | number, colId: string, within?:
140
140
  const cell = await findCell(rowId, colId, within);
141
141
  await user.click(cell);
142
142
  },
143
- { timeout: 10000 },
143
+ { timeout: 2200 },
144
144
  );
145
145
  };
146
146
 
@@ -149,9 +149,9 @@ export const editCell = async (rowId: number | string, colId: string, within?: H
149
149
  async () => {
150
150
  const cell = await findCell(rowId, colId, within);
151
151
  await user.dblClick(cell);
152
- await waitFor(findOpenPopover, { timeout: 1000 });
152
+ await waitFor(findOpenPopover);
153
153
  },
154
- { timeout: 10000 },
154
+ { timeout: 2200 },
155
155
  );
156
156
  };
157
157
 
@@ -179,7 +179,7 @@ export const findMenuOption = async (menuOptionText: string | RegExp): Promise<H
179
179
  }
180
180
  return menuOption;
181
181
  },
182
- { timeout: 5000 },
182
+ { timeout: 4000 },
183
183
  );
184
184
  };
185
185
 
@@ -311,12 +311,12 @@ export const clickActionButton = async (text: string, container?: HTMLElement):
311
311
 
312
312
  export const waitForGridReady = async (props?: { grid?: HTMLElement; timeout?: number }) =>
313
313
  waitFor(() => expect(getAllQuick({ classes: '.Grid-ready' }, props?.grid)).toBeDefined(), {
314
- timeout: props?.timeout ?? 5000,
314
+ timeout: props?.timeout ?? 4000,
315
315
  });
316
316
 
317
317
  export const waitForGridRows = async (props?: { grid?: HTMLElement; timeout?: number }) =>
318
318
  waitFor(() => expect(getAllQuick({ classes: '.ag-row' }, props?.grid).length > 0).toBe(true), {
319
- timeout: props?.timeout ?? 5000,
319
+ timeout: props?.timeout ?? 4000,
320
320
  });
321
321
 
322
322
  export const clickColumnHeaderToSort = async (colId: string, within?: HTMLElement): Promise<void> => {
@@ -131,7 +131,7 @@ export const findCellContains = async (
131
131
  const row = await findRow(rowId, within);
132
132
  return getQuick({ tagName: `[col-id='${colId}']`, text }, row);
133
133
  },
134
- { timeout: 10000 },
134
+ { timeout: 2200 },
135
135
  );
136
136
  };
137
137
 
@@ -141,7 +141,7 @@ export const selectCell = async (rowId: string | number, colId: string, within?:
141
141
  const cell = await findCell(rowId, colId, within);
142
142
  await user.click(cell);
143
143
  },
144
- { timeout: 10000 },
144
+ { timeout: 2200 },
145
145
  );
146
146
  };
147
147
 
@@ -150,9 +150,9 @@ export const editCell = async (rowId: number | string, colId: string, within?: H
150
150
  async () => {
151
151
  const cell = await findCell(rowId, colId, within);
152
152
  await user.dblClick(cell);
153
- await waitFor(findOpenPopover, { timeout: 1000 });
153
+ await waitFor(findOpenPopover);
154
154
  },
155
- { timeout: 10000 },
155
+ { timeout: 2200 },
156
156
  );
157
157
  };
158
158
 
@@ -180,7 +180,7 @@ export const findMenuOption = async (menuOptionText: string | RegExp): Promise<H
180
180
  }
181
181
  return menuOption;
182
182
  },
183
- { timeout: 5000 },
183
+ { timeout: 4000 },
184
184
  );
185
185
  };
186
186
 
@@ -312,12 +312,12 @@ export const clickActionButton = async (text: string, container?: HTMLElement):
312
312
 
313
313
  export const waitForGridReady = async (props?: { grid?: HTMLElement; timeout?: number }) =>
314
314
  waitFor(() => expect(getAllQuick({ classes: '.Grid-ready' }, props?.grid)).toBeDefined(), {
315
- timeout: props?.timeout ?? 5000,
315
+ timeout: props?.timeout ?? 4000,
316
316
  });
317
317
 
318
318
  export const waitForGridRows = async (props?: { grid?: HTMLElement; timeout?: number }) =>
319
319
  waitFor(() => expect(getAllQuick({ classes: '.ag-row' }, props?.grid).length > 0).toBe(true), {
320
- timeout: props?.timeout ?? 5000,
320
+ timeout: props?.timeout ?? 4000,
321
321
  });
322
322
 
323
323
  export const clickColumnHeaderToSort = async (colId: string, within?: HTMLElement): Promise<void> => {