Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: toHaveAttribute doesn't work #524

Merged
merged 2 commits into from Dec 22, 2020

Conversation

DaleSeo
Copy link
Contributor

@DaleSeo DaleSeo commented Dec 19, 2020

What:

Hi, I'm new to this project. While just following the README.md, I noticed that the very first example test code doesn't work.

   click (90 ms)

   click

    expect(element).toHaveAttribute("checked", true) // element.getAttribute("checked") === true

    Expected the element to have attribute:
      checked=true
    Received:
      null

I realized that using toBeChecked() makes the test pass.

Why:

I played around with this checkbox on the dev tools on my browser and I noticed that the checked attribute doesn't actually get added to the input element when I clicked the checkbox.

Checklist:

  • Documentation
  • Tests N/A
  • Typings N/A
  • Ready to be merged N/A

@codecov
Copy link

codecov bot commented Dec 19, 2020

Codecov Report

Merging #524 (daa999a) into master (377e99c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #524   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          675       675           
  Branches       211       211           
=========================================
  Hits           675       675           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 377e99c...daa999a. Read the comment docs.

@nickmccurdy nickmccurdy merged commit 481267b into testing-library:master Dec 22, 2020
@github-actions
Copy link

🎉 This PR is included in version 12.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

2 participants