From f3b7a102386a33254ebc09e9fb3c126c19813e3c Mon Sep 17 00:00:00 2001 From: Juliano Penna Date: Thu, 3 Sep 2020 16:37:46 -0300 Subject: [PATCH 1/7] Update async section of cheatsheet Remove replace `wait` for `waitFor` and deprecated methods --- docs/dom-testing-library/cheatsheet.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/dom-testing-library/cheatsheet.md b/docs/dom-testing-library/cheatsheet.md index c5070482a..acfc4dd5b 100644 --- a/docs/dom-testing-library/cheatsheet.md +++ b/docs/dom-testing-library/cheatsheet.md @@ -79,13 +79,8 @@ See [Which query should I use?](guide-which-query.md) See [Async API](dom-testing-library/api-async.md) -- **wait** (Promise) retry the function within until it stops throwing or times +- **waitFor** (Promise) retry the function within until it stops throwing or times out -- **waitForElement** (Promise) retry the function until it returns an element or - an array of elements - - `findBy` and `findAllBy` queries are async and retry until either a timeout - or if the query returns successfully; they wrap `waitForElement` -- **waitForDomChange** (Promise) retry the function each time the DOM is changed - **waitForElementToBeRemoved** (Promise) retry the function until it no longer returns a DOM node From cffb71510d32d5057833c705178e8adbc5b37757 Mon Sep 17 00:00:00 2001 From: Juliano Penna Date: Thu, 3 Sep 2020 18:26:47 -0300 Subject: [PATCH 2/7] Remove deprecated async methods --- docs/react-testing-library/cheatsheet.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/react-testing-library/cheatsheet.md b/docs/react-testing-library/cheatsheet.md index 5dd3c883f..090ecdd94 100644 --- a/docs/react-testing-library/cheatsheet.md +++ b/docs/react-testing-library/cheatsheet.md @@ -108,13 +108,8 @@ See [Which query should I use?](guide-which-query.md) See [dom-testing-library Async API](dom-testing-library/api-async.md) -- **wait** (Promise) retry the function within until it stops throwing or times +- **waitFor** (Promise) retry the function within until it stops throwing or times out -- **waitForElement** (Promise) retry the function until it returns an element or - an array of elements - - `findBy` and `findAllBy` queries are async and retry until either a timeout - or if the query returns successfully; they wrap `waitForElement` -- **waitForDomChange** (Promise) retry the function each time the DOM is changed - **waitForElementToBeRemoved** (Promise) retry the function until it no longer returns a DOM node From ea9d5ca7167536a032fe85c00f7670a36dcc2c6e Mon Sep 17 00:00:00 2001 From: Juliano Penna Date: Wed, 7 Oct 2020 11:05:42 -0300 Subject: [PATCH 3/7] Add deprecated message --- docs/react-testing-library/cheatsheet.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/react-testing-library/cheatsheet.md b/docs/react-testing-library/cheatsheet.md index 090ecdd94..62665626a 100644 --- a/docs/react-testing-library/cheatsheet.md +++ b/docs/react-testing-library/cheatsheet.md @@ -108,12 +108,20 @@ See [Which query should I use?](guide-which-query.md) See [dom-testing-library Async API](dom-testing-library/api-async.md) -- **waitFor** (Promise) retry the function within until it stops throwing or times - out +- **waitFor** (Promise) retry the function within until it stops throwing or times out - **waitForElementToBeRemoved** (Promise) retry the function until it no longer returns a DOM node > Remember to `await` or `.then()` the result of async functions in your tests! + +> Deprecated since v7.0.0 +> - **wait** (Promise) retry the function within until it stops throwing or times out +> - **waitForElement** (Promise) retry the function until it returns an element or +> an array of elements +> - `findBy` and `findAllBy` queries are async and retry until either a timeout +> or if the query returns successfully; they wrap `waitForElement` +> - **waitForDomChange** (Promise) retry the function each time the DOM is changed + ## Events From 7f4d17ef24d6e389951a02b717e2b20f3221b64e Mon Sep 17 00:00:00 2001 From: Juliano Penna Date: Wed, 7 Oct 2020 11:07:17 -0300 Subject: [PATCH 4/7] Add deprecated message --- docs/dom-testing-library/cheatsheet.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/dom-testing-library/cheatsheet.md b/docs/dom-testing-library/cheatsheet.md index acfc4dd5b..f76378877 100644 --- a/docs/dom-testing-library/cheatsheet.md +++ b/docs/dom-testing-library/cheatsheet.md @@ -86,6 +86,14 @@ See [Async API](dom-testing-library/api-async.md) > Remember to `await` or `.then()` the result of async functions in your tests! +> Deprecated since v7.0.0 +> - **wait** (Promise) retry the function within until it stops throwing or times +> - **waitForElement** (Promise) retry the function until it returns an element or +> an array of elements +> - `findBy` and `findAllBy` queries are async and retry until either a timeout +> or if the query returns successfully; they wrap `waitForElement` +> - **waitForDomChange** (Promise) retry the function each time the DOM is changed + ## Events See [Considerations for fireEvent](guide-events.md), [Events API](api-events.md) From 40ee55b93f34e7df098c30255479b10f513994ac Mon Sep 17 00:00:00 2001 From: Alex Krolick Date: Wed, 7 Oct 2020 12:09:26 -0700 Subject: [PATCH 5/7] formatting to separate deprecated methods --- docs/dom-testing-library/cheatsheet.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/dom-testing-library/cheatsheet.md b/docs/dom-testing-library/cheatsheet.md index f76378877..acee8669a 100644 --- a/docs/dom-testing-library/cheatsheet.md +++ b/docs/dom-testing-library/cheatsheet.md @@ -77,16 +77,15 @@ See [Which query should I use?](guide-which-query.md) ## Async -See [Async API](dom-testing-library/api-async.md) +See [Async API](dom-testing-library/api-async.md). Remember to `await` or `.then()` +the result of async functions in your tests! - **waitFor** (Promise) retry the function within until it stops throwing or times out - **waitForElementToBeRemoved** (Promise) retry the function until it no longer returns a DOM node -> Remember to `await` or `.then()` the result of async functions in your tests! - -> Deprecated since v7.0.0 +> **Deprecated since v7.0.0:** > - **wait** (Promise) retry the function within until it stops throwing or times > - **waitForElement** (Promise) retry the function until it returns an element or > an array of elements From 41e085f6a8800f45f5b8911ba9c63155ca7f6ed7 Mon Sep 17 00:00:00 2001 From: Alex Krolick Date: Wed, 7 Oct 2020 12:11:10 -0700 Subject: [PATCH 6/7] remove duplicated content --- docs/react-testing-library/cheatsheet.md | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/docs/react-testing-library/cheatsheet.md b/docs/react-testing-library/cheatsheet.md index 62665626a..30b6612b9 100644 --- a/docs/react-testing-library/cheatsheet.md +++ b/docs/react-testing-library/cheatsheet.md @@ -106,22 +106,8 @@ See [Which query should I use?](guide-which-query.md) ## Async -See [dom-testing-library Async API](dom-testing-library/api-async.md) - -- **waitFor** (Promise) retry the function within until it stops throwing or times out -- **waitForElementToBeRemoved** (Promise) retry the function until it no longer - returns a DOM node - -> Remember to `await` or `.then()` the result of async functions in your tests! - -> Deprecated since v7.0.0 -> - **wait** (Promise) retry the function within until it stops throwing or times out -> - **waitForElement** (Promise) retry the function until it returns an element or -> an array of elements -> - `findBy` and `findAllBy` queries are async and retry until either a timeout -> or if the query returns successfully; they wrap `waitForElement` -> - **waitForDomChange** (Promise) retry the function each time the DOM is changed - +The [dom-testing-library Async API](dom-testing-library/api-async.md) is +re-exported from React Testing Library. ## Events From 0cfcf582e18b096aba382bd10eee07d86ec3187f Mon Sep 17 00:00:00 2001 From: Alex Krolick Date: Wed, 7 Oct 2020 12:19:05 -0700 Subject: [PATCH 7/7] Update cheatsheet.md --- docs/react-testing-library/cheatsheet.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/react-testing-library/cheatsheet.md b/docs/react-testing-library/cheatsheet.md index 30b6612b9..d0e9508ee 100644 --- a/docs/react-testing-library/cheatsheet.md +++ b/docs/react-testing-library/cheatsheet.md @@ -109,6 +109,11 @@ See [Which query should I use?](guide-which-query.md) The [dom-testing-library Async API](dom-testing-library/api-async.md) is re-exported from React Testing Library. +- **waitFor** (Promise) retry the function within until it stops throwing or + times out +- **waitForElementToBeRemoved** (Promise) retry the function until it no longer + returns a DOM node + ## Events See [Events API](dom-testing-library/api-events.md)