bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 574 forks source link

Fix bip_select by removing unsupported "Node#trigger" call #588

Closed duffyjp closed 5 years ago

duffyjp commented 6 years ago

Fixes #587

bip_text was already using .click which was coincidentally the only bip test helper I was using. Changing the others to use .click instead of .trigger('click') and they work with Capybara (js: true).

The test in #587 now passes.

Finished in 8.68 seconds (files took 4.81 seconds to load)
1 example, 0 failures

Please let me know if there is any specific testing you'd like me to do. This was a super quick fix.

Thanks.

limsammy commented 6 years ago

Hey I'm trying to get the test helpers to work. None are working. Do you know why that is? I followed what you did exactly and even with using .click instead of .trigger it fails.

bryan-liff commented 6 years ago

With headless_chrome becoming the de facto standard, this change is critical for many!

caifara commented 5 years ago

bip_select works like this (although I'm working on a pretty old codebase):

def bip_select(model, attr, name)
  id = BestInPlace::Utils.build_best_in_place_id model, attr
  find("##{id}").click
  find("##{id}").select(name)
end

I've put the code in spec/support/bip_helpers.rb while the TestHelpers aren't working.