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

fix(fireEvent): Make sure react dispatches focus/blur events #758

Merged
merged 6 commits into from
Aug 5, 2020

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Aug 4, 2020

What:

Fix failing tests for react@experimental

Why:

  • see test(fireEvent): Add expected behavior for blur/focus in React #757 for focusin/focusout rationale
  • why test react@experimental: In case next is not released alongside experimental (such is the case right now). We don't support any experimental API right now but setting up infra before actual feature work makes feature work more approachable.

How:

  • Extend test matrix to react@experimental (in addition to next and latest)
    Switch from REACT_NEXT environment flag to REACT_DIST enum which can hold a valid npm dist tag for react.
  • fire focusin alongside focus and focusout alongside blur which is similar to how we handle mouseEnter/mouseLeave.
    Ideally we'd get everybody on board to using .focus() and blur() instead but that would only work with [email protected] or a browser which is less than ideal.
    Checklist:
  • [ ] Documentation added to the
    docs site
  • Tests
  • [ ] Typescript definitions updated
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 4, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 40fbff1:

Sandbox Source
React Configuration
kentcdodds/react-testing-library-examples Configuration

@eps1lon eps1lon changed the title test: Run CI with experimental React fix(fireEvent): Make sure react dispatches focus/blur events Aug 4, 2020
@eps1lon eps1lon added the bug Something isn't working label Aug 4, 2020
@eps1lon eps1lon requested a review from kentcdodds August 4, 2020 19:41
@codecov
Copy link

codecov bot commented Aug 4, 2020

Codecov Report

Merging #758 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #758   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          101       109    +8     
  Branches        16        16           
=========================================
+ Hits           101       109    +8     
Impacted Files Coverage Δ
src/fire-event.js 100.00% <100.00%> (ø)

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 0405f56...40fbff1. Read the comment docs.

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is reasonable 👍 thanks!

@kentcdodds kentcdodds merged commit 9aac157 into testing-library:master Aug 5, 2020
@kentcdodds
Copy link
Member

🎉 This PR is included in version 10.4.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

@eps1lon eps1lon deleted the test/experimental branch August 5, 2020 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants