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 component.type function #37

Merged
merged 1 commit into from
Aug 24, 2019
Merged

feat: add component.type function #37

merged 1 commit into from
Aug 24, 2019

Conversation

timdeschryver
Copy link
Member

This PR adds a type function to set an input's value - inspiration from https://github.com/testing-library/user-event.

For example:

const component = render(AppComponent);
component.type(component.getByTestId('input'), 'Oh, hello!');

Has some options:

  • By default each char gets inputted individually but it's configurable to input the value at once with allAtOnce:
const component = render(AppComponent);
component.type(component.getByTestId('input'), 'Oh, hello!', { allAtOnce: true });
  • Add a delay for each input with delay (in ms):
const component = render(AppComponent);
component.type(component.getByTestId('input'), 'Oh, hello!', { delay: 100 });

cc @d3lm

@d3lm
Copy link

d3lm commented Aug 19, 2019

Yay! Great PR @timdeschryver. Love to see this addition <3.

@timdeschryver timdeschryver merged commit 41365e3 into master Aug 24, 2019
@timdeschryver timdeschryver deleted the pr/type branch August 24, 2019 15:36
@timdeschryver
Copy link
Member Author

🎉 This PR is included in version 7.2.0 🎉

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.

2 participants