@@ -110,7 +110,7 @@ module Support
110
110
end
111
111
112
112
it 'allows options to be selected by visible text' do
113
- option = instance_double ( Element , selected? : false )
113
+ option = instance_double ( Element , selected? : false , enabled? : true )
114
114
115
115
expect ( multi_select ) . to receive ( :find_elements )
116
116
. with ( xpath : './/option[normalize-space(.) = "fish"]' )
@@ -123,8 +123,8 @@ module Support
123
123
end
124
124
125
125
it 'allows options to be selected by index' do
126
- first_option = instance_double ( Element , selected? : true )
127
- second_option = instance_double ( Element , selected? : false )
126
+ first_option = instance_double ( Element , selected? : true , enabled? : true )
127
+ second_option = instance_double ( Element , selected? : false , enabled? : true )
128
128
129
129
allow ( first_option ) . to receive ( :property ) . with ( :index ) . and_return 0
130
130
expect ( first_option ) . not_to receive ( :click )
@@ -143,7 +143,7 @@ module Support
143
143
end
144
144
145
145
it 'allows options to be selected by returned value' do
146
- first_option = instance_double ( Element , selected? : false )
146
+ first_option = instance_double ( Element , selected? : false , enabled? : true )
147
147
allow ( multi_select ) . to receive ( :find_elements )
148
148
. with ( xpath : './/option[@value = "b"]' )
149
149
. and_return ( [ first_option ] )
@@ -224,7 +224,7 @@ module Support
224
224
end
225
225
226
226
it 'should fall back to slow lookups when "get by visible text fails" and there is a space' do
227
- first_option = instance_double ( Element , selected? : false , text : 'foo bar' )
227
+ first_option = instance_double ( Element , selected? : false , enabled? : true , text : 'foo bar' )
228
228
229
229
xpath1 = './/option[normalize-space(.) = "foo bar"]'
230
230
xpath2 = './/option[contains(., "foo")]'
0 commit comments