Skip to content
Snippets Groups Projects
Commit a1f4569d authored by Charlie Ablett's avatar Charlie Ablett
Browse files

Merge branch 'ps-fix-new-dropdown-with-no-items' into 'master'

Fix new dropdown showing on mobile with no items

See merge request gitlab-org/gitlab!64268
parents ed26027d fec8a11d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -22,7 +22,7 @@ def top_nav_responsive_view_model(project:, group:)
 
new_view_model = new_dropdown_view_model(project: project, group: group)
 
if new_view_model
if new_view_model && new_view_model.fetch(:menu_sections)&.any?
builder.add_view(NEW_VIEW, new_view_model)
end
 
Loading
Loading
Loading
Loading
@@ -539,10 +539,18 @@
end
 
context 'with new' do
let(:with_new_view_model) { { id: 'test-new-view-model' } }
let(:with_new_view_model) { { menu_sections: [{ id: 'test-new-view-model' }] } }
 
it 'has new subview' do
expect(subject[:views][:new]).to eq({ id: 'test-new-view-model' })
expect(subject[:views][:new]).to eq(with_new_view_model)
end
end
context 'with new and no menu_sections' do
let(:with_new_view_model) { { menu_sections: [] } }
it 'has new subview' do
expect(subject[:views][:new]).to be_nil
end
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment