Changing values and triggering inputs
See original GitHub issueI am currently on avoriaz 1.13.1
and use simulate()
pretty regularly in my Vue Component tests as so:
const component = mount(SearchForm)
const searchInput = component.find("input#search")[0]
searchInput.element.value = 'Jane Doe'
searchInput.simulate('input')
These specs work correctly and pass.
As I upgraded to avoriaz 2.4.3
, and I change the deprecated simulate()
to trigger()
, the specs fail. I also noticed that if I console log searchInput.element
, it will log HTMLInputElement { _prevClass: '', _value: '' }
, and if I console log searchInput.element.value
, it console logs nothing. Previously, console logging searchInput.element.value
would return a value and would be set correctly. I have looked around and am wondering why when I upgrade, searchInput.element.value
doesn’t seem to be returning anything like it use to.
I am still learning a lot about Vue and avoriaz, so it is quite possible I just missed something. But was wondering if you had any ideas @eddyerburgh. Thanks for any help 😄
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
@eddyerburgh works great, all my specs passed with simply replacing
simulate
withtrigger
. Also, switching toVue.use(Vuex)
was a simple find and replace from what I had which wasavoriaz.use(Vuex)
.Thanks for the help and the quick response and fix, you are the man, love your software!
@eddyerburgh finally got to getting back to this! Here we go, a super basic component with an input, and then the two tests, one with
trigger()
and one withsimulate()
! Also I am running this onavoriaz 2.4.3
.