From 8d5313ba63e9898ac5b5d3ed74ad494a44f2d232 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Thu, 25 Apr 2019 15:25:45 -0400 Subject: [PATCH 1/2] get, find, and query throw if multiple are found --- .gitignore | 2 ++ docs/api-queries.md | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 5395ea7..3a7e70a 100755 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ website/build/ website/yarn.lock website/node_modules website/i18n/* + +.idea/* diff --git a/docs/api-queries.md b/docs/api-queries.md index d294b45..85d4b28 100644 --- a/docs/api-queries.md +++ b/docs/api-queries.md @@ -11,7 +11,7 @@ sidebar_label: Queries ### getBy `getBy*` queries returns the first matching node for a query, and throws an error if no elements -match. +match or if more than one match is found (use `getAllBy` instead). ### getAllBy @@ -21,7 +21,8 @@ elements match. ### queryBy `queryBy*` queries returns the first matching node for a query, and return `null` if no elements -match. This is useful for asserting an element is not present. +match. This is useful for asserting an element is not present. This throws if more than one match is +found (use `queryAllBy` instead).. ### queryAllBy @@ -31,7 +32,8 @@ match. This is useful for asserting an element is not present. ### findBy `findBy*` queries return a promise which resolves when an element is found which matches the given -query. The promise is rejected if no element is found after a default timeout of `4500`ms. +query. The promise is rejected if no element is found or if more than one element is found after a +default timeout of `4500`ms. If you need to find more than one element, then use `findAllBy`. > Note, this is a simple combination of `getBy*` queries and > [`waitForElement`](/docs/api-async#waitforelement). The `findBy*` queries accept the From 9c75d3d9a98a2d5903687986b2bf85fb2f19d738 Mon Sep 17 00:00:00 2001 From: Brandon Carroll Date: Thu, 25 Apr 2019 15:41:09 -0400 Subject: [PATCH 2/2] change org name --- .all-contributorsrc | 2 +- README.md | 12 ++++++------ docs/api-events.md | 2 +- docs/cheat-sheet.md | 2 +- docs/ecosystem-jest-native.md | 6 +++--- website/core/Footer.js | 6 +++--- website/siteConfig.js | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index dc337dc..4519b7c 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,6 +1,6 @@ { "projectName": "native-testing-library-docs", - "projectOwner": "bcarroll22", + "projectOwner": "testing-library", "repoType": "github", "repoHost": "https://github.com", "files": [ diff --git a/README.md b/README.md index 8e4ea66..6bd5dee 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ height="80" width="80" alt="whale" - src="https://raw.githubusercontent.com/bcarroll22/native-testing-library/master/other/whale.png" + src="https://raw.githubusercontent.com/testing-library/native-testing-library/master/other/whale.png" /> @@ -20,14 +20,14 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/bb4911c5-74b1-48b4-aea8-3d317cec4761/deploy-status)](https://app.netlify.com/sites/native-testing-library/deploys) [![version](https://img.shields.io/npm/v/native-testing-library.svg?style=flat-square)](https://www.npmjs.com/package/native-testing-library) [![downloads](https://img.shields.io/npm/dm/native-testing-library.svg?style=flat-square)](http://www.npmtrends.com/native-testing-library) -[![MIT License](https://img.shields.io/npm/l/native-testing-library.svg?style=flat-square)](https://github.com/bcarroll22/native-testing-library/blob/master/LICENSE) +[![MIT License](https://img.shields.io/npm/l/native-testing-library.svg?style=flat-square)](https://github.com/testing-library/native-testing-library/blob/master/LICENSE) [![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) -[![Code of Conduct](https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square)](https://github.com/bcarroll22/native-testing-library/blob/master/CODE_OF_CONDUCT.md) +[![Code of Conduct](https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square)](https://github.com/testing-library/native-testing-library/blob/master/CODE_OF_CONDUCT.md) -[![Watch on GitHub](https://img.shields.io/github/watchers/bcarroll22/native-testing-library-docs.svg?style=social)](https://github.com/bcarroll22/native-testing-library-docs/watchers) -[![Star on GitHub](https://img.shields.io/github/stars/bcarroll22/native-testing-library-docs.svg?style=social)](https://github.com/bcarroll22/native-testing-library-docs/stargazers) +[![Watch on GitHub](https://img.shields.io/github/watchers/testing-library/native-testing-library-docs.svg?style=social)](https://github.com/testing-library/native-testing-library-docs/watchers) +[![Star on GitHub](https://img.shields.io/github/stars/testing-library/native-testing-library-docs.svg?style=social)](https://github.com/testing-library/native-testing-library-docs/stargazers) ## Guiding Principles @@ -56,7 +56,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d -
Brandon Carroll
Brandon Carroll

💻 🖋 📖 🎨
Jean-Marie Porchet
Jean-Marie Porchet

📖
Santi
Santi

📖
+
Brandon Carroll
Brandon Carroll

💻 🖋 📖 🎨
Jean-Marie Porchet
Jean-Marie Porchet

📖
Santi
Santi

📖
diff --git a/docs/api-events.md b/docs/api-events.md index c1b4376..bc7d996 100644 --- a/docs/api-events.md +++ b/docs/api-events.md @@ -20,7 +20,7 @@ fireEvent[eventName](node: FiberRoot, eventProperties: NativeEvent) ``` Convenience methods for firing events. Check out -[src/events.js](https://github.com/bcarroll22/native-testing-library/blob/master/src/events.js) for +[src/events.js](https://github.com/testing-library/native-testing-library/blob/master/src/events.js) for a full list as well as `validTargets` for every event type. ```javascript diff --git a/docs/cheat-sheet.md b/docs/cheat-sheet.md index 8494345..45445b5 100644 --- a/docs/cheat-sheet.md +++ b/docs/cheat-sheet.md @@ -10,4 +10,4 @@ copy of it on your desk to quickly take a peek at the most commonly used functio [Download the cheat sheet][cheatsheet] -[cheatsheet]: https://github.com/bcarroll22/native-testing-library/raw/master/other/cheat-sheet.pdf +[cheatsheet]: https://github.com/testing-library/native-testing-library/raw/master/other/cheat-sheet.pdf diff --git a/docs/ecosystem-jest-native.md b/docs/ecosystem-jest-native.md index e83917f..e7f6437 100644 --- a/docs/ecosystem-jest-native.md +++ b/docs/ecosystem-jest-native.md @@ -4,7 +4,7 @@ title: jest-native sidebar_label: Jest Matchers --- -[`jest-native`](https://github.com/bcarroll22/jest-native) is a companion library for +[`jest-native`](https://github.com/testing-library/jest-native) is a companion library for `native-testing-library` that provides custom element matchers for Jest. ``` @@ -27,7 +27,7 @@ expect(getByText(baseElement, 'Visible Example')).toBeVisible(); > `queryByTestId`) rather than a get function (like `getByTestId`). Otherwise the `get*` function > could throw an error before your assertion. -Check out [jest-native's documentation](https://github.com/bcarroll22/jest-native) for a full list +Check out [jest-native's documentation](https://github.com/testing-library/jest-native) for a full list of available matchers. -- [jest-native on GitHub](https://github.com/bcarroll22/jest-native) +- [jest-native on GitHub](https://github.com/testing-library/jest-native) diff --git a/website/core/Footer.js b/website/core/Footer.js index 38e73ff..c12fbc3 100755 --- a/website/core/Footer.js +++ b/website/core/Footer.js @@ -45,7 +45,7 @@ class Footer extends React.Component { Example API @@ -79,8 +79,8 @@ class Footer extends React.Component { > Star - GitHub - Edit the docs + GitHub + Edit the docs
{this.props.config.copyright}
diff --git a/website/siteConfig.js b/website/siteConfig.js index 8e05525..4dc02e1 100755 --- a/website/siteConfig.js +++ b/website/siteConfig.js @@ -32,7 +32,7 @@ const siteConfig = { // Used for publishing and more projectName: 'native-testing-library-docs', - organizationName: 'bcarroll22', + organizationName: 'testing-library', // For top-level user or org sites, the organization is still the same. // e.g., for the https://JoelMarcey.github.io site, it would be set like... // organizationName: 'JoelMarcey' @@ -98,9 +98,9 @@ const siteConfig = { // You may provide arbitrary config keys to be used as needed by your // template. For example, if you need your repo's URL... - repoUrl: 'https://github.com/bcarroll22/native-testing-library', + repoUrl: 'https://github.com/testing-library/native-testing-library', docsRepoUrl: 'https://github.com/bcarroll2/native-testing-library-docs', - editUrl: 'https://github.com/bcarroll22/native-testing-library-docs/blob/master/docs/', + editUrl: 'https://github.com/testing-library/native-testing-library-docs/blob/master/docs/', algolia: { apiKey: 'e17df0b04917412fc03a6e92a2ca087e',