Search code examples
testingember.jsacceptance-testing

How to trigger an `input` field's `newline` action in an Ember.js acceptance test?


I had thought that keyEvent('.my input', 'keypress', 13); would trigger the input's newline action, but it doesn't seem to.

It seems others have had a similar problem

Is there any other/better way to trigger the newline action from my acceptance test?


Solution

  • Looks like triggering a keydown then a keyup event (instead of a keypress) does the trick:

    keyEvent('.my input', 'keydown', 13);
    keyEvent('.my input', 'keyup', 13);