Commit d70f7f5d authored by Phil Hughes's avatar Phil Hughes

Merge branch 'fix-filtered-search-issuable-empty-state-exception' into 'master'

Fix filtered search issuable empty state exception

Closes #31455

See merge request !11347
parents 0fccbdbc 56797a84
......@@ -123,7 +123,7 @@ import ShortcutsBlob from './shortcuts_blob';
break;
case 'projects:merge_requests:index':
case 'projects:issues:index':
if (gl.FilteredSearchManager) {
if (gl.FilteredSearchManager && document.querySelector('.filtered-search')) {
new gl.FilteredSearchManager(page === 'projects:issues:index' ? 'issues' : 'merge_requests');
}
Issuable.init();
......
require 'spec_helper'
describe 'Subgroup Issuables', :feature, :js do
let!(:group) { create(:group, name: 'group') }
let!(:subgroup) { create(:group, parent: group, name: 'subgroup') }
let!(:project) { create(:empty_project, namespace: subgroup, name: 'project') }
let(:user) { create(:user) }
before do
project.add_master(user)
login_as user
end
it 'shows the full subgroup title when issues index page is empty' do
visit namespace_project_issues_path(project.namespace.to_param, project.to_param)
expect_to_have_full_subgroup_title
end
it 'shows the full subgroup title when merge requests index page is empty' do
visit namespace_project_merge_requests_path(project.namespace.to_param, project.to_param)
expect_to_have_full_subgroup_title
end
def expect_to_have_full_subgroup_title
title = find('.title-container')
expect(title).not_to have_selector '.initializing'
expect(title).to have_content 'group / subgroup / project'
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