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

feat: add userEvent.tripleClick API #773

Merged
merged 1 commit into from
Nov 3, 2021
Merged

feat: add userEvent.tripleClick API #773

merged 1 commit into from
Nov 3, 2021

Conversation

ph-fritsche
Copy link
Member

@ph-fritsche ph-fritsche commented Nov 2, 2021

What:

Add a userEvent.tripleClick(element) API.

Why:

Triple clicking into an input is a common user interaction to select the value of an input field.

#763 allowed to simulate this per pointer API.

How:

userEvent.tripleClick(element) is a shortcut for:

userEvent.hover(element)
userEvent.pointer({keys: '[MouseLeft][MouseLeft][MouseLeft]', target: element})

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 2, 2021

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 02f49e8:

Sandbox Source
userEvent-PR-template Configuration

@codecov
Copy link

codecov bot commented Nov 2, 2021

Codecov Report

Merging #773 (02f49e8) into alpha (07bf49b) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             alpha      #773   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         1312      1320    +8     
  Branches       505       507    +2     
=========================================
+ Hits          1312      1320    +8     
Impacted Files Coverage Δ
src/click.ts 100.00% <100.00%> (ø)
src/setup.ts 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 07bf49b...02f49e8. Read the comment docs.

@ph-fritsche ph-fritsche marked this pull request as ready for review November 2, 2021 14:44
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.

Stellar 👍

@kentcdodds
Copy link
Member

Meant to mark this as "Approved" 👍

@ph-fritsche ph-fritsche merged commit 3fa471f into alpha Nov 3, 2021
@ph-fritsche ph-fritsche deleted the feat-tripleClick branch November 3, 2021 07:37
@github-actions
Copy link

github-actions bot commented Nov 3, 2021

🎉 This PR is included in version 14.0.0-alpha.6 🎉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants