react-spectrum
5ae23460 - Aria pattern utils (#6208)

Commit
1 year ago
Aria pattern utils (#6208) * rough progress in refactoring api and testing timers * update RAC select tests to use the select util * fix edge cases and add flows for different interaction patterns * adding sections and removing valueElement, wrapping up final conversions for Picker tests only modified some of the Picker tests to leverage the utils where I deemed appropriate. Mainly where selection/opening of the Picker wasnt the main focus of the test or if the test itself wasnt checking stuff about the item nodes themselves. * add initial table util scaffolding mostly from old PR, adapted to fit the new api * testing against the RAC tests/React 16/17 had to add an increased test timeout for React 16 tests * more testing of long press, add findCell/findRow * test all the different interaction types the keyboard sort change util function isnt working properly, investigating. The focus isnt being restored to the right place * use click for now for some keyboard operations focus management and certain elements arent working properly, see comments * fix keyboard interaction for sort column util * figure out the proper timeout for realTimers * lint * fix docs and build point * forgot comma in rebase * Update packages/@react-spectrum/table/test/Table.test.js * go with factory instead of having the testers created in constructor this avoids possible issues with the same tester being used across multiple tests and getting in a weird state in parallel runs * fix select tests * replace jest expects with generic assertion this makes it so the test utils arent specific to jest * initial menu tester util * Fixing strict and using MenuTester in tests * fix failing tests * fix react 17 test * add combobox util * test combobox util * get rid of setText and add some additional utilities setText is a bit trouble some because we arent sure if the user wants to simulate a realistic typing flow and/or needs to perform a delete operation to clear the field so will leave that operation to them. * inital gridlist tester * refactor gridlist util * refactor combobox and menu * refactor select for consistency * refactor table for consistency * add selected row getter for looking at tests in quarry * have user provide callback for advancing timers this means we can handle real timers vs fake timers without needing to rely on jest or handling detection ourselves * update createTester so we get proper return types when creating a tester * fix lint and react 19 test * fix tsstrict and tests * review comments * make useLongPress accept mouse or touch * refactor so setting root element is done in contructor * refactor combobox tests so they dont destructure * refactor the rest of the utils to avoid destruct * support passing in interaction type directly when calling interaction * update api as per feedback and remove unnecessary warning * cleanup and lower test timeout to minimum to work in react 16 * fix strict and revert jest timing build failed with 15000 timeout which passed locally... --------- Co-authored-by: Robert Snow <rsnow@adobe.com>
Author
Parents
Loading