@react-aria/test-utils 1.0.0-alpha.2 → 1.0.0-alpha.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.
@@ -1,5 +1,5 @@
1
1
  import {pressElement as $5d1eca18f92ad0e6$export$6ffa3eb717517feb, triggerLongPress as $5d1eca18f92ad0e6$export$3a22a5a9bc0fd3b} from "./events.module.js";
2
- import {within as $2KUjE$within, fireEvent as $2KUjE$fireEvent, act as $2KUjE$act, waitFor as $2KUjE$waitFor} from "@testing-library/react";
2
+ import {within as $2KUjE$within, fireEvent as $2KUjE$fireEvent, waitFor as $2KUjE$waitFor, act as $2KUjE$act} from "@testing-library/react";
3
3
 
4
4
  /*
5
5
  * Copyright 2024 Adobe. All rights reserved.
@@ -70,11 +70,6 @@ class $6d1e4cf220920c37$export$4c6a9d6ae3b0086 {
70
70
  await (0, $2KUjE$fireEvent).click(cell);
71
71
  } else await (0, $5d1eca18f92ad0e6$export$6ffa3eb717517feb)(this.user, cell, interactionType);
72
72
  }
73
- // Handle cases where the table may transition in response to the row selection/deselection
74
- await (0, $2KUjE$act)(async ()=>{
75
- if (this._advanceTimer == null) throw new Error('No advanceTimers provided for table transition.');
76
- await this._advanceTimer(200);
77
- });
78
73
  };
79
74
  this.toggleSort = async (opts = {})=>{
80
75
  let { index: index, text: text, interactionType: interactionType = this._interactionType } = opts;
@@ -113,9 +108,10 @@ class $6d1e4cf220920c37$export$4c6a9d6ae3b0086 {
113
108
  }
114
109
  }
115
110
  // Handle cases where the table may transition in response to the row selection/deselection
111
+ if (!this._advanceTimer) throw new Error('No advanceTimers provided for table transition.');
116
112
  await (0, $2KUjE$act)(async ()=>{
117
- if (this._advanceTimer == null) throw new Error('No advanceTimers provided for table transition.');
118
- await this._advanceTimer(200);
113
+ var _this__advanceTimer, _this;
114
+ await ((_this__advanceTimer = (_this = this)._advanceTimer) === null || _this__advanceTimer === void 0 ? void 0 : _this__advanceTimer.call(_this, 200));
119
115
  });
120
116
  await (0, $2KUjE$waitFor)(()=>{
121
117
  if (document.activeElement !== menuButton) throw new Error(`Expected the document.activeElement to be the table column menu button but got ${document.activeElement}`);
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAaM,MAAM;IAkOX,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM;IACpB;IAEA,IAAI,YAAY;QACd,IAAI,QAAQ,IAAI,CAAC,MAAM;QACvB,OAAO,QAAQ,CAAA,GAAA,aAAK,EAAE,OAAO,cAAc,CAAC,cAAc,EAAE;IAC9D;IAEA,IAAI,UAAU;QACZ,IAAI,iBAAiB,IAAI,CAAC,SAAS,CAAC,EAAE;QACtC,OAAO,iBAAiB,CAAA,GAAA,aAAK,EAAE,gBAAgB,cAAc,CAAC,kBAAkB,EAAE;IACpF;IAEA,IAAI,OAAO;QACT,IAAI,eAAe,IAAI,CAAC,SAAS,CAAC,EAAE;QACpC,OAAO,eAAe,CAAA,GAAA,aAAK,EAAE,cAAc,cAAc,CAAC,SAAS,EAAE;IACvE;IAEA,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA,MAAO,IAAI,YAAY,CAAC,qBAAqB;IACvE;IAEA,IAAI,aAAa;QACf,IAAI,QAAQ,IAAI,CAAC,KAAK;QACtB,OAAO,QAAQ,CAAA,GAAA,aAAK,EAAE,OAAO,cAAc,CAAC,eAAe,EAAE;IAC/D;IAEA,IAAI,QAAQ;QACV,IAAI,QAAQ,IAAI,CAAC,KAAK;QACtB,OAAO,QAAQ,CAAA,GAAA,aAAK,EAAE,OAAO,cAAc,CAAC,cAAc,EAAE;IAC9D;IA3PA,YAAY,IAAkB,CAAE;aAQhC,qBAAqB,CAAC;YACpB,IAAI,CAAC,gBAAgB,GAAG;QAC1B;aAEA,qBAAqB,OAAO,OAAiH,CAAC,CAAC;YAC7I,IAAI,SACF,KAAK,QACL,IAAI,kBACJ,cAAc,mBACd,kBAAkB,I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I,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;iBAEtB,MAAM,CAAA,GAAA,yCAAW,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU;QAE5C;aAEA,UAAU,CAAC,OAAwC,CAAC,CAAC;YACnD,IAAI,SACF,KAAK,QACL,IAAI,EACL,GAAG;YAEJ,IAAI;YACJ,IAAI,OAAO,IAAI,CAAC,IAAI;YACpB,IAAI,eAAe,IAAI,CAAC,SAAS,CAAC,EAAE;YACpC,IAAI,SAAS,MACX,MAAM,IAAI,CAAC,MAAM;iBACZ,IAAI,QAAQ,MAAM;gBACvB,MAAM,CAAA,GAAA,aAAK,EAAE,cAAc,SAAS,CAAC;gBACrC,MAAO,OAAO,IAAI,YAAY,CAAC,YAAY,MACzC,MAAM,IAAI,aAAa;YAE3B;YAEA,OAAO;QACT;aAEA,WAAW,CAAC;YACV,IAAI,QACF,IAAI,EACL,GAAG;YAEJ,IAAI,OAAO,CAAA,GAAA,aAAK,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC;YACxC,IAAI,MACF,MAAO,QAAQ,CAAC,kCAAkC,IAAI,CAAC,KAAK,YAAY,CAAC,WAAW,IAAK;gBACvF,IAAI,KAAK,aAAa,EACpB,OAAO,KAAK,aAAa;qBAEzB;YAEJ;YAGF,OAAO;QACT;QAzNE,IAAI,QAAC,IAAI,QAAE,IAAI,mBAAE,eAAe,gBAAE,YAAY,EAAC,GAAG;QAClD,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,CAAC,gBAAgB,GAAG,mBAAmB;QAC3C,IAAI,CAAC,aAAa,GAAG;QACrB,IAAI,CAAC,MAAM,GAAG;IAChB;AAsPF","sources":["packages/@react-aria/test-utils/src/table.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {act, fireEvent, waitFor, within} from '@testing-library/react';\nimport {BaseTesterOpts, UserOpts} from './user';\nimport {pressElement, triggerLongPress} from './events';\nexport interface TableOptions extends UserOpts, BaseTesterOpts {\n user: any,\n advanceTimer: UserOpts['advanceTimer']\n}\n\n// TODO: Previously used logic like https://github.com/testing-library/react-testing-library/blame/c63b873072d62c858959c2a19e68f8e2cc0b11be/src/pure.js#L16\n// but https://github.com/testing-library/dom-testing-library/issues/987#issuecomment-891901804 indicates that it may falsely indicate that fake timers are enabled\n// when they aren't\nexport class TableTester {\n private user;\n private _interactionType: UserOpts['interactionType'];\n private _advanceTimer: UserOpts['advanceTimer'];\n private _table: HTMLElement;\n\n constructor(opts: TableOptions) {\n let {root, user, interactionType, advanceTimer} = opts;\n this.user = user;\n this._interactionType = interactionType || 'mouse';\n this._advanceTimer = advanceTimer;\n this._table = root;\n }\n\n setInteractionType = (type: UserOpts['interactionType']) => {\n this._interactionType = type;\n };\n\n toggleRowSelection = async (opts: {index?: number, text?: string, needsLongPress?: boolean, interactionType?: UserOpts['interactionType']} = {}) => {\n let {\n index,\n text,\n needsLongPress,\n interactionType = this._interactionType\n } = opts;\n\n let row = this.findRow({index, text});\n let rowCheckbox = within(row).queryByRole('checkbox');\n if (rowCheckbox) {\n await pressElement(this.user, rowCheckbox, interactionType);\n } else {\n let cell = within(row).getAllByRole('gridcell')[0];\n if (needsLongPress && interactionType === 'touch') {\n if (this._advanceTimer == null) {\n throw new Error('No advanceTimers provided for long press.');\n }\n\n // Note that long press interactions with rows is strictly touch only for grid rows\n await triggerLongPress({element: cell, advanceTimer: this._advanceTimer, pointerOpts: {pointerType: 'touch'}});\n // TODO: interestingly enough, we need to do a followup click otherwise future row selections may not fire properly?\n // To reproduce, try removing this, forcing toggleRowSelection to hit \"needsLongPress ? await triggerLongPress(cell) : await action(cell);\" and\n // run Table.test's \"should support long press to enter selection mode on touch\" test to see what happens\n await fireEvent.click(cell);\n } else {\n await pressElement(this.user, cell, interactionType);\n }\n }\n\n // Handle cases where the table may transition in response to the row selection/deselection\n await act(async () => {\n if (this._advanceTimer == null) {\n throw new Error('No advanceTimers provided for table transition.');\n }\n\n await this._advanceTimer(200);\n });\n };\n\n toggleSort = async (opts: {index?: number, text?: string, interactionType?: UserOpts['interactionType']} = {}) => {\n let {\n index,\n text,\n interactionType = this._interactionType\n } = opts;\n\n let columnheader;\n if (index != null) {\n columnheader = this.columns[index];\n } else if (text != null) {\n columnheader = within(this.rowGroups[0]).getByText(text);\n while (columnheader && !/columnheader/.test(columnheader.getAttribute('role'))) {\n columnheader = columnheader.parentElement;\n }\n }\n\n let menuButton = within(columnheader).queryByRole('button');\n if (menuButton) {\n let currentSort = columnheader.getAttribute('aria-sort');\n // TODO: Focus management is all kinda of messed up if I just use .focus and Space to open the sort menu. Seems like\n // the focused key doesn't get properly set to the desired column header. Have to do this strange flow where I focus the\n // column header except if the active element is already the menu button within the column header\n if (interactionType === 'keyboard' && document.activeElement !== menuButton) {\n await pressElement(this.user, columnheader, interactionType);\n } else {\n await pressElement(this.user, menuButton, interactionType);\n }\n\n await waitFor(() => {\n if (menuButton.getAttribute('aria-controls') == null) {\n throw new Error('No aria-controls found on table column dropdown menu trigger element.');\n } else {\n return true;\n }\n });\n\n let menuId = menuButton.getAttribute('aria-controls');\n await waitFor(() => {\n if (!menuId || document.getElementById(menuId) == null) {\n throw new Error(`Table column header menu with id of ${menuId} not found in document.`);\n } else {\n return true;\n }\n });\n\n if (menuId) {\n let menu = document.getElementById(menuId);\n if (menu) {\n if (currentSort === 'ascending') {\n await pressElement(this.user, within(menu).getAllByRole('menuitem')[1], interactionType);\n } else {\n await pressElement(this.user, within(menu).getAllByRole('menuitem')[0], interactionType);\n }\n\n await waitFor(() => {\n if (document.contains(menu)) {\n throw new Error('Expected table column menu listbox to not be in the document after selecting an option');\n } else {\n return true;\n }\n });\n }\n }\n\n // Handle cases where the table may transition in response to the row selection/deselection\n await act(async () => {\n if (this._advanceTimer == null) {\n throw new Error('No advanceTimers provided for table transition.');\n }\n\n await this._advanceTimer(200);\n });\n\n await waitFor(() => {\n if (document.activeElement !== menuButton) {\n throw new Error(`Expected the document.activeElement to be the table column menu button but got ${document.activeElement}`);\n } else {\n return true;\n }\n });\n } else {\n await pressElement(this.user, columnheader, interactionType);\n }\n };\n // TODO: should there be a util for triggering a row action? Perhaps there should be but it would rely on the user teling us the config of the\n // table. Maybe we could rely on the user knowing to trigger a press/double click? We could have the user pass in \"needsDoubleClick\"\n // It is also iffy if there is any row selected because then the table is in selectionMode and the below actions will simply toggle row selection\n triggerRowAction = async (opts: {index?: number, text?: string, needsDoubleClick?: boolean, interactionType?: UserOpts['interactionType']} = {}) => {\n let {\n index,\n text,\n needsDoubleClick,\n interactionType = this._interactionType\n } = opts;\n\n let row = this.findRow({index, text});\n if (row) {\n if (needsDoubleClick) {\n await this.user.dblClick(row);\n } else if (interactionType === 'keyboard') {\n act(() => row.focus());\n await this.user.keyboard('[Enter]');\n } else {\n await pressElement(this.user, row, interactionType);\n }\n }\n };\n\n // TODO: should there be utils for drag and drop and column resizing? For column resizing, I'm not entirely convinced that users will be doing that in their tests.\n // For DnD, it might be tricky to do for keyboard DnD since we wouldn't know what valid drop zones there are... Similarly, for simulating mouse drag and drop the coordinates depend\n // on the mocks the user sets up for their row height/etc.\n // Additionally, should we also support keyboard navigation/typeahead? Those felt like they could be very easily replicated by the user via user.keyboard already and don't really\n // add much value if we provide that to them\n\n toggleSelectAll = async (opts: {interactionType?: UserOpts['interactionType']} = {}) => {\n let {\n interactionType = this._interactionType\n } = opts;\n let checkbox = within(this.table).getByLabelText('Select All');\n if (interactionType === 'keyboard') {\n // TODO: using the .focus -> trigger keyboard Enter approach doesn't work for some reason, for now just trigger select all with click.\n await this.user.click(checkbox);\n } else {\n await pressElement(this.user, checkbox, interactionType);\n }\n };\n\n findRow = (opts: {index?: number, text?: string} = {}) => {\n let {\n index,\n text\n } = opts;\n\n let row;\n let rows = this.rows;\n let bodyRowGroup = this.rowGroups[1];\n if (index != null) {\n row = rows[index];\n } else if (text != null) {\n row = within(bodyRowGroup).getByText(text);\n while (row && row.getAttribute('role') !== 'row') {\n row = row.parentElement;\n }\n }\n\n return row;\n };\n\n findCell = (opts: {text: string}) => {\n let {\n text\n } = opts;\n\n let cell = within(this.table).getByText(text);\n if (cell) {\n while (cell && !/gridcell|rowheader|columnheader/.test(cell.getAttribute('role') || '')) {\n if (cell.parentElement) {\n cell = cell.parentElement;\n } else {\n break;\n }\n }\n }\n\n return cell;\n };\n\n get table() {\n return this._table;\n }\n\n get rowGroups() {\n let table = this._table;\n return table ? within(table).queryAllByRole('rowgroup') : [];\n }\n\n get columns() {\n let headerRowGroup = this.rowGroups[0];\n return headerRowGroup ? within(headerRowGroup).queryAllByRole('columnheader') : [];\n }\n\n get rows() {\n let bodyRowGroup = this.rowGroups[1];\n return bodyRowGroup ? within(bodyRowGroup).queryAllByRole('row') : [];\n }\n\n get selectedRows() {\n return this.rows.filter(row => row.getAttribute('aria-selected') === 'true');\n }\n\n get rowHeaders() {\n let table = this.table;\n return table ? within(table).queryAllByRole('rowheader') : [];\n }\n\n get cells() {\n let table = this.table;\n return table ? within(table).queryAllByRole('gridcell') : [];\n }\n}\n"],"names":[],"version":3,"file":"table.module.js.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAaM,MAAM;IAyNX,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM;IACpB;IAEA,IAAI,YAAY;QACd,IAAI,QAAQ,IAAI,CAAC,MAAM;QACvB,OAAO,QAAQ,CAAA,GAAA,aAAK,EAAE,OAAO,cAAc,CAAC,cAAc,EAAE;IAC9D;IAEA,IAAI,UAAU;QACZ,IAAI,iBAAiB,IAAI,CAAC,SAAS,CAAC,EAAE;QACtC,O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AAI,QACF,IAAI,EACL,GAAG;YAEJ,IAAI,OAAO,CAAA,GAAA,aAAK,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC;YACxC,IAAI,MACF,MAAO,QAAQ,CAAC,kCAAkC,IAAI,CAAC,KAAK,YAAY,CAAC,WAAW,IAAK;gBACvF,IAAI,KAAK,aAAa,EACpB,OAAO,KAAK,aAAa;qBAEzB;YAEJ;YAGF,OAAO;QACT;QAhNE,IAAI,QAAC,IAAI,QAAE,IAAI,mBAAE,eAAe,gBAAE,YAAY,EAAC,GAAG;QAClD,IAAI,CAAC,IAAI,GAAG;QACZ,IAAI,CAAC,gBAAgB,GAAG,mBAAmB;QAC3C,IAAI,CAAC,aAAa,GAAG;QACrB,IAAI,CAAC,MAAM,GAAG;IAChB;AA6OF","sources":["packages/@react-aria/test-utils/src/table.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {act, fireEvent, waitFor, within} from '@testing-library/react';\nimport {BaseTesterOpts, UserOpts} from './user';\nimport {pressElement, triggerLongPress} from './events';\nexport interface TableOptions extends UserOpts, BaseTesterOpts {\n user?: any,\n advanceTimer: UserOpts['advanceTimer']\n}\n\n// TODO: Previously used logic like https://github.com/testing-library/react-testing-library/blame/c63b873072d62c858959c2a19e68f8e2cc0b11be/src/pure.js#L16\n// but https://github.com/testing-library/dom-testing-library/issues/987#issuecomment-891901804 indicates that it may falsely indicate that fake timers are enabled\n// when they aren't\nexport class TableTester {\n private user;\n private _interactionType: UserOpts['interactionType'];\n private _advanceTimer: UserOpts['advanceTimer'];\n private _table: HTMLElement;\n\n constructor(opts: TableOptions) {\n let {root, user, interactionType, advanceTimer} = opts;\n this.user = user;\n this._interactionType = interactionType || 'mouse';\n this._advanceTimer = advanceTimer;\n this._table = root;\n }\n\n setInteractionType = (type: UserOpts['interactionType']) => {\n this._interactionType = type;\n };\n\n toggleRowSelection = async (opts: {index?: number, text?: string, needsLongPress?: boolean, interactionType?: UserOpts['interactionType']} = {}) => {\n let {\n index,\n text,\n needsLongPress,\n interactionType = this._interactionType\n } = opts;\n\n let row = this.findRow({index, text});\n let rowCheckbox = within(row).queryByRole('checkbox');\n if (rowCheckbox) {\n await pressElement(this.user, rowCheckbox, interactionType);\n } else {\n let cell = within(row).getAllByRole('gridcell')[0];\n if (needsLongPress && interactionType === 'touch') {\n if (this._advanceTimer == null) {\n throw new Error('No advanceTimers provided for long press.');\n }\n\n // Note that long press interactions with rows is strictly touch only for grid rows\n await triggerLongPress({element: cell, advanceTimer: this._advanceTimer, pointerOpts: {pointerType: 'touch'}});\n // TODO: interestingly enough, we need to do a followup click otherwise future row selections may not fire properly?\n // To reproduce, try removing this, forcing toggleRowSelection to hit \"needsLongPress ? await triggerLongPress(cell) : await action(cell);\" and\n // run Table.test's \"should support long press to enter selection mode on touch\" test to see what happens\n await fireEvent.click(cell);\n } else {\n await pressElement(this.user, cell, interactionType);\n }\n }\n };\n\n toggleSort = async (opts: {index?: number, text?: string, interactionType?: UserOpts['interactionType']} = {}) => {\n let {\n index,\n text,\n interactionType = this._interactionType\n } = opts;\n\n let columnheader;\n if (index != null) {\n columnheader = this.columns[index];\n } else if (text != null) {\n columnheader = within(this.rowGroups[0]).getByText(text);\n while (columnheader && !/columnheader/.test(columnheader.getAttribute('role'))) {\n columnheader = columnheader.parentElement;\n }\n }\n\n let menuButton = within(columnheader).queryByRole('button');\n if (menuButton) {\n let currentSort = columnheader.getAttribute('aria-sort');\n // TODO: Focus management is all kinda of messed up if I just use .focus and Space to open the sort menu. Seems like\n // the focused key doesn't get properly set to the desired column header. Have to do this strange flow where I focus the\n // column header except if the active element is already the menu button within the column header\n if (interactionType === 'keyboard' && document.activeElement !== menuButton) {\n await pressElement(this.user, columnheader, interactionType);\n } else {\n await pressElement(this.user, menuButton, interactionType);\n }\n\n await waitFor(() => {\n if (menuButton.getAttribute('aria-controls') == null) {\n throw new Error('No aria-controls found on table column dropdown menu trigger element.');\n } else {\n return true;\n }\n });\n\n let menuId = menuButton.getAttribute('aria-controls');\n await waitFor(() => {\n if (!menuId || document.getElementById(menuId) == null) {\n throw new Error(`Table column header menu with id of ${menuId} not found in document.`);\n } else {\n return true;\n }\n });\n\n if (menuId) {\n let menu = document.getElementById(menuId);\n if (menu) {\n if (currentSort === 'ascending') {\n await pressElement(this.user, within(menu).getAllByRole('menuitem')[1], interactionType);\n } else {\n await pressElement(this.user, within(menu).getAllByRole('menuitem')[0], interactionType);\n }\n\n await waitFor(() => {\n if (document.contains(menu)) {\n throw new Error('Expected table column menu listbox to not be in the document after selecting an option');\n } else {\n return true;\n }\n });\n }\n }\n\n // Handle cases where the table may transition in response to the row selection/deselection\n if (!this._advanceTimer) {\n throw new Error('No advanceTimers provided for table transition.');\n }\n\n await act(async () => {\n await this._advanceTimer?.(200);\n });\n\n await waitFor(() => {\n if (document.activeElement !== menuButton) {\n throw new Error(`Expected the document.activeElement to be the table column menu button but got ${document.activeElement}`);\n } else {\n return true;\n }\n });\n } else {\n await pressElement(this.user, columnheader, interactionType);\n }\n };\n // TODO: should there be a util for triggering a row action? Perhaps there should be but it would rely on the user teling us the config of the\n // table. Maybe we could rely on the user knowing to trigger a press/double click? We could have the user pass in \"needsDoubleClick\"\n // It is also iffy if there is any row selected because then the table is in selectionMode and the below actions will simply toggle row selection\n triggerRowAction = async (opts: {index?: number, text?: string, needsDoubleClick?: boolean, interactionType?: UserOpts['interactionType']} = {}) => {\n let {\n index,\n text,\n needsDoubleClick,\n interactionType = this._interactionType\n } = opts;\n\n let row = this.findRow({index, text});\n if (row) {\n if (needsDoubleClick) {\n await this.user.dblClick(row);\n } else if (interactionType === 'keyboard') {\n act(() => row.focus());\n await this.user.keyboard('[Enter]');\n } else {\n await pressElement(this.user, row, interactionType);\n }\n }\n };\n\n // TODO: should there be utils for drag and drop and column resizing? For column resizing, I'm not entirely convinced that users will be doing that in their tests.\n // For DnD, it might be tricky to do for keyboard DnD since we wouldn't know what valid drop zones there are... Similarly, for simulating mouse drag and drop the coordinates depend\n // on the mocks the user sets up for their row height/etc.\n // Additionally, should we also support keyboard navigation/typeahead? Those felt like they could be very easily replicated by the user via user.keyboard already and don't really\n // add much value if we provide that to them\n\n toggleSelectAll = async (opts: {interactionType?: UserOpts['interactionType']} = {}) => {\n let {\n interactionType = this._interactionType\n } = opts;\n let checkbox = within(this.table).getByLabelText('Select All');\n if (interactionType === 'keyboard') {\n // TODO: using the .focus -> trigger keyboard Enter approach doesn't work for some reason, for now just trigger select all with click.\n await this.user.click(checkbox);\n } else {\n await pressElement(this.user, checkbox, interactionType);\n }\n };\n\n findRow = (opts: {index?: number, text?: string} = {}) => {\n let {\n index,\n text\n } = opts;\n\n let row;\n let rows = this.rows;\n let bodyRowGroup = this.rowGroups[1];\n if (index != null) {\n row = rows[index];\n } else if (text != null) {\n row = within(bodyRowGroup).getByText(text);\n while (row && row.getAttribute('role') !== 'row') {\n row = row.parentElement;\n }\n }\n\n return row;\n };\n\n findCell = (opts: {text: string}) => {\n let {\n text\n } = opts;\n\n let cell = within(this.table).getByText(text);\n if (cell) {\n while (cell && !/gridcell|rowheader|columnheader/.test(cell.getAttribute('role') || '')) {\n if (cell.parentElement) {\n cell = cell.parentElement;\n } else {\n break;\n }\n }\n }\n\n return cell;\n };\n\n get table() {\n return this._table;\n }\n\n get rowGroups() {\n let table = this._table;\n return table ? within(table).queryAllByRole('rowgroup') : [];\n }\n\n get columns() {\n let headerRowGroup = this.rowGroups[0];\n return headerRowGroup ? within(headerRowGroup).queryAllByRole('columnheader') : [];\n }\n\n get rows() {\n let bodyRowGroup = this.rowGroups[1];\n return bodyRowGroup ? within(bodyRowGroup).queryAllByRole('row') : [];\n }\n\n get selectedRows() {\n return this.rows.filter(row => row.getAttribute('aria-selected') === 'true');\n }\n\n get rowHeaders() {\n let table = this.table;\n return table ? within(table).queryAllByRole('rowheader') : [];\n }\n\n get cells() {\n let table = this.table;\n return table ? within(table).queryAllByRole('gridcell') : [];\n }\n}\n"],"names":[],"version":3,"file":"table.module.js.map"}
@@ -20,9 +20,8 @@ $parcel$export(module.exports, "installPointerEvent", () => $b53408e40e8d56d0$ex
20
20
  */ /**
21
21
  * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).
22
22
  */ function $b53408e40e8d56d0$export$de31e3987c917741() {
23
+ let oldMouseEvent = MouseEvent;
23
24
  beforeAll(()=>{
24
- let oldMouseEvent = MouseEvent;
25
- // @ts-ignore
26
25
  $parcel$global.MouseEvent = class FakeMouseEvent extends MouseEvent {
27
26
  get pageX() {
28
27
  return this._init.pageX;
@@ -35,12 +34,9 @@ $parcel$export(module.exports, "installPointerEvent", () => $b53408e40e8d56d0$ex
35
34
  this._init = init;
36
35
  }
37
36
  };
38
- // @ts-ignore
39
- $parcel$global.MouseEvent.oldMouseEvent = oldMouseEvent;
40
37
  });
41
38
  afterAll(()=>{
42
- // @ts-ignore
43
- $parcel$global.MouseEvent = $parcel$global.MouseEvent.oldMouseEvent;
39
+ $parcel$global.MouseEvent = oldMouseEvent;
44
40
  });
45
41
  }
46
42
  function $b53408e40e8d56d0$export$82f0b04c1d69a901() {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED;;CAEC,GACM,SAAS;IACd,UAAU;QACR,IAAI,gBAAgB;QACpB,aAAa;QACb,eAAO,UAAU,GAAG,MAAM,uBAAuB;YAM/C,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YATA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAOF;QACA,aAAa;QACb,eAAO,UAAU,CAAC,aAAa,GAAG;IACpC;IACA,SAAS;QACP,aAAa;QACb,eAAO,UAAU,GAAG,eAAO,UAAU,CAAC,aAAa;IACrD;AACF;AAEO,SAAS;IACd,UAAU;QACR,aAAa;QACb,eAAO,YAAY,GAAG,MAAM,yBAAyB;YAMnD,IAAI,cAAc;oBACT;gBAAP,OAAO,CAAA,0BAAA,IAAI,CAAC,KAAK,CAAC,WAAW,cAAtB,qCAAA,0BAA0B;YACnC;YACA,IAAI,YAAY;gBACd,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS;YAC7B;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,SAAS;gBACX,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM;YAC1B;YArBA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAmBF;IACF;IACA,SAAS;QACP,aAAa;QACb,OAAO,eAAO,YAAY;IAC5B;AACF","sources":["packages/@react-aria/test-utils/src/testSetup.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).\n */\nexport function installMouseEvent() {\n beforeAll(() => {\n let oldMouseEvent = MouseEvent;\n // @ts-ignore\n global.MouseEvent = class FakeMouseEvent extends MouseEvent {\n _init: {pageX: number, pageY: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n };\n // @ts-ignore\n global.MouseEvent.oldMouseEvent = oldMouseEvent;\n });\n afterAll(() => {\n // @ts-ignore\n global.MouseEvent = global.MouseEvent.oldMouseEvent;\n });\n}\n\nexport function installPointerEvent() {\n beforeAll(() => {\n // @ts-ignore\n global.PointerEvent = class FakePointerEvent extends MouseEvent {\n _init: {pageX: number, pageY: number, pointerType: string, pointerId: number, width: number, height: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pointerType() {\n return this._init.pointerType ?? 'mouse';\n }\n get pointerId() {\n return this._init.pointerId;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n get width() {\n return this._init.width;\n }\n get height() {\n return this._init.height;\n }\n };\n });\n afterAll(() => {\n // @ts-ignore\n delete global.PointerEvent;\n });\n}\n"],"names":[],"version":3,"file":"testSetup.main.js.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED;;CAEC,GACM,SAAS;IACd,IAAI,gBAAgB;IACpB,UAAU;QACR,eAAO,UAAU,GAAG,MAAM,uBAAuB;YAM/C,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YATA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAOF;IACF;IACA,SAAS;QACP,eAAO,UAAU,GAAG;IACtB;AACF;AAEO,SAAS;IACd,UAAU;QACR,aAAa;QACb,eAAO,YAAY,GAAG,MAAM,yBAAyB;YAMnD,IAAI,cAAc;oBACT;gBAAP,OAAO,CAAA,0BAAA,IAAI,CAAC,KAAK,CAAC,WAAW,cAAtB,qCAAA,0BAA0B;YACnC;YACA,IAAI,YAAY;gBACd,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS;YAC7B;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,SAAS;gBACX,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM;YAC1B;YArBA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAmBF;IACF;IACA,SAAS;QACP,aAAa;QACb,OAAO,eAAO,YAAY;IAC5B;AACF","sources":["packages/@react-aria/test-utils/src/testSetup.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).\n */\nexport function installMouseEvent() {\n let oldMouseEvent = MouseEvent;\n beforeAll(() => {\n global.MouseEvent = class FakeMouseEvent extends MouseEvent {\n _init: {pageX: number, pageY: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n };\n });\n afterAll(() => {\n global.MouseEvent = oldMouseEvent;\n });\n}\n\nexport function installPointerEvent() {\n beforeAll(() => {\n // @ts-ignore\n global.PointerEvent = class FakePointerEvent extends MouseEvent {\n _init: {pageX: number, pageY: number, pointerType: string, pointerId: number, width: number, height: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pointerType() {\n return this._init.pointerType ?? 'mouse';\n }\n get pointerId() {\n return this._init.pointerId;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n get width() {\n return this._init.width;\n }\n get height() {\n return this._init.height;\n }\n };\n });\n afterAll(() => {\n // @ts-ignore\n delete global.PointerEvent;\n });\n}\n"],"names":[],"version":3,"file":"testSetup.main.js.map"}
@@ -13,9 +13,8 @@
13
13
  */ /**
14
14
  * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).
15
15
  */ function $68df97871cfb5e33$export$de31e3987c917741() {
16
+ let oldMouseEvent = MouseEvent;
16
17
  beforeAll(()=>{
17
- let oldMouseEvent = MouseEvent;
18
- // @ts-ignore
19
18
  $parcel$global.MouseEvent = class FakeMouseEvent extends MouseEvent {
20
19
  get pageX() {
21
20
  return this._init.pageX;
@@ -28,12 +27,9 @@
28
27
  this._init = init;
29
28
  }
30
29
  };
31
- // @ts-ignore
32
- $parcel$global.MouseEvent.oldMouseEvent = oldMouseEvent;
33
30
  });
34
31
  afterAll(()=>{
35
- // @ts-ignore
36
- $parcel$global.MouseEvent = $parcel$global.MouseEvent.oldMouseEvent;
32
+ $parcel$global.MouseEvent = oldMouseEvent;
37
33
  });
38
34
  }
39
35
  function $68df97871cfb5e33$export$82f0b04c1d69a901() {
@@ -13,9 +13,8 @@
13
13
  */ /**
14
14
  * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).
15
15
  */ function $68df97871cfb5e33$export$de31e3987c917741() {
16
+ let oldMouseEvent = MouseEvent;
16
17
  beforeAll(()=>{
17
- let oldMouseEvent = MouseEvent;
18
- // @ts-ignore
19
18
  $parcel$global.MouseEvent = class FakeMouseEvent extends MouseEvent {
20
19
  get pageX() {
21
20
  return this._init.pageX;
@@ -28,12 +27,9 @@
28
27
  this._init = init;
29
28
  }
30
29
  };
31
- // @ts-ignore
32
- $parcel$global.MouseEvent.oldMouseEvent = oldMouseEvent;
33
30
  });
34
31
  afterAll(()=>{
35
- // @ts-ignore
36
- $parcel$global.MouseEvent = $parcel$global.MouseEvent.oldMouseEvent;
32
+ $parcel$global.MouseEvent = oldMouseEvent;
37
33
  });
38
34
  }
39
35
  function $68df97871cfb5e33$export$82f0b04c1d69a901() {
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC,GAED;;CAEC,GACM,SAAS;IACd,UAAU;QACR,IAAI,gBAAgB;QACpB,aAAa;QACb,eAAO,UAAU,GAAG,MAAM,uBAAuB;YAM/C,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YATA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAOF;QACA,aAAa;QACb,eAAO,UAAU,CAAC,aAAa,GAAG;IACpC;IACA,SAAS;QACP,aAAa;QACb,eAAO,UAAU,GAAG,eAAO,UAAU,CAAC,aAAa;IACrD;AACF;AAEO,SAAS;IACd,UAAU;QACR,aAAa;QACb,eAAO,YAAY,GAAG,MAAM,yBAAyB;YAMnD,IAAI,cAAc;oBACT;gBAAP,OAAO,CAAA,0BAAA,IAAI,CAAC,KAAK,CAAC,WAAW,cAAtB,qCAAA,0BAA0B;YACnC;YACA,IAAI,YAAY;gBACd,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS;YAC7B;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,SAAS;gBACX,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM;YAC1B;YArBA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAmBF;IACF;IACA,SAAS;QACP,aAAa;QACb,OAAO,eAAO,YAAY;IAC5B;AACF","sources":["packages/@react-aria/test-utils/src/testSetup.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).\n */\nexport function installMouseEvent() {\n beforeAll(() => {\n let oldMouseEvent = MouseEvent;\n // @ts-ignore\n global.MouseEvent = class FakeMouseEvent extends MouseEvent {\n _init: {pageX: number, pageY: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n };\n // @ts-ignore\n global.MouseEvent.oldMouseEvent = oldMouseEvent;\n });\n afterAll(() => {\n // @ts-ignore\n global.MouseEvent = global.MouseEvent.oldMouseEvent;\n });\n}\n\nexport function installPointerEvent() {\n beforeAll(() => {\n // @ts-ignore\n global.PointerEvent = class FakePointerEvent extends MouseEvent {\n _init: {pageX: number, pageY: number, pointerType: string, pointerId: number, width: number, height: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pointerType() {\n return this._init.pointerType ?? 'mouse';\n }\n get pointerId() {\n return this._init.pointerId;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n get width() {\n return this._init.width;\n }\n get height() {\n return this._init.height;\n }\n };\n });\n afterAll(() => {\n // @ts-ignore\n delete global.PointerEvent;\n });\n}\n"],"names":[],"version":3,"file":"testSetup.module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC,GAED;;CAEC,GACM,SAAS;IACd,IAAI,gBAAgB;IACpB,UAAU;QACR,eAAO,UAAU,GAAG,MAAM,uBAAuB;YAM/C,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YATA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAOF;IACF;IACA,SAAS;QACP,eAAO,UAAU,GAAG;IACtB;AACF;AAEO,SAAS;IACd,UAAU;QACR,aAAa;QACb,eAAO,YAAY,GAAG,MAAM,yBAAyB;YAMnD,IAAI,cAAc;oBACT;gBAAP,OAAO,CAAA,0BAAA,IAAI,CAAC,KAAK,CAAC,WAAW,cAAtB,qCAAA,0BAA0B;YACnC;YACA,IAAI,YAAY;gBACd,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS;YAC7B;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,QAAQ;gBACV,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK;YACzB;YACA,IAAI,SAAS;gBACX,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM;YAC1B;YArBA,YAAY,IAAI,EAAE,IAAI,CAAE;gBACtB,KAAK,CAAC,MAAM;gBACZ,IAAI,CAAC,KAAK,GAAG;YACf;QAmBF;IACF;IACA,SAAS;QACP,aAAa;QACb,OAAO,eAAO,YAAY;IAC5B;AACF","sources":["packages/@react-aria/test-utils/src/testSetup.ts"],"sourcesContent":["/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).\n */\nexport function installMouseEvent() {\n let oldMouseEvent = MouseEvent;\n beforeAll(() => {\n global.MouseEvent = class FakeMouseEvent extends MouseEvent {\n _init: {pageX: number, pageY: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n };\n });\n afterAll(() => {\n global.MouseEvent = oldMouseEvent;\n });\n}\n\nexport function installPointerEvent() {\n beforeAll(() => {\n // @ts-ignore\n global.PointerEvent = class FakePointerEvent extends MouseEvent {\n _init: {pageX: number, pageY: number, pointerType: string, pointerId: number, width: number, height: number};\n constructor(name, init) {\n super(name, init);\n this._init = init;\n }\n get pointerType() {\n return this._init.pointerType ?? 'mouse';\n }\n get pointerId() {\n return this._init.pointerId;\n }\n get pageX() {\n return this._init.pageX;\n }\n get pageY() {\n return this._init.pageY;\n }\n get width() {\n return this._init.width;\n }\n get height() {\n return this._init.height;\n }\n };\n });\n afterAll(() => {\n // @ts-ignore\n delete global.PointerEvent;\n });\n}\n"],"names":[],"version":3,"file":"testSetup.module.js.map"}
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { pointerKey } from "@testing-library/user-event/system/pointer/shared";
2
2
  interface ComboBoxOptions extends UserOpts, BaseTesterOpts {
3
- user: any;
3
+ user?: any;
4
4
  trigger?: HTMLElement;
5
5
  }
6
6
  declare class ComboBoxTester {
@@ -18,16 +18,16 @@ declare class ComboBoxTester {
18
18
  }) => Promise<void>;
19
19
  close: () => Promise<void>;
20
20
  get combobox(): HTMLElement;
21
- get trigger(): HTMLElement;
22
- get listbox(): HTMLElement;
21
+ get trigger(): HTMLElement | undefined;
22
+ get listbox(): HTMLElement | undefined;
23
23
  options: (opts?: {
24
24
  element?: HTMLElement;
25
25
  }) => HTMLElement[] | never[];
26
26
  get sections(): HTMLElement[];
27
- get focusedOption(): HTMLElement;
27
+ get focusedOption(): HTMLElement | null | undefined;
28
28
  }
29
29
  interface GridListOptions extends UserOpts, BaseTesterOpts {
30
- user: any;
30
+ user?: any;
31
31
  }
32
32
  declare class GridListTester {
33
33
  constructor(opts: GridListOptions);
@@ -55,7 +55,8 @@ declare class GridListTester {
55
55
  }) => HTMLElement[];
56
56
  }
57
57
  interface MenuOptions extends UserOpts, BaseTesterOpts {
58
- user: any;
58
+ user?: any;
59
+ isSubmenu?: boolean;
59
60
  }
60
61
  declare class MenuTester {
61
62
  constructor(opts: MenuOptions);
@@ -63,6 +64,7 @@ declare class MenuTester {
63
64
  open: (opts?: {
64
65
  needsLongPress?: boolean;
65
66
  interactionType?: UserOpts["interactionType"];
67
+ direction?: "up" | "down";
66
68
  }) => Promise<void>;
67
69
  selectOption: (opts: {
68
70
  option?: HTMLElement;
@@ -71,6 +73,7 @@ declare class MenuTester {
71
73
  needsLongPress?: boolean;
72
74
  closesOnSelect?: boolean;
73
75
  interactionType?: UserOpts["interactionType"];
76
+ keyboardActivation?: "Space" | "Enter";
74
77
  }) => Promise<void>;
75
78
  openSubmenu: (opts: {
76
79
  submenuTrigger?: HTMLElement;
@@ -78,15 +81,18 @@ declare class MenuTester {
78
81
  needsLongPress?: boolean;
79
82
  interactionType?: UserOpts["interactionType"];
80
83
  }) => Promise<MenuTester | null>;
84
+ keyboardNavigateToOption: (opts: {
85
+ option: HTMLElement;
86
+ }) => Promise<void>;
81
87
  close: () => Promise<void>;
82
88
  get trigger(): HTMLElement;
83
- get menu(): HTMLElement;
84
- get options(): HTMLElement[] | never[];
89
+ get menu(): HTMLElement | null | undefined;
90
+ get options(): HTMLElement[];
85
91
  get sections(): HTMLElement[];
86
92
  get submenuTriggers(): HTMLElement[];
87
93
  }
88
94
  interface SelectOptions extends UserOpts, BaseTesterOpts {
89
- user: any;
95
+ user?: any;
90
96
  }
91
97
  declare class SelectTester {
92
98
  constructor(opts: SelectOptions);
@@ -100,12 +106,12 @@ declare class SelectTester {
100
106
  }) => Promise<void>;
101
107
  close: () => Promise<void>;
102
108
  get trigger(): HTMLElement;
103
- get listbox(): HTMLElement;
109
+ get listbox(): HTMLElement | null | undefined;
104
110
  get options(): HTMLElement[];
105
111
  get sections(): HTMLElement[];
106
112
  }
107
113
  interface TableOptions extends UserOpts, BaseTesterOpts {
108
- user: any;
114
+ user?: any;
109
115
  advanceTimer: UserOpts['advanceTimer'];
110
116
  }
111
117
  declare class TableTester {
@@ -1 +1 @@
1
- {"mappings":";AAeA,yBAAiC,SAAQ,QAAQ,EAAE,cAAc;IAC/D,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB;AAED;gBAMc,IAAI,EAAE,eAAe;IA4BjC,kBAAkB,SAAU,QAAQ,CAAC,iBAAiB,CAAC,UAErD;IAEF,IAAI,UAAgB;QAAC,eAAe,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;QAAC,eAAe,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAA;KAAC,mBAwCvG;IAEF,YAAY,UAAgB;QAAC,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC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,CAAC,CAAC;CAGjG;ACvDD;;;;;;GAMG;AACH,iCAAuC,IAAI,EAAE;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,YAAY,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,EAAE,CAAA;CAAC,iBAQ9I;ACpBD;;GAEG;AACH,0CAwBC;AAED,4CAiCC;ACxED,OAAO,IAAI,YAAY,UAAU,EAOL,CAAC","sources":["packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/combobox.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/gridlist.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/menu.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/select.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/table.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/user.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/events.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/testSetup.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/userEventMaps.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/index.ts","packages/@react-aria/test-utils/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {triggerLongPress} from './events';\nexport {installMouseEvent, installPointerEvent} from './testSetup';\nexport {pointerMap} from './userEventMaps';\nexport {User} from './user';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AAC,IACb,CAAC,SAAS,QAAQ,GAAG,YAAY,GACjC,CAAC,SAAS,OAAO,GAAG,WAAW,GAC/B,CAAC,SAAS,MAAM,GAAG,UAAU,GAC7B,CAAC,SAAS,UAAU,GAAG,cAAc,GACrC,CAAC,SAAS,UAAU,GAAG,cAAc,GACrC,KAAK,CAAC;AAEV,wBAAwB,CAAC,IACvB,CAAC,SAAS,QAAQ,GAAG,aAAa,GAClC,CAAC,SAAS,OAAO,GAAG,YAAY,GAChC,CAAC,SAAS,MAAM,GAAG,WAAW,GAC9B,CAAC,SAAS,UAAU,GAAG,eAAe,GACtC,CAAC,SAAS,UAAU,GAAG,eAAe,GACtC,KAAK,CAAC;AAIR;IACE,IAAI,MAAC;IACL,eAAe,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC7C,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;gBAE3B,IAAI,GAAE,QAAa;IAO/B,YAAY,CAAC,CAAC,SAAS,YAAY,EAAE,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,mBAAmB,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC;CAGjG;ACvDD;;;;;;GAMG;AACH,iCAAuC,IAAI,EAAE;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,YAAY,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,EAAE,CAAA;CAAC,iBAQ9I;ACpBD;;GAEG;AACH,0CAoBC;AAED,4CAiCC;ACpED,OAAO,IAAI,YAAY,UAAU,EAOL,CAAC","sources":["packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/combobox.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/gridlist.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/menu.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/select.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/table.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/user.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/events.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/testSetup.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/userEventMaps.ts","packages/@react-aria/test-utils/src/packages/@react-aria/test-utils/src/index.ts","packages/@react-aria/test-utils/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {triggerLongPress} from './events';\nexport {installMouseEvent, installPointerEvent} from './testSetup';\nexport {pointerMap} from './userEventMaps';\nexport {User} from './user';\n\nexport type {UserOpts} from './user';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/dist/user.main.js CHANGED
@@ -44,10 +44,10 @@ let $4168d511756883ff$var$defaultAdvanceTimer = async (waitTime)=>await new Prom
44
44
  class $4168d511756883ff$export$1f44aaf2ec115b54 {
45
45
  createTester(patternName, opts) {
46
46
  return new $4168d511756883ff$var$keyToUtil[patternName]({
47
- ...opts,
48
47
  user: this.user,
49
48
  interactionType: this.interactionType,
50
- advanceTimer: this.advanceTimer
49
+ advanceTimer: this.advanceTimer,
50
+ ...opts
51
51
  });
52
52
  }
53
53
  constructor(opts = {}){
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBD,IAAI,kCAAY;IAAC,UAAU,CAAA,GAAA,sCAAW;IAAG,SAAS,CAAA,GAAA,qCAAU;IAAG,QAAQ,CAAA,GAAA,oCAAS;IAAG,YAAY,CAAA,GAAA,wCAAa;IAAG,YAAY,CAAA,GAAA,wCAAa;AAAC;AAoBzI,IAAI,4CAAsB,OAAO,WAAiC,MAAM,IAAI,QAAQ,CAAC,UAAY,WAAW,SAAS;AAE9G,MAAM;IAYX,aAAqC,WAAc,EAAE,IAA2B,EAAiB;QAC/F,OAAO,IAAI,AAAC,+BAAU,CAAC,YAAY,CAAC;YAAC,GAAG,IAAI;YAAE,MAAM,IAAI,CAAC,IAAI;YAAE,iBAAiB,IAAI,CAAC,eAAe;YAAE,cAAc,IAAI,CAAC,YAAY;QAAA;IACvI;IATA,YAAY,OAAiB,CAAC,CAAC,CAAE;QAC/B,IAAI,mBAAC,eAAe,gBAAE,YAAY,EAAC,GAAG;QACtC,IAAI,CAAC,IAAI,GAAG,CAAA,GAAA,wDAAQ,EAAE,KAAK,CAAC;YAAC,OAAO;wBAAM;QAAU;QACpD,IAAI,CAAC,eAAe,GAAG;QACvB,IAAI,CAAC,YAAY,GAAG,gBAAgB;IACtC;AAKF","sources":["packages/@react-aria/test-utils/src/user.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ComboBoxOptions, ComboBoxTester} from './combobox';\nimport {GridListOptions, GridListTester} from './gridlist';\nimport {MenuOptions, MenuTester} from './menu';\nimport {pointerMap} from './';\nimport {SelectOptions, SelectTester} from './select';\nimport {TableOptions, TableTester} from './table';\nimport userEvent from '@testing-library/user-event';\n\n// https://github.com/testing-library/dom-testing-library/issues/939#issuecomment-830771708 is an interesting way of allowing users to configure the timers\n// curent way is like https://testing-library.com/docs/user-event/options/#advancetimers,\nexport interface UserOpts {\n interactionType?: 'mouse' | 'touch' | 'keyboard',\n // If using fake timers user should provide something like (time) => jest.advanceTimersByTime(time))}\n // A real timer user would pass async () => await new Promise((resolve) => setTimeout(resolve, waitTime))\n // Time is in ms.\n advanceTimer?: (time?: number) => void | Promise<unknown>\n}\n\nexport interface BaseTesterOpts {\n // The base element for the given tester (e.g. the table, menu trigger, etc)\n root: HTMLElement\n}\n\nlet keyToUtil = {'Select': SelectTester, 'Table': TableTester, 'Menu': MenuTester, 'ComboBox': ComboBoxTester, 'GridList': GridListTester} as const;\nexport type PatternNames = keyof typeof keyToUtil;\n\n// Conditional type: https://www.typescriptlang.org/docs/handbook/2/conditional-types.html\ntype ObjectType<T> =\n T extends 'Select' ? SelectTester :\n T extends 'Table' ? TableTester :\n T extends 'Menu' ? MenuTester :\n T extends 'ComboBox' ? ComboBoxTester :\n T extends 'GridList' ? GridListTester :\n never;\n\ntype ObjectOptionsTypes<T> =\n T extends 'Select' ? SelectOptions :\n T extends 'Table' ? TableOptions :\n T extends 'Menu' ? MenuOptions :\n T extends 'ComboBox' ? ComboBoxOptions :\n T extends 'GridList' ? GridListOptions :\n never;\n\nlet defaultAdvanceTimer = async (waitTime: number | undefined) => await new Promise((resolve) => setTimeout(resolve, waitTime));\n\nexport class User {\n user;\n interactionType: UserOpts['interactionType'];\n advanceTimer: UserOpts['advanceTimer'];\n\n constructor(opts: UserOpts = {}) {\n let {interactionType, advanceTimer} = opts;\n this.user = userEvent.setup({delay: null, pointerMap});\n this.interactionType = interactionType;\n this.advanceTimer = advanceTimer || defaultAdvanceTimer;\n }\n\n createTester<T extends PatternNames>(patternName: T, opts: ObjectOptionsTypes<T>): ObjectType<T> {\n return new (keyToUtil)[patternName]({...opts, user: this.user, interactionType: this.interactionType, advanceTimer: this.advanceTimer}) as ObjectType<T>;\n }\n}\n"],"names":[],"version":3,"file":"user.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBD,IAAI,kCAAY;IAAC,UAAU,CAAA,GAAA,sCAAW;IAAG,SAAS,CAAA,GAAA,qCAAU;IAAG,QAAQ,CAAA,GAAA,oCAAS;IAAG,YAAY,CAAA,GAAA,wCAAa;IAAG,YAAY,CAAA,GAAA,wCAAa;AAAC;AAoBzI,IAAI,4CAAsB,OAAO,WAAiC,MAAM,IAAI,QAAQ,CAAC,UAAY,WAAW,SAAS;AAE9G,MAAM;IAYX,aAAqC,WAAc,EAAE,IAA2B,EAAiB;QAC/F,OAAO,IAAI,AAAC,+BAAU,CAAC,YAAY,CAAC;YAAC,MAAM,IAAI,CAAC,IAAI;YAAE,iBAAiB,IAAI,CAAC,eAAe;YAAE,cAAc,IAAI,CAAC,YAAY;YAAE,GAAG,IAAI;QAAA;IACvI;IATA,YAAY,OAAiB,CAAC,CAAC,CAAE;QAC/B,IAAI,mBAAC,eAAe,gBAAE,YAAY,EAAC,GAAG;QACtC,IAAI,CAAC,IAAI,GAAG,CAAA,GAAA,wDAAQ,EAAE,KAAK,CAAC;YAAC,OAAO;wBAAM;QAAU;QACpD,IAAI,CAAC,eAAe,GAAG;QACvB,IAAI,CAAC,YAAY,GAAG,gBAAgB;IACtC;AAKF","sources":["packages/@react-aria/test-utils/src/user.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ComboBoxOptions, ComboBoxTester} from './combobox';\nimport {GridListOptions, GridListTester} from './gridlist';\nimport {MenuOptions, MenuTester} from './menu';\nimport {pointerMap} from './';\nimport {SelectOptions, SelectTester} from './select';\nimport {TableOptions, TableTester} from './table';\nimport userEvent from '@testing-library/user-event';\n\n// https://github.com/testing-library/dom-testing-library/issues/939#issuecomment-830771708 is an interesting way of allowing users to configure the timers\n// curent way is like https://testing-library.com/docs/user-event/options/#advancetimers,\nexport interface UserOpts {\n interactionType?: 'mouse' | 'touch' | 'keyboard',\n // If using fake timers user should provide something like (time) => jest.advanceTimersByTime(time))}\n // A real timer user would pass async () => await new Promise((resolve) => setTimeout(resolve, waitTime))\n // Time is in ms.\n advanceTimer?: (time?: number) => void | Promise<unknown>\n}\n\nexport interface BaseTesterOpts {\n // The base element for the given tester (e.g. the table, menu trigger, etc)\n root: HTMLElement\n}\n\nlet keyToUtil = {'Select': SelectTester, 'Table': TableTester, 'Menu': MenuTester, 'ComboBox': ComboBoxTester, 'GridList': GridListTester} as const;\nexport type PatternNames = keyof typeof keyToUtil;\n\n// Conditional type: https://www.typescriptlang.org/docs/handbook/2/conditional-types.html\ntype ObjectType<T> =\n T extends 'Select' ? SelectTester :\n T extends 'Table' ? TableTester :\n T extends 'Menu' ? MenuTester :\n T extends 'ComboBox' ? ComboBoxTester :\n T extends 'GridList' ? GridListTester :\n never;\n\ntype ObjectOptionsTypes<T> =\n T extends 'Select' ? SelectOptions :\n T extends 'Table' ? TableOptions :\n T extends 'Menu' ? MenuOptions :\n T extends 'ComboBox' ? ComboBoxOptions :\n T extends 'GridList' ? GridListOptions :\n never;\n\nlet defaultAdvanceTimer = async (waitTime: number | undefined) => await new Promise((resolve) => setTimeout(resolve, waitTime));\n\nexport class User {\n user;\n interactionType: UserOpts['interactionType'];\n advanceTimer: UserOpts['advanceTimer'];\n\n constructor(opts: UserOpts = {}) {\n let {interactionType, advanceTimer} = opts;\n this.user = userEvent.setup({delay: null, pointerMap});\n this.interactionType = interactionType;\n this.advanceTimer = advanceTimer || defaultAdvanceTimer;\n }\n\n createTester<T extends PatternNames>(patternName: T, opts: ObjectOptionsTypes<T>): ObjectType<T> {\n return new (keyToUtil)[patternName]({user: this.user, interactionType: this.interactionType, advanceTimer: this.advanceTimer, ...opts}) as ObjectType<T>;\n }\n}\n"],"names":[],"version":3,"file":"user.main.js.map"}
package/dist/user.mjs CHANGED
@@ -34,10 +34,10 @@ let $0d71b4e9cc4df40a$var$defaultAdvanceTimer = async (waitTime)=>await new Prom
34
34
  class $0d71b4e9cc4df40a$export$1f44aaf2ec115b54 {
35
35
  createTester(patternName, opts) {
36
36
  return new $0d71b4e9cc4df40a$var$keyToUtil[patternName]({
37
- ...opts,
38
37
  user: this.user,
39
38
  interactionType: this.interactionType,
40
- advanceTimer: this.advanceTimer
39
+ advanceTimer: this.advanceTimer,
40
+ ...opts
41
41
  });
42
42
  }
43
43
  constructor(opts = {}){
@@ -34,10 +34,10 @@ let $0d71b4e9cc4df40a$var$defaultAdvanceTimer = async (waitTime)=>await new Prom
34
34
  class $0d71b4e9cc4df40a$export$1f44aaf2ec115b54 {
35
35
  createTester(patternName, opts) {
36
36
  return new $0d71b4e9cc4df40a$var$keyToUtil[patternName]({
37
- ...opts,
38
37
  user: this.user,
39
38
  interactionType: this.interactionType,
40
- advanceTimer: this.advanceTimer
39
+ advanceTimer: this.advanceTimer,
40
+ ...opts
41
41
  });
42
42
  }
43
43
  constructor(opts = {}){
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBD,IAAI,kCAAY;IAAC,UAAU,CAAA,GAAA,yCAAW;IAAG,SAAS,CAAA,GAAA,wCAAU;IAAG,QAAQ,CAAA,GAAA,yCAAS;IAAG,YAAY,CAAA,GAAA,yCAAa;IAAG,YAAY,CAAA,GAAA,yCAAa;AAAC;AAoBzI,IAAI,4CAAsB,OAAO,WAAiC,MAAM,IAAI,QAAQ,CAAC,UAAY,WAAW,SAAS;AAE9G,MAAM;IAYX,aAAqC,WAAc,EAAE,IAA2B,EAAiB;QAC/F,OAAO,IAAI,AAAC,+BAAU,CAAC,YAAY,CAAC;YAAC,GAAG,IAAI;YAAE,MAAM,IAAI,CAAC,IAAI;YAAE,iBAAiB,IAAI,CAAC,eAAe;YAAE,cAAc,IAAI,CAAC,YAAY;QAAA;IACvI;IATA,YAAY,OAAiB,CAAC,CAAC,CAAE;QAC/B,IAAI,mBAAC,eAAe,gBAAE,YAAY,EAAC,GAAG;QACtC,IAAI,CAAC,IAAI,GAAG,CAAA,GAAA,8BAAQ,EAAE,KAAK,CAAC;YAAC,OAAO;wBAAM;QAAU;QACpD,IAAI,CAAC,eAAe,GAAG;QACvB,IAAI,CAAC,YAAY,GAAG,gBAAgB;IACtC;AAKF","sources":["packages/@react-aria/test-utils/src/user.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ComboBoxOptions, ComboBoxTester} from './combobox';\nimport {GridListOptions, GridListTester} from './gridlist';\nimport {MenuOptions, MenuTester} from './menu';\nimport {pointerMap} from './';\nimport {SelectOptions, SelectTester} from './select';\nimport {TableOptions, TableTester} from './table';\nimport userEvent from '@testing-library/user-event';\n\n// https://github.com/testing-library/dom-testing-library/issues/939#issuecomment-830771708 is an interesting way of allowing users to configure the timers\n// curent way is like https://testing-library.com/docs/user-event/options/#advancetimers,\nexport interface UserOpts {\n interactionType?: 'mouse' | 'touch' | 'keyboard',\n // If using fake timers user should provide something like (time) => jest.advanceTimersByTime(time))}\n // A real timer user would pass async () => await new Promise((resolve) => setTimeout(resolve, waitTime))\n // Time is in ms.\n advanceTimer?: (time?: number) => void | Promise<unknown>\n}\n\nexport interface BaseTesterOpts {\n // The base element for the given tester (e.g. the table, menu trigger, etc)\n root: HTMLElement\n}\n\nlet keyToUtil = {'Select': SelectTester, 'Table': TableTester, 'Menu': MenuTester, 'ComboBox': ComboBoxTester, 'GridList': GridListTester} as const;\nexport type PatternNames = keyof typeof keyToUtil;\n\n// Conditional type: https://www.typescriptlang.org/docs/handbook/2/conditional-types.html\ntype ObjectType<T> =\n T extends 'Select' ? SelectTester :\n T extends 'Table' ? TableTester :\n T extends 'Menu' ? MenuTester :\n T extends 'ComboBox' ? ComboBoxTester :\n T extends 'GridList' ? GridListTester :\n never;\n\ntype ObjectOptionsTypes<T> =\n T extends 'Select' ? SelectOptions :\n T extends 'Table' ? TableOptions :\n T extends 'Menu' ? MenuOptions :\n T extends 'ComboBox' ? ComboBoxOptions :\n T extends 'GridList' ? GridListOptions :\n never;\n\nlet defaultAdvanceTimer = async (waitTime: number | undefined) => await new Promise((resolve) => setTimeout(resolve, waitTime));\n\nexport class User {\n user;\n interactionType: UserOpts['interactionType'];\n advanceTimer: UserOpts['advanceTimer'];\n\n constructor(opts: UserOpts = {}) {\n let {interactionType, advanceTimer} = opts;\n this.user = userEvent.setup({delay: null, pointerMap});\n this.interactionType = interactionType;\n this.advanceTimer = advanceTimer || defaultAdvanceTimer;\n }\n\n createTester<T extends PatternNames>(patternName: T, opts: ObjectOptionsTypes<T>): ObjectType<T> {\n return new (keyToUtil)[patternName]({...opts, user: this.user, interactionType: this.interactionType, advanceTimer: this.advanceTimer}) as ObjectType<T>;\n }\n}\n"],"names":[],"version":3,"file":"user.module.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAyBD,IAAI,kCAAY;IAAC,UAAU,CAAA,GAAA,yCAAW;IAAG,SAAS,CAAA,GAAA,wCAAU;IAAG,QAAQ,CAAA,GAAA,yCAAS;IAAG,YAAY,CAAA,GAAA,yCAAa;IAAG,YAAY,CAAA,GAAA,yCAAa;AAAC;AAoBzI,IAAI,4CAAsB,OAAO,WAAiC,MAAM,IAAI,QAAQ,CAAC,UAAY,WAAW,SAAS;AAE9G,MAAM;IAYX,aAAqC,WAAc,EAAE,IAA2B,EAAiB;QAC/F,OAAO,IAAI,AAAC,+BAAU,CAAC,YAAY,CAAC;YAAC,MAAM,IAAI,CAAC,IAAI;YAAE,iBAAiB,IAAI,CAAC,eAAe;YAAE,cAAc,IAAI,CAAC,YAAY;YAAE,GAAG,IAAI;QAAA;IACvI;IATA,YAAY,OAAiB,CAAC,CAAC,CAAE;QAC/B,IAAI,mBAAC,eAAe,gBAAE,YAAY,EAAC,GAAG;QACtC,IAAI,CAAC,IAAI,GAAG,CAAA,GAAA,8BAAQ,EAAE,KAAK,CAAC;YAAC,OAAO;wBAAM;QAAU;QACpD,IAAI,CAAC,eAAe,GAAG;QACvB,IAAI,CAAC,YAAY,GAAG,gBAAgB;IACtC;AAKF","sources":["packages/@react-aria/test-utils/src/user.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ComboBoxOptions, ComboBoxTester} from './combobox';\nimport {GridListOptions, GridListTester} from './gridlist';\nimport {MenuOptions, MenuTester} from './menu';\nimport {pointerMap} from './';\nimport {SelectOptions, SelectTester} from './select';\nimport {TableOptions, TableTester} from './table';\nimport userEvent from '@testing-library/user-event';\n\n// https://github.com/testing-library/dom-testing-library/issues/939#issuecomment-830771708 is an interesting way of allowing users to configure the timers\n// curent way is like https://testing-library.com/docs/user-event/options/#advancetimers,\nexport interface UserOpts {\n interactionType?: 'mouse' | 'touch' | 'keyboard',\n // If using fake timers user should provide something like (time) => jest.advanceTimersByTime(time))}\n // A real timer user would pass async () => await new Promise((resolve) => setTimeout(resolve, waitTime))\n // Time is in ms.\n advanceTimer?: (time?: number) => void | Promise<unknown>\n}\n\nexport interface BaseTesterOpts {\n // The base element for the given tester (e.g. the table, menu trigger, etc)\n root: HTMLElement\n}\n\nlet keyToUtil = {'Select': SelectTester, 'Table': TableTester, 'Menu': MenuTester, 'ComboBox': ComboBoxTester, 'GridList': GridListTester} as const;\nexport type PatternNames = keyof typeof keyToUtil;\n\n// Conditional type: https://www.typescriptlang.org/docs/handbook/2/conditional-types.html\ntype ObjectType<T> =\n T extends 'Select' ? SelectTester :\n T extends 'Table' ? TableTester :\n T extends 'Menu' ? MenuTester :\n T extends 'ComboBox' ? ComboBoxTester :\n T extends 'GridList' ? GridListTester :\n never;\n\ntype ObjectOptionsTypes<T> =\n T extends 'Select' ? SelectOptions :\n T extends 'Table' ? TableOptions :\n T extends 'Menu' ? MenuOptions :\n T extends 'ComboBox' ? ComboBoxOptions :\n T extends 'GridList' ? GridListOptions :\n never;\n\nlet defaultAdvanceTimer = async (waitTime: number | undefined) => await new Promise((resolve) => setTimeout(resolve, waitTime));\n\nexport class User {\n user;\n interactionType: UserOpts['interactionType'];\n advanceTimer: UserOpts['advanceTimer'];\n\n constructor(opts: UserOpts = {}) {\n let {interactionType, advanceTimer} = opts;\n this.user = userEvent.setup({delay: null, pointerMap});\n this.interactionType = interactionType;\n this.advanceTimer = advanceTimer || defaultAdvanceTimer;\n }\n\n createTester<T extends PatternNames>(patternName: T, opts: ObjectOptionsTypes<T>): ObjectType<T> {\n return new (keyToUtil)[patternName]({user: this.user, interactionType: this.interactionType, advanceTimer: this.advanceTimer, ...opts}) as ObjectType<T>;\n }\n}\n"],"names":[],"version":3,"file":"user.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/test-utils",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.3",
4
4
  "description": "Testing utils for react-aria patterns",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -28,9 +28,10 @@
28
28
  "@testing-library/react": "^15.0.7",
29
29
  "@testing-library/user-event": "^13.0.0 || ^14.0.0",
30
30
  "jest": "^29.5.0",
31
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
31
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"
35
- }
36
- }
35
+ },
36
+ "gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
37
+ }
package/src/combobox.ts CHANGED
@@ -14,7 +14,7 @@ import {act, waitFor, within} from '@testing-library/react';
14
14
  import {BaseTesterOpts, UserOpts} from './user';
15
15
 
16
16
  export interface ComboBoxOptions extends UserOpts, BaseTesterOpts {
17
- user: any,
17
+ user?: any,
18
18
  trigger?: HTMLElement
19
19
  }
20
20
 
package/src/gridlist.ts CHANGED
@@ -15,7 +15,7 @@ import {BaseTesterOpts, UserOpts} from './user';
15
15
  import {pressElement} from './events';
16
16
 
17
17
  export interface GridListOptions extends UserOpts, BaseTesterOpts {
18
- user: any
18
+ user?: any
19
19
  }
20
20
  export class GridListTester {
21
21
  private user;