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

experiment with user event library #190

Open
andolf opened this issue Mar 10, 2023 · 1 comment
Open

experiment with user event library #190

andolf opened this issue Mar 10, 2023 · 1 comment

Comments

@andolf
Copy link
Contributor

andolf commented Mar 10, 2023

In recent exploration with jsdom it's become quite clear that Tallahassee has taken some freedom in how events are being fired when used programmatically.

Example:
input.value = "abc" contrary to popular belief does not actually fire any events like input. If the user actually types in the input, then it will be fired. jsdom behaves this way correctly.

Instead of overriding that behaviour (because tinkering with the value property on <input> elements is a slippery slope) it feels safer (and better all around) to instead have an interface where you can interact with an element.

So some suggestions!

  • input.userType("abc")
    Sets value and fires relevant events connected to that change. Requires an override on the element prototype itself to provide this.
  • browser.userType(input, "abc")
    Keeps the event on the browser object provided by Tallahassee and makes it much clearer where the main API resides, which is the browser instance returned from new Tallahassee()
@andolf
Copy link
Contributor Author

andolf commented Mar 10, 2023

Regardless, all of this mimics the behaviour from other popular libraries such as user-event and can such either be provided in Tallahassee itself, or recommended to use with (since it already works on top of jsdom)

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

No branches or pull requests

1 participant