blob: ad62c8eb3da52af2e9b0c0d254a1a0dead079b46 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'User searches for milestones', :js, :clean_gitlab_redis_rate_limiting,
feature_category: :global_search do
let_it_be(:user) { create(:user, :no_super_sidebar) }
let_it_be(:project) { create(:project, namespace: user.namespace) }
let_it_be(:milestone1) { create(:milestone, title: 'Foo', project: project) }
let_it_be(:milestone2) { create(:milestone, title: 'Bar', project: project) }
before do
project.add_maintainer(user)
sign_in(user)
visit(search_path)
end
include_examples 'top right search form'
include_examples 'search timeouts', 'milestones'
it 'finds a milestone' do
fill_in('dashboard_search', with: milestone1.title)
find('.gl-search-box-by-click-search-button').click
select_search_scope('Milestones')
page.within('.results') do
expect(page).to have_link(milestone1.title)
expect(page).not_to have_link(milestone2.title)
end
end
context 'when on a project page' do
it 'finds a milestone' do
find('[data-testid="project-filter"]').click
wait_for_requests
page.within('[data-testid="project-filter"]') do
click_on(project.name)
end
fill_in('dashboard_search', with: milestone1.title)
find('.gl-search-box-by-click-search-button').click
select_search_scope('Milestones')
page.within('.results') do
expect(page).to have_link(milestone1.title)
expect(page).not_to have_link(milestone2.title)
end
end
end
end
|