Welcome to mirror list, hosted at ThFree Co, Russian Federation.

global_search_spec.rb « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f94f0288f9985344c3230783bc020db6c23bd9df (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'Global search', :js, feature_category: :global_search do
  include AfterNextHelpers

  let_it_be(:user) { create(:user) }
  let_it_be(:project) { create(:project, namespace: user.namespace) }

  before do
    project.add_maintainer(user)
    sign_in(user)
  end

  describe 'when header search' do
    before do
      visit dashboard_projects_path
    end

    it 'renders updated search bar' do
      expect(page).to have_no_selector('.search-form')
      expect(page).to have_selector('#js-header-search')
    end

    it 'focuses search input when shortcut "s" is pressed' do
      expect(page).not_to have_selector('#search:focus')

      find('body').native.send_key('s')

      expect(page).to have_selector('#search:focus')
    end
  end
end