1256 Commits

Author SHA1 Message Date
Michał Pierzchała c869431dc0 v1.9.0 2019-06-10 18:25:23 +02:00
Michał Pierzchała a56501b0fb feat: implement ByDisplayValue queries (#190) 2019-06-10 17:30:27 +02:00
Michał Pierzchała 33526030bc chore: update @typescript eslint/eslint plugin to 1.10.2 (#189)
* chore(package): update @typescript-eslint/eslint-plugin to version 1.10.2

* chore(package): update lockfile yarn.lock
2019-06-10 08:40:00 +02:00
dependabot[bot] 3f46d24872 chore(deps): bump js-yaml from 3.12.0 to 3.13.1 (#187)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.0 to 3.13.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.12.0...3.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-06-06 01:36:03 +02:00
greenkeeper[bot] e5ce263717 Update flow-bin to the latest version 🚀 (#185)
* chore(package): update flow-bin to version 0.100.0

* chore(package): update lockfile yarn.lock
2019-05-31 19:33:29 +02:00
Michał Pierzchała 37a5ca573f fix: display correct error frame when fireEvent fails (#184)
* feat: support 'disabled' prop

* revert disabled handling
2019-05-30 12:21:35 +02:00
Michał Pierzchała aa8b3abe7f Release 1.8.0 1.8.0 2019-05-29 09:31:09 +02:00
Michał Pierzchała e967f5e67a chore: update release-it config 2019-05-29 09:25:12 +02:00
greenkeeper[bot] 2c181b844e Update flow-bin to the latest version 🚀 (#183)
* chore(package): update flow-bin to version 0.99.0

* chore(package): update lockfile yarn.lock

* Fix flow
2019-05-29 09:13:59 +02:00
Michał Pierzchała 9227012e45 chore: upgrade deps (#182) 2019-05-28 23:04:23 +02:00
Michał Pierzchała fd6cb4951e docs: install react-test-renderer typings (#181) 2019-05-28 22:52:40 +02:00
Scotty Waggoner f6f0a7091d feat: Add wrapper option to render (#173)
* Add wrapper option to render

* Update TS types and call updateWithAct only once

* wrapUiIfNeeded -> wrap

* reindent snapshots

* adjustments

* change name
2019-05-28 22:31:48 +02:00
Kacper Wiszczuk f635c852d4 chore: flow copy source 2.0.6 (#180)
* chore(package): update flow-copy-source to version 2.0.6

* chore(package): update lockfile yarn.lock
2019-05-28 22:26:37 +02:00
Kacper Wiszczuk f9bc0b263d feat: add a11y queries (#178)
* First implementation of matcher generator

* A11y queries added

* extract prepareErrorMessage

* Add tests

* Make aliases

* Move create queryByError

* Add missing aliases

* simplify valid node check

* add docs

* fix types
2019-05-28 20:47:06 +02:00
Michał Pierzchała efc44157e2 Greenkeeper/release it 12.1.0 (#171)
* chore(package): update release-it to version 12.1.0

Closes #166

* chore(package): update lockfile yarn.lock
2019-05-14 23:36:29 +02:00
greenkeeper[bot] 3fd24c9de4 Update @callstack/eslint-config to the latest version 🚀 (#169)
* chore(package): update @callstack/eslint-config to version 6.0.0

* chore(package): update lockfile yarn.lock
2019-05-11 13:39:10 +02:00
Michał Pierzchała 0b95597f8a chore: upgrade react-native to 0.59.8 (#168)
* chore(package): update react-native to version 0.59.8

* chore(package): update lockfile yarn.lock
2019-05-08 21:17:37 +02:00
greenkeeper[bot] ab5740dd4d Update flow-bin to the latest version 🚀 (#162)
* chore(package): update flow-bin to version 0.98.0

* chore(package): update lockfile yarn.lock
2019-04-26 22:30:20 +02:00
Kacper Wiszczuk 47a780a725 fix: change link colors (#155) 2019-04-23 11:11:11 +02:00
greenkeeper[bot] 7b7518ff97 Update @callstack/eslint-config to the latest version 🚀 (#160)
* chore(package): update @callstack/eslint-config to version 5.0.0

* chore(package): update lockfile yarn.lock
2019-04-23 11:10:52 +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
Michał Pierzchała e8a817cae4 docs: add and update queries documentation (#151)
### Summary

Adds new "Queries" section inspired by https://testing-library.com/docs/dom-testing-library/api-queries

### Test plan

Reading carefully
2019-04-14 16:12:50 +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 a184c2d152 chore: add some keywords 2019-04-14 12:28:53 +02:00
Michał Pierzchała 1938a5091e chore: bump Jest, remove flaky inline snapshot (#150)
### Summary

Bumping Jest to latest, removed inline snapshot as there's a pending bug with trailing whitespaces inside of it being removed by IDEs (solution is to make them regular snapshots, but in this case the test was just plain unnecessary)

### Test plan

CI
2019-04-14 10:41:03 +02:00
Michał Pierzchała 439db6c823 feat: add rerender as an alias for update (#149)
<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->

### Summary

Users of `react-testing-library` use `rerender` wording instead of `update`. Let's make it easier for them by aliasing it.
See: https://testing-library.com/docs/react-testing-library/api#rerender

### Test plan

Added cases for JS tests and TS typings
2019-04-14 10:09:46 +02:00
greenkeeper[bot] 488a2ca5cc Update flow-bin to the latest version 🚀 (#148)
* chore(package): update flow-bin to version 0.97.0

* chore(package): update lockfile yarn.lock
2019-04-12 20:23:04 +02:00
Michał Pierzchała 046919c3b4 Release 1.7.0 1.7.0 2019-04-09 15:40:09 +02:00
Ferran Negre 8984abbf74 feat: being able to fire custom events that do not need to start with "on" (#147)
### Summary

If I have a custom button like:

```js
<MyCustomButton handlePress={onPress} />
```

The following will not work:

```js
fireEvent(getByTestId('my-custom-button'), 'handlePress');
```

Because we are trying to call `onHandlePress`.

### Test plan

```
yarn test fireEvent
```
2019-04-09 15:37:15 +02:00
Michał Pierzchała 55b9c67f2c Release 1.6.2 1.6.2 2019-04-03 09:13:38 +02:00
greenkeeper[bot] d3dedaa84a chore: Update flow-bin to the latest version 🚀 (#145)
* chore(package): update flow-bin to version 0.96.0

* chore(package): update lockfile yarn.lock
2019-04-02 08:35:59 +02:00
Jean-Marie Porchet 859e29c569 docs: provide example for componentDidMount (#144)
### Summary
Some people find it useful to search for specific terms when browsing the docs.
Specifying the concrete utility of the `update` method makes the doc more useful :)
2019-04-01 16:39:01 +02:00
sam freund b4cfb95893 add rally to license (#140) 2019-03-27 15:41:21 +01:00
Brad f96d782d26 Improvement: Add act to update call to support hooks (#137)
### Summary
Currently `render` and `fireEvent` are wrapped in `act` to support hooks. This pull request wraps the update call in `act` to support testing component updates (e.g. prop changes).

### Test plan
* I have added a test for update in `__tests__/act.test.js`.
* A useEffect hook should run again on `update` calls (if the hook dependency array is satisfied).
2019-03-25 15:22:34 +01:00
Kacper Wiszczuk ccad8044ea fix: check for undefined/null children (#136)
### Summary

Check for undefined/null values, in `getByText` nodes.

Fixes #135 

### Test plan

Passing tests on repro repository https://github.com/wKovacs64/rntl-161-repro.

Have no idea how to create a unit test, to test this behavior.

cc @thymikee @wKovacs64
2019-03-19 19:47:26 +01:00
Michał Pierzchała 1d5e15b230 Release 1.6.1 1.6.1 2019-03-18 15:28:19 +00:00
Eli Perkins 97ab842567 improvement: Allow for text to match children who are composed as array (#132)
### Summary

Given a component that renders text by composing together literal text with an inline expression for a dynamic variable, React Native will render this as a `<Text>` element with multiple children. For example:

```js
const BananaCounter = ({ numBananas }) => (
  <Text>There are {numBananas} bananas in the bunch</Text>
);

const { toJSON, debug } = render(<BananaCounter numBananas={3} />);

debug();
/*
      <Text>
        There are
        3
         bananas in the bunch
      </Text>
*/

expect(toJSON()).toMatchInlineSnapshot(`
<Text>
  There are 
  3
   bananas in the bunch
</Text>
`);
```

This makes sense, as the component is a:
- literal string
- a dynamic evaluation
- literal string

Unfortunately, this means that writing a test that finds an element based on that dynamic evaluation fails when using `getByText`.

```js

const { getByText } = render(<BananaCounter numBananas={3} />);
expect(getByText('There are 3 bananas in the bunch')).toBeTruthy(); // Fails
```

This is because we compare the given test string directly against `children`. https://github.com/callstack/react-native-testing-library/blob/ce3bf28f308728672bc5502e120048821c60218b/src/helpers/getByAPI.js#L23-L24

This results in comparing `'There are 3 bananas in the bunch' === ['There are ' 3, ' bananas in the bunch']`, which of course will fail.

The solution is to join children and compare the joined result against the given text string.

### Test plan

A test for this new functionality is provided!
2019-03-18 16:25:13 +01:00
greenkeeper[bot] 30fcce5508 chore: update flow-bin to the latest version 🚀 (#133)
## The devDependency [flow-bin](https://github.com/flowtype/flow-bin) was updated from `0.94.0` to `0.95.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

[Find out more about this release](https://github.com/flowtype/flow-bin).

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴
2019-03-16 09:18:14 +01:00
greenkeeper[bot] abd1f82898 chore: update @callstack/eslint-config to the latest version 🚀 (#134)
## The devDependency [@callstack/eslint-config](https://github.com/callstack/eslint-config-callstack) was updated from `3.0.2` to `4.0.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

[Find out more about this release](https://github.com/callstack/eslint-config-callstack).

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴
2019-03-16 09:11:32 +01:00
greenkeeper[bot] ce3bf28f30 chore: update react-native to the latest version 🚀 (#130)
* chore(package): update react-native to version 0.59.0

* chore(package): update lockfile yarn.lock

* update snapshots
2019-03-12 21:06:20 +01:00
Michał Pierzchała 3e73d6f32d chore: remove excess badges that have GH support 2019-03-11 16:52:57 +01:00
Ingibjörg Ósk Jónsdóttir (Inga) 09f9b9f05a docs: Remove misleading recommendation to use shallow in snapshot tests (#128)
### Summary

I removed misleading recommendation to render components with `shallow` in snapshot tests as a result of the conversation in Issue #127.

### Test plan

Review text in API.md
2019-03-07 20:55:03 +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
Michał Pierzchała 5184f68894 Release 1.6.0 1.6.0 2019-03-04 12:54:33 +01:00
Michał Pierzchała 81f977a485 chore: use upstream types for react-test-renderer 2019-03-04 12:53:54 +01:00
David Calhoun f6c895bac5 docs: Update links (#125) 2019-03-03 08:32:00 +01:00
Michał Pierzchała 1c8eb106a5 chore: update metro and merge deps (#124)
### Summary

We have a security alert around `merge` so I bumped that, also upgraded to latest metro preset version (it's still Node 8 compatible), updated RN to 0.58.6

Removed the version check for Flow as we always use local version anyway.

### Test plan

Check build directory
2019-03-01 15:47:39 +01:00