Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

Update dependency @testing-library/dom to v7 #247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Mar 12, 2020

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@testing-library/dom ^6.11.0 -> ^7.0.0 age adoption passing confidence

Release Notes

testing-library/dom-testing-library

v7.31.2

Compare Source

Bug Fixes

v7.31.1

Compare Source

Bug Fixes

v7.31.0

Compare Source

Features
  • Add extra error messages when screen was passed instead of a DOM element (#​949) (c273ed5)

v7.30.4

Compare Source

Bug Fixes

v7.30.3

Compare Source

Bug Fixes
  • types: missing ignore parameter for SelectorMatcherOptions (7edd2bd)

v7.30.2

Compare Source

Bug Fixes
  • types: exclude tsconfig from types folder in publish flow (#​923) (bb83d8c)

v7.30.1

Compare Source

Bug Fixes
  • timers: safe check for setImmediate and clearImmediate (#​916) (14788b6)

v7.30.0

Compare Source

Features
  • Improve error message when passing an Array while a single Element is expected (#​906) (300bfe2)

v7.29.6

Compare Source

Bug Fixes
  • Don't assume mocked timers imply jest fake timers (#​900) (f7b5c33)

v7.29.5

Compare Source

Bug Fixes

v7.29.4

Compare Source

Bug Fixes

v7.29.3

Compare Source

Bug Fixes
  • prevent crashing on elements without parentElement (#​871) (6d32457)

v7.29.2

Compare Source

Bug Fixes

v7.29.1

Compare Source

Bug Fixes

v7.29.0

Compare Source

Features

v7.28.1

Compare Source

Bug Fixes
  • suggestions: don't suggest byLabelText when using byLabelText (53f29f7)

v7.28.0

Compare Source

Features

v7.27.1

Compare Source

Bug Fixes
  • suggestions: only warn about inaccessible elements when actually showing the suggestion (#​827) (9494fdc)

v7.27.0

Compare Source

Features

v7.26.7

Compare Source

Bug Fixes
  • use node property instead of selector for type=text input (#​823) (7e5da11)

v7.26.6

Compare Source

Bug Fixes

v7.26.5

Compare Source

Bug Fixes

v7.26.4

Compare Source

Bug Fixes
  • Disconnect MutationObserver synchronously in wait-for (#​801) (2cb8405)

v7.26.3

Compare Source

Bug Fixes

v7.26.2

Compare Source

Bug Fixes
  • types: make third and fourth params optional for findAllBy and findBy built queries (#​794) (9387b08)

v7.26.1

Compare Source

Bug Fixes

v7.26.0

Compare Source

Features

v7.25.0

Compare Source

Features

v7.24.5

Compare Source

Bug Fixes

v7.24.4

Compare Source

Bug Fixes

v7.24.3

Compare Source

Bug Fixes
  • Mark deprecated methods as [@deprecated](https://togithub.com/deprecated) (#​771) (68f8f81)

v7.24.2

Compare Source

Bug Fixes

v7.24.1

Compare Source

Bug Fixes

v7.24.0

Compare Source

Features

v7.23.0

Compare Source

Features
  • ByRole: Add 'level' option for *ByRole('heading') (#​757) (ea52c91)

v7.22.6

Compare Source

Bug Fixes

v7.22.5

Compare Source

Bug Fixes
  • suggest hidden:true with getByRole if element is inaccessible (#​745) (6d6641d)

v7.22.4

Compare Source

Bug Fixes

v7.22.3

Compare Source

Bug Fixes

v7.22.2

Compare Source

Bug Fixes

v7.22.1

Compare Source

Bug Fixes
  • Ignore pseudo elements for accessible name by default (#​736) (01e0242)

v7.22.0

Compare Source

Features

v7.21.8

Compare Source

Bug Fixes

v7.21.7

Compare Source

Bug Fixes

v7.21.6

Compare Source

Bug Fixes

v7.21.5

Compare Source

Bug Fixes
  • add explicit error message for null or undefined matchers (#​718) (22988a6)

v7.21.4

Compare Source

Bug Fixes

v7.21.3

Compare Source

Bug Fixes

v7.21.2

Compare Source

Bug Fixes

v7.21.1

Compare Source

Bug Fixes
  • types: allow bound function to accept string and regex matcher (1582c73)
  • by role types (ea7a71d)
Reverts
  • revert "fix: by role types" (8391d49)

v7.21.0

Compare Source

Features
  • role: support {checked: true} for checkbox / radio (#​692) (fcdeb31)

v7.20.2

Compare Source

Bug Fixes

v7.20.1

Compare Source

Bug Fixes
  • escape regexps that are used as query suggestion arguments (#​694) (aaceea2)

v7.20.0

Compare Source

Features

v7.19.0

Compare Source

Features

v7.18.2

Compare Source

Bug Fixes

v7.18.1

Compare Source

Bug Fixes
  • use the first label for LabelText query suggestions (#​672) (373dbc4)

v7.18.0

Compare Source

Features

v7.17.2

Compare Source

Bug Fixes

v7.17.1

Compare Source

Bug Fixes
  • waitFor: handle odd timing issue with fake timers (#​667) (4ad3673)

v7.17.0

Compare Source

Features

🚨 It's possible this will break your tests if you were working around our limitations before. Fixing the issue should be straightforward. Here's an example from my (Kent's) own workaround:

  // using fake timers to skip debounce time
  jest.useFakeTimers()
  userEvent.clear(notesTextarea)
  userEvent.type(notesTextarea, newNotes)
- act(() => jest.runAllTimers())

  await screen.findByLabelText(/loading/i)
  // wait for the loading spinner to go away
  await waitForLoadingToFinish()

  jest.useRealTimers()

Notice that all I needed to change was removing manually advancing timers because now we handle things automatically for you 🎉

v7.16.3

Compare Source

Bug Fixes

v7.16.2

Compare Source

Bug Fixes

v7.16.1

Compare Source

Bug Fixes

v7.16.0

Compare Source

Features

v7.15.1

Compare Source

Bug Fixes

v7.15.0

Compare Source

Features
  • add explicit error message for Promises passed to getWindowFromNode (#​646) (2a51345), closes #​609

v7.14.3

Compare Source

Bug Fixes

v7.14.2

Compare Source

Bug Fixes

v7.14.1

Compare Source

Bug Fixes

v7.14.0

Compare Source

Features
  • suggestions: add option to get specific query suggestions (#​627) (30a1ee8)

v7.13.0

Compare Source

Bug Fixes
Features

v7.12.0

Compare Source

Features

v7.11.0

Compare Source

Features
  • return more data from getSuggestedQuery to support tooling (#​608) (a029772)

v7.10.1

Compare Source

Bug Fixes

v7.10.0

Compare Source

Features

v7.9.0

Compare Source

Features

v7.8.0

Compare Source

Features
  • config: add eventWrapper config for wrapping fireEvent (#​600) (de9dd82)

v7.7.3

Compare Source

Bug Fixes

v7.7.2

Compare Source

Bug Fixes

v7.7.1

Compare Source

Bug Fixes

v7.7.0

Compare Source

Features

v7.6.0

Compare Source

Features

v7.5.9

Compare Source

Bug Fixes
  • misleading advice in waitForElement deprecation warning (#​588) (b641e8d)

v7.5.8

Compare Source

Bug Fixes
  • TS: Forbid async function as callback argument for waitFor (#​572) (c1bf047)

v7.5.7

Compare Source

Bug Fixes

v7.5.6

Compare Source

Bug Fixes
  • types: add fourth param to build findAllBy and findBy queries (#​574) (6491ef1)

v7.5.5

Compare Source

Bug Fixes
  • TS: declare first parameter of screen.debug as optional (#​573) (dcad11b)

v7.5.4

Compare Source

Bug Fixes

v7.5.3

Compare Source

Bug Fixes

v7.5.2

Compare Source

Bug Fixes

v7.5.1

Compare Source

Bug Fixes

v7.5.0

Compare Source

Features

v7.4.0

Compare Source

Bug Fixes
  • Exclude container in the list of queryable roles (#​550) (7b3ca97)
Features

v7.3.0

Compare Source

Features
  • waitFor: improve error stack traces for async errors (#​542) (d3287a1)

v7.2.2

Compare Source

Bug Fixes

v7.2.1

Compare Source

Bug Fixes

v7.2.0

Compare Source

Features
  • waitFor: improve error message for non-function callbacks (#​515) (672f231)

v7.1.4

Compare Source

Bug Fixes

v7.1.3

Compare Source

Bug Fixes
  • fireEvent: Set composed property on relevant synthetic events (#​496) (39dc929)

v7.1.2

Compare Source

Bug Fixes

v7.1.1

Compare Source

Bug Fixes

v7.1.0

Compare Source

Features

v7.0.4

Compare Source

Bug Fixes
  • allByLabelText: forEach on NodeList is not supported in edge (#​487) (976675b)

v7.0.3

Compare Source

Bug Fixes

v7.0.2

Compare Source

Bug Fixes
  • remove very old deprecated method (98e5bb3)

v7.0.1

Compare Source

Bug Fixes

v7.0.0

Compare Source

Features
  • waitFor: replace wait with waitFor (read more in the Breaking changes list below) (2b641e1), closes #​376 #​416
  • waitForElementToBeRemoved: support passing an element directly (#​460) (1b711a4)

The new feature in waitForElementToBeRemoved is pretty cool. Here's what you had to do before:

const submitButton = screen.getByText(/submit/i)
fireEvent.click(submitButton)
await waitForElementToBeRemoved(() => screen.getByText(/submit/i))
// submit is now gone

That still works, but you can now do this too:

const submitButton = screen.getByText(/submit/i)
fireEvent.click(submitButton)
await waitForElementToBeRemoved(submitButton)
// submit is now gone

Cool right!?

BREAKING CHANGES
Drop Node 8

Node 10 or greater is required. Node 8 is out of LTS (#​459) (c3ab843), closes #​430

MutationObserver shim removed.

MutationObserver is supported by all major browsers and recent versions of JSDOM. If you need, you can create your own shim (using @sheerun/mutationobserver-shim) and attach it to the window. If you're on an old version of Jest, either update your version of Jest or use jest-environment-jsdom-sixteen (#​457) (e3fdb8e9)

If you're using the latest version of react-scripts (Create React App), here are your options:

Option 1:

Wait until the react-scripts updates to the latest version of Jest (subscribe to this PR)

Option 2 (recommended):

Install jest-environment-jsdom-sixteen and then update your test script:

  ...
  "scripts": {
    ...
-   "test": "react-scripts test --env=dom"
+   "test": "react-scripts test --env=jest-environment-jsdom-sixteen"
    ...
  },
  ...
  "devDependencies": {
    ...
    "jest-environment-jsdom-sixteen": "^1.0.3",
    ...
  },
  ...

Option 3:

Add the MutationObserver constructor to window via @sheerun/mutationobserver-shim:

npm install --save-dev @​sheerun/mutationobserver-shim
### yarn add --dev @​sheerun/mutationobserver-shim
// src/setupTests.js
import MutationObserver from '@​sheerun/mutationobserver-shim'
window.MutationObserver = MutationObserver
waitFor: wait is now deprecated in favor of waitFor

waitFor satisfies the use cases of wait, waitForElement, and waitForDomChange, so those have been deprecated (will be removed in the next major version). Here are some examples of how you can change those:


</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/nearform/react-browser-hooks).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant