65 Commits

Author SHA1 Message Date
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
Maciej Jastrzebski f971c244cb Added migration v7 link to README 2020-07-30 16:13:15 +02:00
Michał Pierzchała 3c0a2ecf02 chore(breaking): rename to @testing-library/react-native (#463) 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
Steve Galili 1537de317d docs: add links to external resources in the README (#446)
* Update README.md

* Update README.md
2020-07-21 10:15:44 +02:00
Paul Cowgill 2bf4fcf943 docs: fix a link to react-testing-library (#412) 2020-06-30 17:18:43 +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
Michał Pierzchała 2e4594f868 docs: clarify configuration to incluude preset react-native (#362) 2020-05-30 20:18:35 +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 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
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 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 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 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
Michał Pierzchała 1f6bc249f2 docs: fix readme example (#288) 2020-04-24 12:24:57 +02:00
Kacper Wiszczuk 88f55e216d fix: remove gatekeeper badge (#267) 2020-03-18 17:45:14 +01:00
Daniel Idaszak 131a903427 chore: Typo fixed in readme (#194) 2019-06-19 12:08:36 +02:00
Michał Pierzchała fb8a6fc7e2 chore(docs): improve examples to use better APIs 2019-06-11 13:32:26 +02:00
Michał Pierzchała fd6cb4951e docs: install react-test-renderer typings (#181) 2019-05-28 22:52:40 +02:00
Asday 66a4f5f347 Fixed a 404 in README.md. (#159)
<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->

### Summary

The readme's "Rally Health" link is a 404.  It appears to attempt to link to a careers page.  I skillfully sniffed out a suitable careers page by scrolling down on the 404 page and clicking "careers".

### Test plan

0. Scroll to the bottom of `README.md`;
0. Middle click on "Rally Health";
0. Bask (optional).
2019-04-23 09:10:18 +02:00
Kacper Wiszczuk 7a1c264bb0 Docs: Remove shallow API from docs (#154) 2019-04-14 17:39:11 +02:00
Kacper Wiszczuk 34eb921e21 Fix small logo in README.md (#153)
Fix small logo.
2019-04-14 15:14:19 +02:00
Kacper Wiszczuk b94fe03990 docs: Owl as RNTL logo (#152)
* imp: owl as RNTL logo

* Undo formatter mess

* Change descriptions
2019-04-14 15:04:16 +02:00
Michał Pierzchała 3e73d6f32d chore: remove excess badges that have GH support 2019-03-11 16:52:57 +01:00
Michał Pierzchała b3abf50a10 docs: add callstack badge and note 2019-03-06 19:47:41 +01:00
Michał Pierzchała f988c3c229 chore: simple -> lightweight in README 2019-03-04 17:00:03 +01:00
David Calhoun f6c895bac5 docs: Update links (#125) 2019-03-03 08:32:00 +01:00
Jan Hesters f35d4f5dac docs: Add note for cleanup being unnecessary (#115) 2019-02-14 19:39:36 +01:00
Michał Pierzchała 28dcc6ff4a Add note about Rally Health 2019-01-24 16:46:17 +01:00
Josh Justice 5145a708db docs: Clarify RNTL is tested to work with Jest (#98)
As discussed in https://github.com/callstack/react-native-testing-library/issues/96, I found that I could get RNTL working with Jest but not with Mocha. I haven't _confirmed_ it doesn't work with Mocha, but I think it would be helpful for users (like me) who don't have a strong preference which runner to use, to know that Jest could be a good first choice.
2018-12-21 08:10:19 +01:00
Michał Pierzchała b82b4f5a6a Revert "Fix link for api docs in read me file" (#95)
* Revert "docs: Rename api.md to API.md (#94)"

This reverts commit 53b5366393.

* Revert "docs: Fix link for api docs in read me file (#93)"

This reverts commit 86271e6ffa.
2018-12-15 12:36:59 +01:00
Alina Mihai 86271e6ffa docs: Fix link for api docs in read me file (#93)
<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->

### Summary

<!-- What existing problem does the pull request solve? Can you solve the issue with a different approach? -->

### Test plan

<!-- List the steps with which we can test this change. Provide screenshots if this changes anything visual. -->
2018-12-15 12:31:28 +01:00
Brooks Becton ad61c409e9 docs: add website built with Docusaurus (#74)
* Run docusaurus init

* Add api.md and remove initial files

* Run docusaurus init

* Add api.md and remove initial files

* Add callstack info and remove extra scripts

* Commeent out  extra features on home page and Add link to example

* Re Arrange Docs Folder

* add some adjustments

* fix lint

* fix lint
2018-12-11 19:58:37 +01:00
Michał Pierzchała 3f2fc16ec2 docs: separate API from main README.md (#70)
### Summary

Separate API docs from main README.md
Relates to #26.

### Test plan

|README.md|api.md|
|--|--|
|<img width="980" alt="screenshot 2018-11-23 at 12 21 42" src="https://user-images.githubusercontent.com/5106466/48941096-740d0a80-ef1a-11e8-8c92-110f1b47826d.png">|<img width="984" alt="screenshot 2018-11-23 at 12 22 05" src="https://user-images.githubusercontent.com/5106466/48941097-740d0a80-ef1a-11e8-872b-a8dfb7814e68.png">|
2018-11-23 15:03:22 +01:00
Michał Pierzchała a052349ce7 docs: getAllByName -> getAllByType in example (#67)
<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->

### Summary

Get rid of all `getAllByName` mentions in examples.
2018-11-19 22:28:06 +01:00
Michał Pierzchała e407ff07ae feat: deprecate getByName helpers (#66) 2018-11-19 15:16:33 +01:00
Michał Pierzchała 909916e84c feat: add debug to render helpers for easier console debugging (#65)
* feat: add debug to render helpers for easier console debugging

* bring back toJSON to docs

* revert unnecessary change

* update TS

* remove cyclic dependency of debug <-> render
2018-11-19 13:51:38 +01:00
Michał Pierzchała fa198c4037 feat: add getByType helper (#64)
* feat: add getByType helper

* add docs
2018-11-19 13:44:51 +01:00
Michał Pierzchała 235942bee3 fix(breaking): correct faulty implementation of finding by name (#62)
* fix(breaking): correct faulty implementation of finding by name

* chore: update docs

* refactor: code review
2018-11-17 19:13:44 +01:00
Shawn Axsom d3146aaf11 docs: Documentation update for The Problem section of the README, clarifying Enzyme capabilities while highlighting more react-native-testing-library benefits (#43) 2018-10-25 11:45:53 +02:00
Ben Styles 174a5d0f76 docs: Remove reference to instance in readme (#42) 2018-10-20 19:48:27 +02:00
Michał Pierzchała 6fbbe2cdf5 feat: make debug.deep more usable (#40)
<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->

### Summary

Make `debug.deep` more usable by allowing it to print arbitrary JSON (and actually any) files. This proves handy when we want to debug async component which we want to snapshot after async operations:

```jsx
const { toJSON, getByName } = render(
  <Button onPress={jest.fn} text="Press me" />
);
fireEvent.press(getByName('TouchableOpacity'));
await flushMicrotasksQueue();

debug.deep(toJSON());
```

### Test plan

added one
2018-10-18 09:13:47 +02:00
Michał Pierzchała 45f45bf1b4 feat: move pretty-format from peer do deps (#39)
<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->

### Summary

We could also make it an optional dependency and inline-require it inside debug (the only place we use it) but for now I decided to make it a regular dependency, because that's what it is, no point in making users install it directly.

### Test plan

green CI
2018-10-17 22:12:18 +02:00
Michał Pierzchała 05db7bcaac feat: add debug.deep and debug.shallow (#37)
<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->

### Summary

Adds API proposed by https://github.com/callstack/react-native-testing-library/pull/33#issuecomment-430302079.
Also component output is now highlighted:

<img width="259" alt="screenshot 2018-10-16 at 19 33 25" src="https://user-images.githubusercontent.com/5106466/47035614-c10efb80-d17a-11e8-99ac-00f648880008.png">


### Test plan

Added tests for `debug`.
2018-10-16 21:45:56 +02:00
Michał Pierzchała 03e2c4b0f2 fix: use actual react-native instead of homegrown mocks (#36)
<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->

### Summary

This actually uncovered some bugs, like lack of `onDoublePress` (lol XD) and enabled us to have better snapshots for deep rendering.

### Test plan

no new tests
2018-10-16 18:51:01 +02:00
Michał Pierzchała 07d3be1c51 feat: add toJSON to render; cleanup shallow (#35)
* feat: add toJSON to render; cleanup shallow

* Remove empty dependencies entry

* revert shallow import

* add docs

* add TS typings
2018-10-16 18:00:54 +02:00
Simen Bekkhus 6097c8f64c chore: fix typos in readme (#22) 2018-10-11 00:10:06 +02:00
Kacper Wiszczuk 480dd28cbc feat: Add Typescript types to waitForElement (#21)
Fix types for Flow too
2018-10-10 21:45:32 +02:00
Michał Pierzchała d5219d2e93 feat: add waitForElement (#20)
* feat: add waitForElement

* add docs

* update docs
2018-10-10 21:06:06 +02:00