890 Commits

Author SHA1 Message Date
Maciej Jastrzębski b3136608e6 v12.3.0 v12.3.0 2023-09-06 20:59:36 +02:00
Maciej Jastrzebski 3fa6c457ea feat: aria-value* props support (#1480)
* feat: aria-value* props support

* refactor: tweaks

* chore: fix code cov
2023-09-06 17:16:21 +02:00
Maciej Jastrzebski 5dbd04f4be feat: aria-modal support (#1481)
* feat: `aria-modal` support

* chore: add API assumptions tests
2023-09-06 12:37:08 +02:00
Kyaw Thura 5a7c693ea2 feat: toBeChecked & toBePartiallyChecked matcher (#1479)
* feat: added toBeChecked & toBePartiallyChecked

* test: wip test

* fix: fix typo

* test: added more test

* fix: fixed throw error

* test: added throw error test

* refactor: refactor matchers

* refactor: tweaks

* refactor: final tweaks

* chore: fix ts

---------

Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2023-09-04 23:44:24 +02:00
AntoineThibi 2d96b777b1 feat: toHaveProp matcher (#1477)
* feat: implement toHaveProp

* refactor: use screen in the test

* refactor: tweaks

* refactor: tweaks

* refactor: final polishing

* refactor: cleanup

---------

Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2023-09-01 23:14:26 +02:00
Jan Jaworski 4659bba132 feat: toBeDisabled matcher (#1469)
* feat: add toBeDisabled matcher

* add tests and toBeEnabled matcher

* update logic and tests

* add test to validate toBeDisabled with parent elements

* better name

* refactor: tweaks and improvements

* chore: tweak fo

* refactor: tests

* chore: fix tests

---------

Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2023-09-01 17:15:14 +02:00
Maciej Jastrzebski 3ff0afb119 docs: setup automatic table of contents (#1482)
* docs: automate table of contents for all pages
* docs: custom anchors
* docs: tweaks
2023-08-31 22:33:03 +02:00
Maciej Jastrzebski 5cbe69af07 feat: accessibility state (#1478)
chore: add tests, update docs
2023-08-31 15:33:41 +02:00
Maciej Jastrzebski da0a888df7 feat: support aria-label and aria-labelledby props (#1475)
* feat: support aria-label and aria-labelledby props

* refactor: tweaks

* chore: revert unintended docs changes
2023-08-31 15:29:38 +02:00
Maciej Jastrzebski 054f36d158 feat: support role prop (#1476) 2023-08-31 15:23:00 +02:00
Maciej Jastrzebski 238c860088 feat: support aria-hidden prop (#1474) 2023-08-31 15:17:51 +02:00
Thiago Brezinski f0fee3512a feat: toBeVisible matcher (#1465)
* feat: add toBeVisible matcher

* test(toBeVisible): improve snapshot matching

* chore: detect Modal as host component

* chore: fix tests to host component names

* refactor: merge accessibility related code with existing utils

* chore: add comments

* refactor: tweak unit test

* chore: fix test

* refactor: tweaks

---------

Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2023-08-25 13:45:19 +02:00
Maciej Jastrzebski b428cc5f20 feat: toHaveTextContent() matcher (#1461)
* feat: toHaveTextContent() matcher

chore: fix typescript, remove legacy jest-native tests

* refactor: tweaks
2023-08-24 22:29:18 +02:00
Maciej Jastrzebski 344e9b3bdf feat: toHaveDisplayValue matcher (#1463)
* feat: to have display value

* add tests for toHaveDisplayValue()

* update type of toHaveDisplayValue matcher

* rename test file

* format

* chore: add more tests

* refactor: extract common TextInput utils

* chore: fix codecov

---------

Co-authored-by: Jan Jaworski <jaworek3211@gmail.com>
2023-08-24 22:11:11 +02:00
Frieder Bluemle a7f250d930 Fix changelog commit range in v12 migration guide (#1470) 2023-08-24 09:52:28 +02:00
Kyaw Thura cf08c069c2 feat: toBeEmptyElement matcher (#1462)
* feat: implement toBeEmptyElement

* refactor: tweak formatting and tests

---------

Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2023-08-22 12:09:22 +02:00
Pierre Zimmermann 4148038444 fix: flatlist not rendering in rntl repo (#1467)
* fix: flatlist not rendering in rntl repo

* refactor: move render tests to RN tests file

---------

Co-authored-by: pierrezimmermann <pierrez@nam.tech>
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2023-08-22 11:24:30 +02:00
Maciej Jastrzebski 4a8072dbe6 feat: add Jest matchers utils (#1464)
* feat: add formatMessage

* feat: add TS extends

* chore: remove old Jest Native tests
2023-08-20 00:22:58 +02:00
Matthew Tilley 89874141c2 Update GettingStarted.md (#1460) 2023-08-19 12:36:43 +02:00
Maciej Jastrzebski 4bfd7fbc6b feature: Jest matchers core (#1454)
* chore: jest matchers.

* refactor: cleanup

* chore: test for not exposing matchers by default

* chore: cleanup

* refactor: finishing touches

* chore: improve code cov

* Update package.json

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>

* refactor: code review changes
2023-08-17 10:07:17 +02:00
Maciej Jastrzebski cae05837a8 chore: Jest snapshot pluging for strip ansi (#1455) 2023-08-16 14:11:48 +02:00
Maciej Jastrzębski 316324af1c v12.2.2 v12.2.2 2023-08-14 14:29:53 +02:00
Maciej Jastrzebski fa7b76a9ef chore: remove negative "files" entry which confused Yarn (#1453) 2023-08-14 14:28:22 +02:00
Maciej Jastrzebski a529a2da27 chore: apply UserEvent clear to examples/basic (#1451) 2023-08-14 13:16:29 +02:00
Maciej Jastrzębski ee74d84d66 v12.2.1 v12.2.1 2023-08-14 13:08:53 +02:00
Pierre Zimmermann 2a0477e844 refactor: type all queries to return host components (#1426)
* refactor: type all queries to return host components

* refactor: use brackets syntax for array types over Array

* refactor: change order of checks in findAll for perf

* refactor: hide host instance from public API

* refactor: make sure all queries return host elements

* Revert "refactor: make sure all queries return host elements"

This reverts commit 979f92a83e43b04a30c979445633896ec3496769.

* chore: rename to HostTestInstance

* refactor: remove flierNodeByType

* chore: fix codecov

---------

Co-authored-by: pierrezimmermann <pierrez@nam.tech>
Co-authored-by: Maciej Jastrzębski <mdjastrzebski@gmail.com>
2023-08-11 16:51:37 +02:00
Maciej Jastrzebski 62a9b570fc feature: userEvent clear() (#1440)
* feat: implement clear()

* chore: add docs

* chore: fix lint

* refactor: remove redundant clearAllMocks

* feat: throw on disabled element

* refactor: tweak errors

* refactor: cleanup

* refactor: remove error on disabled element
2023-08-10 22:35:00 +02:00
Maciej Jastrzebski e69402bc13 chore: React Test Library experiments app (#1447)
* chore: React Test Library experiments app

* chore: fix lint

* chore: fix tests
2023-08-10 22:15:08 +02:00
Maciej Jastrzebski fd08a4cd2d chore: update docs (#1448) 2023-08-10 13:15:42 +02:00
Maciej Jastrzebski 20c5e446b8 chore: experiments app tweaks (#1416)
* chore: fix expo warnings

* chore: log info about micro and macro tasks

* chore: expo upgrade

* refactor: simplify event handling

* chore: remove invalid deps

* chore: fix tsc
2023-08-08 11:23:48 +02:00
Wiktor Sieprawski ca0d9a54c9 ScrollView experiments (#1442)
* ScrollView experiments

* FlatList experiments

* Extend placeholders for scrollable components

* Enhance experiments with onContentSizeChange

* Add endReached event to FlatList experiment

* SectionList experiments

* Fix missing semicolon

* refactor: cleanup code

---------

Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2023-08-07 23:16:39 +02:00
Maciej Jastrzebski b70c07d12f chore: update basic example with User Event (#1438)
* chore: update basic example with User Event

* chore: add fake timers
2023-08-06 17:27:12 +02:00
Maciej Jastrzebski dace5cb076 v12.2.0 v12.2.0 2023-08-04 12:30:24 +02:00
Maciej Jastrzebski 3382867b13 chore: expose User Event in the exports and website (#1410)
* chore: expose User Event in the exports and website

* docs: tweaks, add beta notice

* chore: anotate fireEvent api

* docs: tweaks
2023-08-04 12:28:28 +02:00
Maciej Jastrzebski b9a3fb2c05 fix: UserEvent longPress on Text component (#1436)
* chore: add tests

* fix: support Text longPress, improve pressable Text checks

* chore: refactor

* refactor: tweaks
2023-08-02 23:25:48 +02:00
Maciej Jastrzebski 574205aa93 feat: User Event type() (#1396)
* feat: userEvent type()

chore: restore tests

chore: more tests

chore: improve coverage

chore: moar tests

docs: improve the docs

chore: fix lint

refactor: code review changes

chore: fix lint

chore: tweak return type

refactor: flush microtasks after event

refactor: re-organize waits

refactor: improve dispatch event functions

refactor: remove flushMicroTasks calls

* chore: update snapshots

* chore: do not expose User Event docs yet

* refactor: simplify dispatchEvent code

* refactor: press

* refactor: move warn method up

* refactor: finishing touches

* docs: correct typos
2023-07-24 11:53:09 +02:00
Maciej Jastrzebski b2d642feb0 chore: update example deps (#1435)
* chore: upgrade expo

* chore: upgrade example deps

* chore: update other examples
2023-07-21 17:07:34 +02:00
Maciej Jastrzębski 64b76b0b6b v12.1.3 v12.1.3 2023-07-21 13:15:47 +02:00
Krastan Dimitrov fcaca52988 fix: add prop to render to skip configureHostComponentNamesIfNeeded (#1425)
* Add prop to render to skip componentnamesconfig

* refactor: render internal with extra options

* refactor: apply renderInternal to renderHook

* chore: add tests to check for single render

* refactor: simplify code

* refactor: finishing touches

* chore: fix lint

---------

Co-authored-by: Maciej Jastrzębski <mdjastrzebski@gmail.com>
2023-07-21 13:11:36 +02:00
Pierre Zimmermann 7587e6981b feat: add autocomplete for fireEvent event names (#1434)
* feat: add autocomplete for fireEvent event names

* feat: uncapitalize fireEvent autocomplete propositions

* feat: add textinput props to the autocomplete

* refactor: fix textinput props reference

---------

Co-authored-by: pierrezimmermann <pierrez@nam.tech>
Co-authored-by: Maciej Jastrzębski <mdjastrzebski@gmail.com>
2023-07-20 17:04:06 +02:00
Pierre Zimmermann fa0c86e2fe fix: correct type inference for props when initialProps is used (#1421)
* fix: correct type inference for props when initialProps is used

* Update src/__tests__/renderHook.test.tsx

* refactor: simplify type of Renderhook options

---------

Co-authored-by: pierrezimmermann <pierrez@nam.tech>
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2023-07-19 13:34:22 +02:00
Maciej Jastrzebski 5bb5d2db8e chore: yarn upgrade (#1433)
* chore: yarn upgrade

* chore: fix yarn.lock
2023-07-17 17:56:03 +02:00
Pierre Zimmermann 1f381772ca feat: userEvent.press (#1386)
* feat: create first version of userEvent.press

* feat: do not trigger press event when pointer events is disabled

* feat: make press events bubble up when trigerring a non touch responder

* tests: add test cases for userevent.press to check calls to onPressIn and onPressOut

* refactor: move userEvent.press tests in a dedicated test file

* feat: add pressDuration option for userEvent.press

* refactor: group test that check prop calls

* feat: add support for touchable opacity for userevent press

* feat: add support for Text

* feat: add support for TextInput for userEvent.press

* refactor: add some comments to explain pointer events api

* refactor: change the api of userEvent.press to make it async

* feat: add support for real timers for userEvent.press

* refactor: create a longPress api and remove duration option from press api

* feat: add warning for users when userEvent is used with real timers

* refactor: rewrite press using common user event code

* refactor: remove duplicate pointerEventEnabled method

* refactor: remove check on fake timers in user.press

* refactor: change order of functions in press file to have exports first

* feat: add delay before press

* feat: wait min press duration before calling onPressout for text and textInput

* chore: improve coverage

* feat: account for press duration when waiting for press out

* fix: wait for press duration also when pressing text or textinput

* docs: add documentation on press and longpress

* fix: check pointer events for Text and TextInput

* chore: fixes and tweaks on userEvent docs

* Update press doc based on review suggestion

Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>

* refactor: rename pressDuration option to duration

* Update longPress doc based on review suggestion

Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>

* refactor: use ts doc for isPointerEventsEnabled method

* refactor: rename file isPointerEventsEnabled to pointer-events

* refactor: split test in longPress in two

* refactor: use Date.now instead of new Date().getTime()

* refactor: also test payload of events for press and longpress

* refactor: fix typo in some longpress test names

* Update src/user-event/press/utils/warnAboutRealTimers.ts

Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>

* refactor: merge press and touch events

* fix: return after pressing text or textinput

* refactor: extract functions to trigger press on text/textInput

* refactor: use optional chaining

* feat: update warning when using userEvent with real timers

* refactor: check on press test that longPress is not called

* refactor: test directly warnings logged with real timers without mocking function

---------

Co-authored-by: pierrezimmermann <pierrez@nam.tech>
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2023-07-17 17:27:42 +02:00
Felipe Ernesto Schmidt 1c0fc791cc fix: fixing TypeScript accessibility issue for custom render function (#1428)
* fix: export DebugFunction interface to resolve accessibility issues

* feat: add DebugFunction to exported types from render module
2023-07-17 17:22:29 +02:00
Abdelalim-dev 144796e232 Correct second test description (#1424) 2023-07-13 18:35:22 +02:00
Maciej Jastrzebski 0205955acb chore: remove conventional-changelog-cli package (#1419) 2023-06-14 17:45:18 +02:00
Maciej Jastrzebski 918be8c198 refactor: flush microtask queue implementation (#1374)
* refactor: flush microtask queue implementation

* refactor: code review changes

* refactor: restore original flush function as legacy version

* chore: rename file
2023-06-09 16:35:14 +02:00
Michał Pierzchała ce75f667f9 chore: switch Codecov PR comment to default behavior (#1415)
It's super annoying to get dozens of meaningless codecov notifications in my inbox every day, because of the current behavior. Switching to default to "update, if exists. Otherwise post new"

Ref: https://docs.codecov.com/docs/pull-request-comments#behavior
2023-05-31 10:12:11 +02:00
Maciej Jastrzebski 90a6169ba7 chore: update Jest Native integration example (#1412) 2023-05-11 17:34:47 +02:00
Maciej Jastrzebski ded5c36ae3 chore: yarn upgrade (#1411) 2023-05-11 17:30:34 +02:00