Maciej Jastrzebski
b2a29b171a
fix: find by timeout with detached screen ( #1576 )
...
* fix: improve error findBy* error message when screen is not beign attached.
* fix: detect detached screen and display proper error message.
* chore: improve error message
* chore: update link
* chore: update snapshots
2024-03-28 18:14:36 +01:00
Maciej Jastrzebski
9b252f8b60
docs: update docs about eslint rule ( #1578 )
...
* fix: relevant issues indicated by the eslint rule
* chore: rename file
* docs: move eslint to getting-started; cleanup legacy stuff
2024-03-28 15:38:12 +01:00
Jose Luis Leon
b4d264f756
fix(user-event): Decouple press events from Jest dependency ( #1571 )
...
* fix(user-event): Decouple press events from Jest dependency
* Add warnAboutRealTimersIfNeeded() tests
* Address @mdjastrzebski feedback
* refactor: code review changes
2024-03-18 20:55:17 +01:00
Maciej Jastrzebski
bab4097836
chore: update deps 2024-03-12 ( #1570 )
...
* chore: update 1
* chore: update @types/*
* chore: update react native
* chore: update eslint & typescript
* chore: fix lint
* chore: upgrade release it
* chore: reformat
* chore: disable flow validation
2024-03-12 11:37:06 +01:00
Steve Galili
4e148bdb05
chore: tweak docs and examples to match recommended practices 2024 (use screen object for queries) ( #1561 )
...
* chore: tweak docs and examples to match modern usage of lib.
Use screen object for queries (pt.1)
Use screen object for queries (pt.2)
update render docs to modern screen API and fix lint
* refactor: code review tweaks
---------
Co-authored-by: Maciej Jastrzębski <mdjastrzebski@gmail.com >
2024-03-11 22:46:07 +01:00
Maciej Jastrzebski
21254b059a
chore: reformat source using prettier ( #1550 )
...
* chore: reformat source using prettier
* chore: fix lint
2024-01-03 22:31:12 +01:00
Maciej Jastrzebski
464e986350
docs: jsdoc for Jest matchers ( #1548 )
...
* docs: add jsdocs for jest matchers
* docs: fix formatting issues
* docs: tweaks
2023-12-27 14:13:10 +01:00
Jakub Piasecki
edf52b625a
Add option to pass contentSize and layoutMeasurement when calling scrollTo ( #1543 )
...
* Add option to pass `contentSize` and `layoutMeasurement` when calling `scrollTo`
* Update docs
* Add tests
* refactor: code review changes
* refactor: code review changes
* refactor: code review changes
* docs: fix typo
---------
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com >
2023-12-15 18:32:08 +01:00
Maciej Jastrzebski
45037f68d7
fix: user event add target prop ( #1538 )
...
* fix: add empty target and current target event props
* chore: update snapshot tests
* refactor: move noisy snapshot to separate files
2023-11-30 13:45:19 +01:00
Maciej Jastrzebski
7acec0cba4
fix: matcher Jest extensions ( #1537 )
...
* fix: matcher Jest extensions
* docs: add typedocs
2023-11-30 13:38:56 +01:00
Maciej Jastrzebski
067462f50a
chore: fix extend-expect.d.ts types by internalizing them ( #1536 )
2023-11-29 10:19:12 +01:00
Maciej Jastrzebski
a3489b3a44
RFC/feat: default accessibility roles ( #1490 )
...
* feat: default accessibility roles
* chore: remove default text input role
* chore: update tests
* chore: update docs
2023-11-27 17:32:58 +01:00
Maciej Jastrzebski
2bce396a46
docs: expose jest matchers publically (docs, examples, etc) ( #1523 )
...
* docs: update references to Jest Native
* chore: update docs
* chore: update example apps
* docs: update
* chore: upgrade example apps
* chore: self code review
* chore: docs tweaks
* docs: code review changes
2023-11-14 12:23:24 +01:00
Maciej Jastrzebski
aad0849038
Dependabot/npm and yarn/callstack/eslint config 14.0.0 ( #1526 )
...
* chore(deps-dev): bump @callstack/eslint-config from 13.0.2 to 14.0.0
Bumps [@callstack/eslint-config](https://github.com/callstack/eslint-config-callstack ) from 13.0.2 to 14.0.0.
- [Release notes](https://github.com/callstack/eslint-config-callstack/releases )
- [Commits](https://github.com/callstack/eslint-config-callstack/compare/v13.0.2...v14.0.0 )
---
updated-dependencies:
- dependency-name: "@callstack/eslint-config"
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
* refactor: fix lint issues
* refactor: fix lint issues
* refactor: fix lint issues
* refactor: fix lint issues
* chore: update callstack-eslint config
---------
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 18:04:55 +01:00
Anisha Malde
2ada536829
feat: toHaveAccessibleName matcher ( #1509 )
...
* feat: toHaveAccessibleName matcher
* feat: toHaveAccessibleName matcher
* feat: toHaveAccessibleName matcher
* refactor: check logic
* chore: fix lint
* refactor: tests
* chore: test tweaks
---------
Co-authored-by: Maciej Jastrzębski <mdjastrzebski@gmail.com >
2023-11-08 10:44:51 +01:00
Maciej Jastrzebski
3af4b8c867
refactor: rename files ( #1515 )
...
* refactor: rename files to match convention
* chore: refactor more
* chore: fix tests
2023-10-25 14:12:53 +02:00
Tarun Chauhan
28c872904f
Implement toHaveAccessibilityValue matcher ( #1496 )
...
* feat: add toHaveAccessibilityValue matcher
* refactor: clenup
* refactor: clean up tests
* refactor: self review
---------
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com >
2023-10-25 13:47:23 +02:00
Pierre Zimmermann
328466dffc
Fix: switch IS_REACT_ACT_ENVIRONMENT in userEvent ( #1491 )
...
* fix: use act in wait util
* refactor: remove useless usage of act in press implem
* refactor: make test fail by checking console.error is not called
* refactor: extract async wrapper from waitFor implem
* feat: use asyncWrapper for userEvent to prevent act warnings
* refactor: add comment making test on act environment more explicit
* refactor: move asyncWrapper to helper folder cause its not direclty tied to userevent
* refactor: add comment in asyncWrapper
* refactor: move UE `act` test to UE `press` tests
* refactor: tweaks
* refactor: naming tweaks
* chore: revert unnecessary filename change
* chore: exclude code cov for React <= 17
* chore: disable codecov for wrap-async
---------
Co-authored-by: pierrezimmermann <pierrez@nam.tech >
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com >
2023-10-23 12:49:13 +02:00
Wiktor Sieprawski
a9f32a69e4
feat: toBeExpanded matcher ( #1497 )
...
* feat: toBeExpanded matcher
* feat: toBeCollapsed matcher
* chore: shorten syntax for isElementCollapsed check
* refactor: clean up
---------
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com >
2023-09-19 12:38:49 +02:00
Wiktor Sieprawski
d898a9d288
feat: toContainElement matcher ( #1495 )
...
* feat: add toContainElement matcher
* chore: replace printElement with formatElement
* chore: mimic jest-dom instead of jest-native
* fix: checking host element
* test: passing null as argument
* chore: rename basic test case
* test: negative case
* test: on null elements
* fix: validating host container and element
* refactor: code review changes
* refactor: tweaks
* refactors: cleanup
---------
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com >
2023-09-19 11:36:29 +02:00
Maciej Jastrzebski
08e4d022b3
chore: update deps 2023-09-18 ( #1499 )
...
* chore: upgrade example/basic deps
* chore: update some deps
* chore: upgrade other deps
* chore: fix lint
* chore: yarn upgrade (partial)
* chore: yarn upgrade (partial 2)
* chore: yarn upgrade (partial)
* chore: yarn upgrade (partial)
* chore: yarn upgrade (partial)
* chore: yarn upgrade react-native
* chore: upgrade rest (ex react-test-renderer)
2023-09-18 13:06:12 +02:00
Wiktor Sieprawski
a7ea95d3d7
feat: user event scroll ( #1445 )
...
* feat: setup dummy scroll endpoint
* chore: use ScrollEventBuilder
* chore: enhance API endpoint with parameters
* chore: emit multiple scroll events
* fix: intermediate steps offset values
* feat: momentum scroll
* chore: add scroll to userEvent
* feat: scrollToTop
* feat: remember scroll position for element
* fix: setting and getting scroll state
* chore: validate host component type
* chore: validate and emit intermediate callbacks in scrollToTop
* chore: fix ts
* refactor: rename scroll to scrollTo
* refactor: y & x scrollTo params
* refactor: refactor y, x params to support explicit steps
* chore: fix typecheck
* refactor: improve typing
* refactor: momentumY, momentumX options
* docs: initial docs for `scrollTo`
* refactor: descope `scrollToTop` variant
* docs: tweaks
* refactor: improve TS typing by separating vertical/horizontal scroll
* refactor: wrap scroll event in nativeEvent wrapper
* refactor: clean up implementation
* chore: add FlatList tests
* refactor: remove explicit steps
* refactor: introduce inertial interpolator for momentum scroll
* docs: update docs
* chore: update snapshots
* refactor: code review changes
* feat: validate scroll direction
* docs: tweaks
* docs: tweak
* refactor: add more tests to improve code cov
* refactor: improve errors
* refactor: code review tweaks
* refactor: add wait calls
* refactor: tweaks, tweaks, tweaks
* refactor: final tweaks
---------
Co-authored-by: Maciej Jastrzębski <mdjastrzebski@gmail.com >
2023-09-13 12:05:56 +02:00
Marcin Kornek
3b9c4da433
feat: toHaveStyle matcher ( #1487 )
...
* feat: implement toHaveStyle with tests
* refactor: tweaks and cleanup
---------
Co-authored-by: Marcin Kornek <7931279+marcinkornek@users.noreply.github.com >
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com >
2023-09-12 12:04:17 +02:00
Hugo Duprat
701433c131
feat: toBeBusy() matcher ( #1493 )
...
* feat: create always passing toBeBusy() matcher
* test: prepare toBeBusy() tests
* feat: implement toBeBusy() passing condition
* feat: implement error message
* test: update error message snapshots to correct format
* refactor: use screen variable
* refactor: tweaks
* refactor: cleanup
* refactor: clean up
* refactor: finishing touches
---------
Co-authored-by: Maciej Jastrzębski <mdjastrzebski@gmail.com >
2023-09-12 11:13:31 +02:00
AntoineThibi
1592d35e36
feat: implement toBeSelected matcher ( #1488 )
...
* feat: implement toBeSelected
* refactor: tweaks
* refactor: tweak tests
* refactor: finishing touches
---------
Co-authored-by: Maciej Jastrzębski <mdjastrzebski@gmail.com >
2023-09-08 11:23:19 +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
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
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
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
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
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
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