2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2016-10-06 09:36:44 -04:00
|
|
|
|
2021-03-23 08:09:33 -04:00
|
|
|
RSpec.describe 'Project issue boards sidebar', :js do
|
2017-09-19 09:01:01 -04:00
|
|
|
include BoardHelpers
|
|
|
|
|
2021-03-23 08:09:33 -04:00
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
let_it_be(:project) { create(:project, :public) }
|
|
|
|
let_it_be(:issue) { create(:issue, project: project, relative_position: 1) }
|
|
|
|
let_it_be(:board) { create(:board, project: project) }
|
|
|
|
let_it_be(:list) { create(:list, board: board, position: 0) }
|
|
|
|
let(:card) { find('.board:nth-child(1)').first('.board-card') }
|
2017-02-17 05:33:18 -05:00
|
|
|
|
2017-08-11 06:36:03 -04:00
|
|
|
before do
|
2021-03-26 05:09:24 -04:00
|
|
|
stub_feature_flags(graphql_board_lists: false)
|
|
|
|
|
2018-07-11 10:36:08 -04:00
|
|
|
project.add_maintainer(user)
|
2016-10-06 09:36:44 -04:00
|
|
|
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(user)
|
2016-10-06 09:36:44 -04:00
|
|
|
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_board_path(project, board)
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2016-10-06 09:36:44 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows sidebar when clicking issue' do
|
2017-02-17 05:33:18 -05:00
|
|
|
click_card(card)
|
2016-10-06 09:36:44 -04:00
|
|
|
|
|
|
|
expect(page).to have_selector('.issue-boards-sidebar')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'closes sidebar when clicking issue' do
|
2017-02-17 05:33:18 -05:00
|
|
|
click_card(card)
|
2016-10-06 09:36:44 -04:00
|
|
|
|
|
|
|
expect(page).to have_selector('.issue-boards-sidebar')
|
|
|
|
|
2017-02-17 05:33:18 -05:00
|
|
|
click_card(card)
|
2016-10-06 09:36:44 -04:00
|
|
|
|
|
|
|
expect(page).not_to have_selector('.issue-boards-sidebar')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'closes sidebar when clicking close button' do
|
2017-02-17 05:33:18 -05:00
|
|
|
click_card(card)
|
2016-10-06 09:36:44 -04:00
|
|
|
|
|
|
|
expect(page).to have_selector('.issue-boards-sidebar')
|
|
|
|
|
2017-06-17 02:08:27 -04:00
|
|
|
find('.gutter-toggle').click
|
2016-10-06 09:36:44 -04:00
|
|
|
|
|
|
|
expect(page).not_to have_selector('.issue-boards-sidebar')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows issue details when sidebar is open' do
|
2017-02-17 05:33:18 -05:00
|
|
|
click_card(card)
|
2016-10-06 09:36:44 -04:00
|
|
|
|
|
|
|
page.within('.issue-boards-sidebar') do
|
2021-03-23 08:09:33 -04:00
|
|
|
expect(page).to have_content(issue.title)
|
|
|
|
expect(page).to have_content(issue.to_reference)
|
2016-10-07 04:55:12 -04:00
|
|
|
end
|
|
|
|
end
|
2016-10-06 09:36:44 -04:00
|
|
|
end
|