Gabriel Grant
Gabriel Grant

Reputation: 5601

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?

Upvotes: 1

Views: 100

Answers (1)

Gabriel Grant
Gabriel Grant

Reputation: 5601

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

Upvotes: 1

Related Questions