236 Commits

Author SHA1 Message Date
Justinas Reigis 327ccf6fb9 docs: update scroll event api for flat list (#519) 2020-08-31 10:07:58 +02:00
Michał Pierzchała c5e9b71131 chore(docs): followup fixes for docusaurs alpha.61 (#510)
* fix links

* update projectName to reference the one on github
2020-08-17 14:56:24 +02:00
Michał Pierzchała 1ec340c8a0 docs: adjust wording around debug (#502) 2020-08-12 18:48:37 +02:00
Michał Pierzchała 0e3f654b27 docs: small amendments to the migration guide 2020-07-30 16:13:15 +02:00
Michał Pierzchała aa411c0d79 docs: refresh readme and getting started guide 2020-07-30 16:13:15 +02:00
Nick McCurdy 7909558763 docs: fix typo in migration v7 doc (#465) 2020-07-30 16:13:15 +02:00
Maciej Jastrzebski 5adf148de5 feat: prevent events on disabled elements (#460)
* feat: add tests

* feat: prevent event handling on disabled element

* refactor: code cleanup

* feat: use props.onStartShouldSetResponder to check for event handling

* refactor: code review changes

* feat: updated docs

* feat: added test for fake 'disabled' prop
2020-07-30 16:13:15 +02:00
Maciej Jastrzebski 37f0c42a1f fix: update package name in docs (#462)
* fix: package reference in docs

* fix: more references to package name

* Update README.md

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

* Update website/docs/GettingStarted.md

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

* Update website/docs/API.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-07-30 16:13:15 +02:00
Maciej Jastrzebski 3f88cacbc6 feat: add getQueriesForElement alias to within (#461)
* feat: getQueriesForElement alias implementation & test

* feat: added typescript types and tests

* feat: updated docs
2020-07-30 16:13:15 +02:00
Michał Pierzchała ae5f9d8e97 docs: add migration to v7 guide (#456)
* docs: add migration to v7 guide

* adjust note about ByTitle because there's no host Button component

* add fire event section

* mention NativeTestInstance and container

* Update website/docs/MigrationV7.md

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

* Update website/docs/MigrationV7.md

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

* Update website/docs/MigrationV7.md

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

* Update website/docs/MigrationV7.md

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

Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2020-07-30 16:13:15 +02:00
Michał Pierzchała 6d63a4f29e feat(breaking): rename ByPlaceholder to ByPlaceholderText (#455) 2020-07-30 16:13:15 +02:00
Ryan Wessel 61359c70e6 feat: introduce ByLabelText, ByRole and ByHintText a11y aliases (#445)
* feat: Add alias accessibilityLabel queries to assist in migrating from @testing-library/react-native

* feat: Add alias accessibilityHint queries to assist in migrating from @testing-library/react-native

* feat: Add alias accessibilityRole queries to assist in migrating from @testing-library/react-native

* feat: Add to A11yAPI types to include the newly-aliased queries for label, hint, and role

* test: Add tests for newly-aliased label, hint, and role a11y queries

* test: Add newly-alised a11y queries to the index typings test file

* docs: Add query aliases for testing library migrators to Queries documentation

* test: Consolidate aliased query tests into shared tests. FIXME's where there are errors

* test: Update a11yAPI tests to assert referential equality for query aliases

* refactor: apply Prettier formatting to a11yAPI test file

* fix: address typos in CONTRIBUTING.md

* test: Separate referential quality assertion tests for query aliases into their own tests

Co-authored-by: Ryan Wessel <rwessel@dataminr.com>
2020-07-21 15:46:06 +02:00
Przemysław Bitkowski 859cb82b87 Replace imports (#421) 2020-07-04 08:50:22 +02:00
Nathan Loudjani dc854a9717 docs: Fix typo in migration doc (#411) 2020-06-30 16:54:17 +02:00
Maciej Jastrzebski 300d16b822 feature: wait for element to be removed (#376)
* feature: basic implementation

* feature: basic implementation

* feature: added typescript types

* feature: check if element exists initially

* resolve promise with initial elements

* docs: README & API

* use ErrorWithStack helper

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-06-10 08:17:01 +02:00
Vojtech Novak 3de2a2b35f clarify UNSAFE_ functions are not scheduled for removal (#368) 2020-06-01 18:04:31 +02:00
Drew Miller 7c6df013ff docs: update React Navigation tests to use find queries (#364)
* docs: update React Navigation tests to use find queries

* update test to be in sync with documentation
2020-05-31 11:58:31 +02:00
Michał Pierzchała 2e4594f868 docs: clarify configuration to incluude preset react-native (#362) 2020-05-30 20:18:35 +02:00
Maciej Jastrzebski 2b14360f28 feat: wrap waitFor in (async) act to support async queries without explicit act call (#344)
* Wrapped waitFor call in act to support async waitFor/findBy

* Updated docs

* Spelling mistake

* Added short info in migration guide

* Corrected spelling

* Clarified comments

* Added async act implementation conditional on React version

* Code review changes

* Update src/waitFor.js

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

* Update src/waitFor.js

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

* Fixed prettier

* Update src/waitFor.js

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

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-28 15:06:04 +02:00
Michał Pierzchała c86484dee4 docs: cleanup migration doc (#342) 2020-05-28 15:06:04 +02:00
Maciej Jastrzebski a47116be1c chore: rename Migration20.md to MigrationV2.md (#341) 2020-05-28 15:06:04 +02:00
Maciej Jastrzebski 9e50bff6ab chore(breaking): deprecate flushMicrotasksQueue (#340)
* Deprecated flushMicrotasksQueue

* Update website/docs/Migration20.md

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

* Renamed flushMicrotasksQueueInternal to flushMicroTasks

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-28 15:06:04 +02:00
Maciej Jastrzebski 7c0ee5683f Spelling mistake 2020-05-28 15:06:04 +02:00
Alec Larson ad66a5489d feat: call "cleanup" automatically (#238)
* feat: add "cleanup" function

* docs: add "cleanup" section

* feat: automatically call "cleanup" after each test

...if an "afterEach" global function is defined, and process.env.RTL_SKIP_AUTO_CLEANUP is falsy.

Taken from: https://github.com/testing-library/react-testing-library/blob/14670debd45236d2c5d0a61a83dadc72af1bef7c/src/index.js

* docs: mention automatic cleanup

* add within

* fix lint

* Updated tests, added auto-cleanup test

* Added ways to prevent auto cleanup

* Small fix

* Code review changes

* Update website/docs/API.md

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

* More changes

* Removed  afterEach(cleanup) calls in examples

* Code cleanup

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
Co-authored-by: Maciej Jastrzebski <mdjastrzebski@gmail.com>
2020-05-28 15:06:04 +02:00
Maciej Jastrzebski 01bc0ee2b4 feat: update docs bases on cancelled prepare-2 PR (#335)
* Adapt docs changes from `prepare-2` branch

* WIP

* Removed unused `printUnsafeWarning` function

# Conflicts:
#	src/helpers/errors.js

* Code review changes
2020-05-28 15:06:04 +02:00
Maciej Jastrzebski 9fc83fec60 Feat(breaking): remove deprecated functions (#334)
* WIP

* More changes

* WIP

* Added throwRemovedFunctionError docsRef

* Fixed tests

* Typescript types cleanup

* Cleanup

* Moving some changes from `prepare-2` branch

* Moving some changes from `prepare-2` branch

* Update src/waitFor.js

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

* Update website/docs/Migration20.md

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

* Code review changes

* More code review changes

* Code review changes

* More code review changes

* Added @deprecated messages for TS type defs

* Spelling mistake

* Reformatted index.d.ts

* Removed remaining refs to warnFn

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-28 15:06:04 +02:00
Michał Pierzchała 163cc8533a chore(breaking): compile project to Node 10 using @babel/preset-env (#309)
* chore: compile project to Node 8.3 using @babel/preset-env

* update snapshots

* compile to Node 10

* adjust snapshots back

* add migration docs
2020-05-28 15:06:04 +02:00
Maciej Jastrzebski 5e798bc2e3 Feat(breaking): unify wait for element signature with testing library (#327)
* Change argument to options object

* Renamed `waitForElement` to `waitFor`

* Migration guide entry

* Fixed typescript check

* Update src/helpers/a11yAPI.js

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

* (Nearly) Empty migration doc for ver. 2.0 (#326)

* Added migration docs section

* Added to docosaurus side bar

* Updated README

* Increased async test timeout

* Update website/docs/Migration20.md

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

* feat(breaking): remove legacy `debug` export (#328)

* Removed global `debug` functions

* Removed global `debug` from docs

* Cleanup

* Added migration section

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

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-28 15:06:04 +02:00
Maciej Jastrzebski 043f51d36c feat(breaking): remove legacy debug export (#328)
* Removed global `debug` functions

* Removed global `debug` from docs

* Cleanup

* Added migration section

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-28 15:06:04 +02:00
Maciej Jastrzebski b3e5ca386c (Nearly) Empty migration doc for ver. 2.0 (#326)
* Added migration docs section

* Added to docosaurus side bar

* Updated README

* Increased async test timeout

* Update website/docs/Migration20.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-28 15:06:04 +02:00
Maciej Jastrzebski 9b90d6790d fix(breaking): getByTestId should work only for native elements (#324)
* Replaced getByTestId with fixed version

* Added tests

* Fixed flow-check

* Updated docs

* Fixed lint error

* Used getByTestId in unit tests instead of queryByTestId

* Updated negative checks in tests
2020-05-28 15:06:04 +02:00
Maciej Jastrzebski 414f8701a5 feat: Support for @testing-library/jest-native (#310)
* Added @testing-library/jest-native to devDependencies

* Tests for jest-native matchers

* Added @testing-library/jest-native install info

* Update README.md

* Update GettingStarted.md

* feat: add `findBy*` queries (#304)

* Basic async findBy queries

* Refactored findBy queries to be built with makeFindQuery

* findBy queries for A11y selectors

* Custom findByTestId implementation that avoids current getByTestId issues

* Fixed prettier issue

* Updates Queries.md with findBy queries

* Trying to fix test timeout error appearing only on CI

* Code review changes

* Added typescript types & tests

* prettier did reformat some code arround

* Removed export of GetByAPI, QueryByAPI and FindByAPI interfaces in TS

* Reversed prettier run on typings

* Added overlapping pieces with `within` operator

* Small cleanup

* Update website/docs/Queries.md

* Moved async/await tests to the end of test methods

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

* chore: bump eslint config to latest (#308)

* chore: bump eslint config to latest

* lint fix

* lint pass

* use roles directly

* Trying to fix CI build

* Added $FlowFixMe for missing flow expect extensions

* Small doc fixes

* Clarified failing toHaveProps matcher tests

* Moved lint ignore for color literals to .eslintrc

* Updated toHaveProp tests to avoid strange `Button` behavior

* Updated yarn.lock

* Update README.md

* Update website/docs/GettingStarted.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-18 09:37:59 +02:00
Maciej Jastrzebski ab34712133 feat: add findBy* queries (#304)
* Basic async findBy queries

* Refactored findBy queries to be built with makeFindQuery

* findBy queries for A11y selectors

* Custom findByTestId implementation that avoids current getByTestId issues

* Fixed prettier issue

* Updates Queries.md with findBy queries

* Trying to fix test timeout error appearing only on CI

* Code review changes

* Added typescript types & tests

* prettier did reformat some code arround

* Removed export of GetByAPI, QueryByAPI and FindByAPI interfaces in TS

* Reversed prettier run on typings

* Added overlapping pieces with `within` operator

* Small cleanup

* Update website/docs/Queries.md

* Moved async/await tests to the end of test methods

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-15 09:52:33 +02:00
Maciej Jastrzebski 1809825313 feat: add within operator for returned instance-bound queries (#306)
* Basic within implementation and tests

* Added typescript types & tests

* Removed duplicated import in index.d.ts

* Reversed prettier run on typings

* Fixed package level exports for `within` operator

* Replaced getByTestId queries with getByA11yHint queries in unit tests for `within`

* Added `within` section to API.md

* Updated README.md regarding `within` operator

* Update website/docs/API.md

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-14 12:51:19 +02:00
Maciej Jastrzebski 51bd418ba7 docs: added warnings for *ByTestId queries (#305)
* Added usage notes for ByTestId queries

* Update website/docs/Queries.md

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

* Update website/docs/Queries.md

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

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-14 10:26:06 +02:00
Kenneth Kwakye-Gyamfi 58055d8998 docs: migrate to Docusaurus v2 (#299)
* Migration to Docusaurus v2.0.0

* update lock file

* add algolia search

* update GH Pages deploy

* make sidebar non-collapsible for now

* update theme colors

* ignore docusaurus-specific import aliases, remove home-container class

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
2020-05-13 10:28:32 +02:00