Commit aed848cc authored by Angelo Gulina's avatar Angelo Gulina Committed by Jonas Wälter

Apply 3 suggestion(s) to 3 file(s)

parent 1c4a0e09
- feature_project_list_filter_bar = Feature.enabled?(:project_list_filter_bar) - feature_project_list_filter_bar = Feature.enabled?(:project_list_filter_bar)
%ul.nav-links.scrolling-tabs.mobile-separator.nav.nav-tabs{ class: ('border-0' if feature_project_list_filter_bar) } %ul.nav-links.scrolling-tabs.mobile-separator.nav.nav-tabs{ class: ('gl-border-0!' if feature_project_list_filter_bar) }
= nav_link(page: [dashboard_projects_path, root_path]) do = nav_link(page: [dashboard_projects_path, root_path]) do
= link_to dashboard_projects_path, class: 'shortcuts-activity', data: {placement: 'right'} do = link_to dashboard_projects_path, class: 'shortcuts-activity', data: {placement: 'right'} do
= _("Your projects") = _("Your projects")
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
.col-12 .col-12
.svg-content .svg-content
= image_tag 'illustrations/labels.svg', data: { qa_selector: 'svg_content' } = image_tag 'illustrations/labels.svg', data: { qa_selector: 'svg_content' }
.text-content.text-center.pt-0 .text-content.gl-text-center.gl-pt-0!
%h4.text-center= s_('TopicsEmptyState|There are no topics to show.') %h4= _('There are no topics to show.')
%p= _("You can apply topics to projects to categorize them.") %p= _('You can apply topics to projects to categorize them.')
...@@ -34332,6 +34332,9 @@ msgstr "" ...@@ -34332,6 +34332,9 @@ msgstr ""
msgid "There are no projects shared with this group yet" msgid "There are no projects shared with this group yet"
msgstr "" msgstr ""
msgid "There are no topics to show."
msgstr ""
msgid "There are no variables yet." msgid "There are no variables yet."
msgstr "" msgstr ""
...@@ -35830,9 +35833,6 @@ msgstr "" ...@@ -35830,9 +35833,6 @@ msgstr ""
msgid "Topics (optional)" msgid "Topics (optional)"
msgstr "" msgstr ""
msgid "TopicsEmptyState|There are no topics to show."
msgstr ""
msgid "Total" msgid "Total"
msgstr "" msgstr ""
......
...@@ -14,7 +14,7 @@ RSpec.describe 'Explore Topics' do ...@@ -14,7 +14,7 @@ RSpec.describe 'Explore Topics' do
visit topics_explore_projects_path visit topics_explore_projects_path
expect(current_path).to eq topics_explore_projects_path expect(current_path).to eq topics_explore_projects_path
expect(page).to have_content('There are no topics to show') expect(page).to have_content('There are no topics to show.')
end end
end end
......
...@@ -5,9 +5,9 @@ require 'spec_helper' ...@@ -5,9 +5,9 @@ require 'spec_helper'
RSpec.describe 'User explores projects' do RSpec.describe 'User explores projects' do
context 'when some projects exist' do context 'when some projects exist' do
let_it_be(:archived_project) { create(:project, :archived) } let_it_be(:archived_project) { create(:project, :archived) }
let_it_be(:internal_project) { create(:project, :internal) } let_it_be(:internal_project) { create(:project, :internal, topic_list: 'topic1') }
let_it_be(:private_project) { create(:project, :private) } let_it_be(:private_project) { create(:project, :private) }
let_it_be(:public_project) { create(:project, :public) } let_it_be(:public_project) { create(:project, :public, topic_list: 'topic1') }
context 'when not signed in' do context 'when not signed in' do
context 'when viewing public projects' do context 'when viewing public projects' do
...@@ -28,6 +28,29 @@ RSpec.describe 'User explores projects' do ...@@ -28,6 +28,29 @@ RSpec.describe 'User explores projects' do
expect(page).to have_current_path(new_user_session_path) expect(page).to have_current_path(new_user_session_path)
end end
end end
context 'when filtering for existing topic' do
before do
visit(explore_projects_path(topic: 'topic1'))
end
it 'shows correct projects' do
expect(page).to have_content(public_project.title)
expect(page).not_to have_content(internal_project.title)
expect(page).not_to have_content(private_project.title)
expect(page).not_to have_content(archived_project.title)
end
end
context 'when filtering for non-existing topic' do
before do
visit(explore_projects_path(topic: 'topic2'))
end
it 'shows correct empty state message' do
expect(page).to have_content('Explore public groups to find projects to contribute to.')
end
end
end end
context 'when signed in' do context 'when signed in' do
...@@ -88,6 +111,29 @@ RSpec.describe 'User explores projects' do ...@@ -88,6 +111,29 @@ RSpec.describe 'User explores projects' do
include_examples 'empty search results' include_examples 'empty search results'
include_examples 'minimum search length' include_examples 'minimum search length'
end end
context 'when filtering for existing topic' do
before do
visit(explore_projects_path(topic: 'topic1'))
end
it 'shows correct projects' do
expect(page).to have_content(public_project.title)
expect(page).to have_content(internal_project.title)
expect(page).not_to have_content(private_project.title)
expect(page).not_to have_content(archived_project.title)
end
end
context 'when filtering for non-existing topic' do
before do
visit(explore_projects_path(topic: 'topic2'))
end
it 'shows correct empty state message' do
expect(page).to have_content('Explore public groups to find projects to contribute to.')
end
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment