@@ -120,19 +120,47 @@ describeWithShallowAndMount('trigger', mountingMethod => {
120120 expect ( stub ) . calledWith ( 123 )
121121 } )
122122
123- it ( 'does not fire on disabled elements' , ( ) => {
123+ it ( 'does not fire on valid disabled elements' , ( ) => {
124124 const clickHandler = sandbox . stub ( )
125- const TestComponent = {
126- template : '<button disabled @click="clickHandler"/ >' ,
125+ const ButtonComponent = {
126+ template : '<button disabled @click="clickHandler">Button</button >' ,
127127 props : [ 'clickHandler' ]
128128 }
129- const wrapper = mountingMethod ( TestComponent , {
129+ const buttonWrapper = mountingMethod ( ButtonComponent , {
130130 propsData : {
131131 clickHandler
132132 }
133133 } )
134- wrapper . trigger ( 'click' )
134+ buttonWrapper . trigger ( 'click' )
135135 expect ( clickHandler . called ) . to . equal ( false )
136+
137+ const changeHandler = sandbox . stub ( )
138+ const InputComponent = {
139+ template : '<input disabled @change="changeHandler"/>' ,
140+ props : [ 'changeHandler' ]
141+ }
142+ const inputWrapper = mountingMethod ( InputComponent , {
143+ propsData : {
144+ changeHandler
145+ }
146+ } )
147+ inputWrapper . trigger ( 'change' )
148+ expect ( changeHandler . called ) . to . equal ( false )
149+ } )
150+
151+ it ( 'fires on invalid disabled elements' , ( ) => {
152+ const clickHandler = sandbox . stub ( )
153+ const LinkComponent = {
154+ template : '<a disabled href="#" @click="clickHandler">Link</a>' ,
155+ props : [ 'clickHandler' ]
156+ }
157+ const linkWrapper = mountingMethod ( LinkComponent , {
158+ propsData : {
159+ clickHandler
160+ }
161+ } )
162+ linkWrapper . trigger ( 'click' )
163+ expect ( clickHandler . called ) . to . equal ( true )
136164 } )
137165
138166 it ( 'handles .prevent' , ( ) => {
0 commit comments