Commit 3e637812 authored by Robert Speicher's avatar Robert Speicher

Merge branch '6573-extract-ee-spec-features-boards' into 'master'

Resolve "Extract EE specific files/lines for spec/features/boards"

Closes #6573

See merge request gitlab-org/gitlab-ee!10611
parents 76686218 28412653
# frozen_string_literal: true
require 'rails_helper'
describe 'Issue Boards add issue modal', :js do
let(:project) { create(:project, :public) }
let(:board) { create(:board, project: project) }
let(:user) { create(:user) }
let!(:label) { create(:label, project: project) }
let!(:list) { create(:list, board: board, label: label, position: 0) }
let!(:issue) { create(:issue, project: project, title: 'abc', description: 'def') }
before do
project.add_maintainer(user)
sign_in(user)
visit project_board_path(project, board)
wait_for_requests
end
it 'shows weight filter' do
click_button('Add issues')
wait_for_requests
find('.add-issues-search .filtered-search').click
expect(page.find('.filter-dropdown')).to have_content 'weight'
end
end
...@@ -6,6 +6,8 @@ describe 'issue boards', :js do ...@@ -6,6 +6,8 @@ describe 'issue boards', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let!(:board) { create(:board, project: project) } let!(:board) { create(:board, project: project) }
let(:milestone) { create(:milestone, title: "v2.2", project: project) }
let!(:board_with_milestone) { create(:board, project: project, milestone: milestone) }
context 'issue board focus mode' do context 'issue board focus mode' do
before do before do
...@@ -141,6 +143,22 @@ describe 'issue boards', :js do ...@@ -141,6 +143,22 @@ describe 'issue boards', :js do
end end
end end
context 'locked milestone' do
before do
visit project_board_path(project, board_with_milestone)
wait_for_requests
end
it 'should not have remove button' do
expect(page).to have_selector('.js-visual-token .remove-token', count: 0)
end
it 'should not be able to be backspaced' do
find('.input-token .filtered-search').native.send_key(:backspace)
expect(page).to have_selector('.js-visual-token', count: 1)
end
end
def badge(list) def badge(list)
find(".board[data-id='#{list.id}'] .issue-count-badge") find(".board[data-id='#{list.id}'] .issue-count-badge")
end end
......
...@@ -34,14 +34,6 @@ describe 'Issue Boards add issue modal', :js do ...@@ -34,14 +34,6 @@ describe 'Issue Boards add issue modal', :js do
end end
end end
it 'shows weight filter' do
click_button('Add issues')
wait_for_requests
find('.add-issues-search .filtered-search').click
expect(page.find('.filter-dropdown')).to have_content 'weight'
end
context 'modal interaction' do context 'modal interaction' do
it 'opens modal' do it 'opens modal' do
click_button('Add issues') click_button('Add issues')
......
...@@ -6,9 +6,7 @@ describe 'Issue Boards', :js do ...@@ -6,9 +6,7 @@ describe 'Issue Boards', :js do
let(:group) { create(:group, :nested) } let(:group) { create(:group, :nested) }
let(:project) { create(:project, :public, namespace: group) } let(:project) { create(:project, :public, namespace: group) }
let(:milestone) { create(:milestone, title: "v2.2", project: project) } let(:board) { create(:board, project: project) }
let!(:board) { create(:board, project: project) }
let!(:board_with_milestone) { create(:board, project: project, milestone: milestone) }
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:user2) { create(:user) } let!(:user2) { create(:user) }
...@@ -23,7 +21,7 @@ describe 'Issue Boards', :js do ...@@ -23,7 +21,7 @@ describe 'Issue Boards', :js do
context 'no lists' do context 'no lists' do
before do before do
visit project_boards_path(project) visit project_board_path(project, board)
wait_for_requests wait_for_requests
expect(page).to have_selector('.board', count: 3) expect(page).to have_selector('.board', count: 3)
end end
...@@ -89,7 +87,7 @@ describe 'Issue Boards', :js do ...@@ -89,7 +87,7 @@ describe 'Issue Boards', :js do
let!(:issue10) { create(:labeled_issue, project: project, title: 'issue +', description: 'A+ great issue', labels: [a_plus]) } let!(:issue10) { create(:labeled_issue, project: project, title: 'issue +', description: 'A+ great issue', labels: [a_plus]) }
before do before do
visit project_boards_path(project) visit project_board_path(project, board)
wait_for_requests wait_for_requests
...@@ -168,7 +166,7 @@ describe 'Issue Boards', :js do ...@@ -168,7 +166,7 @@ describe 'Issue Boards', :js do
create(:labeled_issue, project: project, labels: [planning]) create(:labeled_issue, project: project, labels: [planning])
end end
visit project_boards_path(project) visit project_board_path(project, board)
wait_for_requests wait_for_requests
page.within(find('.board:nth-child(2)')) do page.within(find('.board:nth-child(2)')) do
...@@ -528,25 +526,9 @@ describe 'Issue Boards', :js do ...@@ -528,25 +526,9 @@ describe 'Issue Boards', :js do
end end
end end
context 'locked milestone' do
before do
visit project_board_path(project, board_with_milestone)
wait_for_requests
end
it 'should not have remove button' do
expect(page).to have_selector('.js-visual-token .remove-token', count: 0)
end
it 'should not be able to be backspaced' do
find('.input-token .filtered-search').native.send_key(:backspace)
expect(page).to have_selector('.js-visual-token', count: 1)
end
end
context 'keyboard shortcuts' do context 'keyboard shortcuts' do
before do before do
visit project_boards_path(project) visit project_board_path(project, board)
wait_for_requests wait_for_requests
end end
......
...@@ -2,6 +2,7 @@ require 'rails_helper' ...@@ -2,6 +2,7 @@ require 'rails_helper'
describe 'Issue Boards', :js do describe 'Issue Boards', :js do
include BoardHelpers include BoardHelpers
include FilteredSearchHelpers
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
...@@ -22,7 +23,6 @@ describe 'Issue Boards', :js do ...@@ -22,7 +23,6 @@ describe 'Issue Boards', :js do
end end
before do before do
stub_licensed_features(multiple_issue_assignees: false)
project.add_maintainer(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
...@@ -130,6 +130,7 @@ describe 'Issue Boards', :js do ...@@ -130,6 +130,7 @@ describe 'Issue Boards', :js do
click_link 'Unassigned' click_link 'Unassigned'
end end
close_dropdown_menu_if_visible
wait_for_requests wait_for_requests
expect(page).to have_content('No assignee') expect(page).to have_content('No assignee')
......
...@@ -149,4 +149,10 @@ module FilteredSearchHelpers ...@@ -149,4 +149,10 @@ module FilteredSearchHelpers
loop until find('.filtered-search').value.strip == text loop until find('.filtered-search').value.strip == text
end end
end end
def close_dropdown_menu_if_visible
find('.dropdown-menu-toggle', visible: :all).tap do |toggle|
toggle.click if toggle.visible?
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