gitlab-org--gitlab-foss/spec/features/boards/sidebar_spec.rb

61 lines
1.5 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'spec_helper'
2016-10-06 09:36:44 -04:00
RSpec.describe 'Project issue boards sidebar', :js do
2017-09-19 09:01:01 -04:00
include BoardHelpers
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') }
before do
stub_feature_flags(graphql_board_lists: false)
project.add_maintainer(user)
2016-10-06 09:36:44 -04:00
sign_in(user)
2016-10-06 09:36:44 -04:00
visit project_board_path(project, board)
wait_for_requests
2016-10-06 09:36:44 -04:00
end
it 'shows sidebar when clicking issue' do
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
click_card(card)
2016-10-06 09:36:44 -04:00
expect(page).to have_selector('.issue-boards-sidebar')
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
click_card(card)
2016-10-06 09:36:44 -04:00
expect(page).to have_selector('.issue-boards-sidebar')
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
click_card(card)
2016-10-06 09:36:44 -04:00
page.within('.issue-boards-sidebar') do
expect(page).to have_content(issue.title)
expect(page).to have_content(issue.to_reference)
end
end
2016-10-06 09:36:44 -04:00
end