2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'Dropdown label', :js do
|
2017-08-17 22:00:37 +05:30
|
|
|
include FilteredSearchHelpers
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
let(:project) { create(:project) }
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:filtered_search) { find('.filtered-search') }
|
2020-03-13 15:44:24 +05:30
|
|
|
let(:filter_dropdown) { find('#js-dropdown-label .filter-dropdown') }
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
before do
|
2018-11-18 11:00:15 +05:30
|
|
|
project.add_maintainer(user)
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in(user)
|
2017-08-17 22:00:37 +05:30
|
|
|
create(:issue, project: project)
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
visit project_issues_path(project)
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
describe 'behavior' do
|
|
|
|
it 'loads all the labels when opened' do
|
|
|
|
create(:label, project: project, title: 'bug-label')
|
2020-04-08 14:13:33 +05:30
|
|
|
filtered_search.set('label:=')
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
expect_filtered_search_dropdown_results(filter_dropdown, 1)
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|