testing-library / testing-playground

Simple and complete DOM testing playground that encourage good testing practices.
https://testing-playground.com
MIT License
783 stars 62 forks source link

`level` option of getByRole is not respected in Testing Playground #305

Closed ddehart closed 3 years ago

ddehart commented 3 years ago

Bug Report 🐛

Testing Playground does not respect the level option of getByRole.

On https://develop.testing-playground.com:

undefined using screen.getByRole('heading', {level: 1})

level-option

Array with two elements returned using screen.getAllByRole('heading', {level: 1})

getallbyrole-with-level

To Reproduce ✔️

undefined using screen.getByRole('heading', {level: 1})

Array with two elements returned using screen.getAllByRole('heading', {level: 1})

Expected behavior 🤔

Suggested solution 🔦

The level option was added in dom-testing-library v7.23.0. It looks like testing-playground is using v7.22.5.

Your Environment 💻

smeijer commented 3 years ago

Thanks! Are you willing / able to submit a PR?

ddehart commented 3 years ago

@smeijer I'll give it a shot!