diff options
Diffstat (limited to 'spec/features/boards/new_issue_spec.rb')
-rw-r--r-- | spec/features/boards/new_issue_spec.rb | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/spec/features/boards/new_issue_spec.rb b/spec/features/boards/new_issue_spec.rb index 1fcea45c7ae..682ccca38bd 100644 --- a/spec/features/boards/new_issue_spec.rb +++ b/spec/features/boards/new_issue_spec.rb @@ -5,7 +5,6 @@ require 'spec_helper' RSpec.describe 'Issue Boards new issue', :js, feature_category: :team_planning do let_it_be(:project) { create(:project, :public) } let_it_be(:board) { create(:board, project: project) } - let_it_be(:backlog_list) { create(:backlog_list, board: board) } let_it_be(:label) { create(:label, project: project, name: 'Label 1') } let_it_be(:list) { create(:list, board: board, label: label, position: 0) } let_it_be(:user) { create(:user) } @@ -32,22 +31,17 @@ RSpec.describe 'Issue Boards new issue', :js, feature_category: :team_planning d end it 'displays new issue button' do - dropdown = first("[data-testid='header-list-actions']") - dropdown.click expect(first('.board')).to have_button('Create new issue', count: 1) end it 'does not display new issue button in closed list' do page.within('.board:nth-child(3)') do - expect(page).not_to have_selector("[data-testid='header-list-actions']") expect(page).not_to have_button('Create new issue') end end it 'shows form when clicking button' do page.within(first('.board')) do - dropdown = first("[data-testid='header-list-actions']") - dropdown.click click_button 'Create new issue' expect(page).to have_selector('.board-new-issue-form') @@ -56,8 +50,6 @@ RSpec.describe 'Issue Boards new issue', :js, feature_category: :team_planning d it 'hides form when clicking cancel' do page.within(first('.board')) do - dropdown = first("[data-testid='header-list-actions']") - dropdown.click click_button 'Create new issue' expect(page).to have_selector('.board-new-issue-form') @@ -70,8 +62,6 @@ RSpec.describe 'Issue Boards new issue', :js, feature_category: :team_planning d it 'creates new issue, places it on top of the list, and opens sidebar' do page.within(first('.board')) do - dropdown = first("[data-testid='header-list-actions']") - dropdown.click click_button 'Create new issue' end @@ -100,8 +90,6 @@ RSpec.describe 'Issue Boards new issue', :js, feature_category: :team_planning d it 'successfuly loads labels to be added to newly created issue' do page.within(first('.board')) do - dropdown = first("[data-testid='header-list-actions']") - dropdown.click click_button 'Create new issue' end @@ -132,8 +120,6 @@ RSpec.describe 'Issue Boards new issue', :js, feature_category: :team_planning d wait_for_all_requests page.within('.board:nth-child(2)') do - dropdown = first("[data-testid='header-list-actions']") - dropdown.click click_button('Create new issue') page.within(first('.board-new-issue-form')) do @@ -157,13 +143,11 @@ RSpec.describe 'Issue Boards new issue', :js, feature_category: :team_planning d end it 'does not display new issue button in open list' do - expect(page).not_to have_selector("[data-testid='header-list-actions']") expect(first('.board')).not_to have_button('Create new issue') end it 'does not display new issue button in label list' do page.within('.board:nth-child(2)') do - expect(page).not_to have_selector("[data-testid='header-list-actions']") expect(page).not_to have_button('Create new issue') end end @@ -188,23 +172,18 @@ RSpec.describe 'Issue Boards new issue', :js, feature_category: :team_planning d context 'when backlog does not exist' do it 'does not display new issue button in label list' do page.within('.board.is-draggable') do - expect(page).not_to have_selector("[data-testid='header-list-actions']") expect(page).not_to have_button('Create new issue') end end end context 'when backlog list already exists' do - let_it_be(:backlog_list) { create(:backlog_list, board: group_board) } - it 'does not display new issue button in open list' do - expect(page).not_to have_selector("[data-testid='header-list-actions']") expect(first('.board')).not_to have_button('Create new issue') end it 'does not display new issue button in label list' do page.within('.board.is-draggable') do - expect(page).not_to have_selector("[data-testid='header-list-actions']") expect(page).not_to have_button('Create new issue') end end @@ -222,20 +201,18 @@ RSpec.describe 'Issue Boards new issue', :js, feature_category: :team_planning d end context 'when backlog does not exist' do + before do + group_board.lists.backlog.delete_all + end + it 'display new issue button in label list' do - dropdown = first("[data-testid='header-list-actions']") - dropdown.click expect(board_list_header).to have_button('Create new issue') end end context 'project select dropdown' do - let_it_be(:backlog_list) { create(:backlog_list, board: group_board) } - before do page.within(board_list_header) do - dropdown = first("[data-testid='header-list-actions']") - dropdown.click click_button 'Create new issue' end |