-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replacing header nav partial with header component #3136
base: main
Are you sure you want to change the base?
Conversation
2c8a29c
to
1e4545c
Compare
1e4545c
to
ef60301
Compare
I wonder if there's a backwards-compatible way to introduce this change (that won't require downstream applications to add the Maybe we could keep the header_navbar partial?
|
@cbeer I brought the partial back and its associated test and set up with a deprecation warning. |
@@ -0,0 +1,13 @@ | |||
# frozen_string_literal: true | |||
|
|||
describe 'shared/_header_navbar', type: :view do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe 'shared/_header_navbar', type: :view do | |
RSpec.describe 'shared/_header_navbar', type: :view do |
|
||
it 'has nav links' do | ||
render | ||
expect(rendered).to have_selector '#user-util-collapse', text: 'links' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to have a view test at all? View tests are deprecated in rails. Instead can you use a request test, feature test, or a component test?
<%= render blacklight_config.header_component.new(blacklight_config: blacklight_config) %> | ||
<% else %> | ||
<%= render Spotlight::HeaderComponent.new(blacklight_config: blacklight_config) %> | ||
<% ActiveSupport::Deprecation.warn("_header_navbar.html.erb will be deprecated in future versions. Please use Blaclight configuration to specify your HeaderComponent.") %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<% ActiveSupport::Deprecation.warn("_header_navbar.html.erb will be deprecated in future versions. Please use Blaclight configuration to specify your HeaderComponent.") %> | |
<% ActiveSupport::Deprecation.warn("_header_navbar.html.erb will be deprecated in future versions. Please use Blacklight configuration to specify your HeaderComponent.") %> |
Context
Relates to having tests pass with Blacklight 8.3 and using a Spotlight HeaderComponent instead of shared/_header_navbar. The Spotlight header is almost exactly the same as the default Blacklight header except it does not include the search bar (which is elsewhere on the page).
Refer to #3047 and this comment which includes a checklist of tests to fix: #3047 (comment)
For 8.3, the following tests are failing:
What this pull request does
How to test
These tests should still pass in Blacklight 7.
How to test with Blacklight 8: Generate test app (.internal_test_app). Update the internal test app's Gemfile to use Blacklight 8.3. Run bundle install for the internal test app. Then run rspec ./spec/views/spotlight/pages/show.html.erb_spec.rb:46 and rspec ./spec/views/spotlight/pages/show.html.erb_spec.rb:50.