sul-dlss / exhibits

Stanford University Libraries online exhibits showcase
https://exhibits.stanford.edu
Other
20 stars 7 forks source link

Embed block spec fails with spotlight v3.6.0.beta1 #2477

Closed corylown closed 4 months ago

corylown commented 4 months ago
bundle exec rspec ./spec/features/embed_block_spec.rb
Failure/Error: raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}"

     ActionController::RoutingError:
       No route matches [GET] "/exhibit-title-1/home/undefined"

The path helper seems to behave properly:

(ruby) spotlight.edit_exhibit_home_page_path(exhibit)
"/exhibit-title-1/home/edit"

But the action is undefined when instructing capybara to visit that route:

(ruby) visit spotlight.edit_exhibit_home_page_path(exhibit)
Capybara starting Puma...
* Version 5.6.8, codename: Birdie's Version
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:65271
DEPRECATION WARNING: Blacklight 8 will filter out non-search parameter, including: locale. (called from permit_search_params at /Users/corylown/.rbenv/versions/3.2.4/lib/ruby/gems/3.2.0/gems/blacklight-7.37.0/lib/blacklight/parameters.rb:77)
2024-07-17 09:13:01 -0400 Rack app ("GET /exhibit-title-1/home/undefined" - (127.0.0.1)): #<ActionController::RoutingError: No route matches [GET] "/exhibit-title-1/home/undefined">
nil
corylown commented 4 months ago

This test marked as pending seems to have same issue (but I'm not sure if that's the reason it was marked pending): https://github.com/sul-dlss/exhibits/blob/f8ba2a2deafba0f30f92f89187fb5f76ba547c2f/spec/features/viewers_spec.rb#L93

taylor-steve commented 4 months ago

I don't get this behavior in beta7, do we need to resolve the beta1 issue?

They do fail in beta7 which made me question fill_in_typeahead_field https://github.com/sul-dlss/exhibits/blob/49231ebf8adbeeb8244d32b91f6c18215beb92e4/spec/support/javascript_feature_helpers.rb#L5-L17

Any idea why both clicks? I dropped $(".tt-suggestion").click(); and things started passing. This is making me question the flappy guards we added to Spotlight. I think most of those were to fix fill_in_solr_document_block_typeahead_field steps, which uses fill_in_typeahead_field.

corylown commented 4 months ago

This seemed to fix it, somehow: https://github.com/sul-dlss/exhibits/pull/2484