BonnierNews/tallahassee

experiment with user event library

Opened this issue · 1 comments

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()

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)