2016-08-03 07:42:26 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe 'Issue Boards', feature: true, js: true do
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
let(:user) { create(:user) }
|
2016-08-10 08:10:50 +00:00
|
|
|
let!(:user2) { create(:user) }
|
2016-08-09 15:53:56 +00:00
|
|
|
let!(:board) { Boards::CreateService.new(project, user).execute }
|
2016-08-03 07:42:26 +00:00
|
|
|
|
|
|
|
before do
|
|
|
|
project.team << [user, :master]
|
2016-08-10 08:10:50 +00:00
|
|
|
project.team << [user2, :master]
|
2016-08-03 07:42:26 +00:00
|
|
|
login_as(user)
|
|
|
|
end
|
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
context 'no lists' do
|
|
|
|
before do
|
|
|
|
visit namespace_project_board_path(project.namespace, project)
|
|
|
|
end
|
2016-08-03 07:42:26 +00:00
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
it 'shows blank state' do
|
|
|
|
expect(page).to have_selector('.board', count: 3)
|
|
|
|
expect(page).to have_content('Welcome to your Issue Board!')
|
2016-08-03 07:42:26 +00:00
|
|
|
end
|
|
|
|
|
2016-08-10 16:32:10 +00:00
|
|
|
it 'hides the blank state when clicking nevermind button' do
|
2016-08-09 15:53:56 +00:00
|
|
|
page.within('.board-blank-state') do
|
|
|
|
click_button('Nevermind, I\'ll use my own')
|
|
|
|
end
|
|
|
|
expect(page).to have_selector('.board', count: 2)
|
2016-08-03 07:42:26 +00:00
|
|
|
end
|
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
it 'creates default lists' do
|
|
|
|
lists = ['Backlog', 'Development', 'Testing', 'Production', 'Ready', 'Done']
|
2016-08-03 07:42:26 +00:00
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
page.within('.board-blank-state') do
|
|
|
|
click_button('Add default lists')
|
|
|
|
end
|
|
|
|
expect(page).to have_selector('.board', count: 6)
|
|
|
|
|
|
|
|
page.all('.board').each_with_index do |list, i|
|
|
|
|
expect(list.find('.board-title')).to have_content(lists[i])
|
|
|
|
end
|
|
|
|
end
|
2016-08-03 07:42:26 +00:00
|
|
|
end
|
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
context 'with lists' do
|
2016-08-11 13:41:44 +00:00
|
|
|
let!(:milestone_upcoming) { create(:milestone, project: project, due_date: Date.tomorrow) }
|
|
|
|
let(:milestone) { create(:milestone, project: project) }
|
2016-08-10 08:10:50 +00:00
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
let(:planning) { create(:label, project: project, name: 'Planning') }
|
|
|
|
let(:development) { create(:label, project: project, name: 'Development') }
|
|
|
|
let(:testing) { create(:label, project: project, name: 'Testing') }
|
2016-08-10 08:10:50 +00:00
|
|
|
let(:bug) { create(:label, project: project, name: 'Bug') }
|
2016-08-09 15:53:56 +00:00
|
|
|
|
|
|
|
let!(:list1) { create(:list, board: project.board, label: planning, position: 0) }
|
|
|
|
let!(:list2) { create(:list, board: project.board, label: development, position: 1) }
|
|
|
|
|
2016-08-11 13:41:44 +00:00
|
|
|
let!(:confidential_issue) { create(:issue, :confidential, project: project, author: user, milestone: milestone_upcoming) }
|
|
|
|
let!(:issue1) { create(:issue, project: project, assignee: user, milestone: milestone_upcoming) }
|
|
|
|
let!(:issue2) { create(:issue, project: project, author: user2, milestone: milestone_upcoming) }
|
|
|
|
let!(:issue3) { create(:issue, project: project, milestone: milestone_upcoming) }
|
|
|
|
let!(:issue4) { create(:issue, project: project, milestone: milestone_upcoming) }
|
2016-08-10 08:10:50 +00:00
|
|
|
let!(:issue5) { create(:labeled_issue, project: project, labels: [planning], milestone: milestone) }
|
2016-08-11 13:41:44 +00:00
|
|
|
let!(:issue6) { create(:labeled_issue, project: project, labels: [planning, development], milestone: milestone_upcoming) }
|
|
|
|
let!(:issue7) { create(:labeled_issue, project: project, labels: [development], milestone: milestone_upcoming) }
|
|
|
|
let!(:issue8) { create(:closed_issue, project: project, milestone: milestone_upcoming) }
|
|
|
|
let!(:issue9) { create(:labeled_issue, project: project, labels: [testing, bug], milestone: milestone_upcoming) }
|
2016-08-09 15:53:56 +00:00
|
|
|
|
|
|
|
before do
|
|
|
|
visit namespace_project_board_path(project.namespace, project)
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows lists' do
|
|
|
|
expect(page).to have_selector('.board', count: 4)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows issues in lists' do
|
|
|
|
page.within(all('.board')[1]) do
|
2016-08-11 13:41:44 +00:00
|
|
|
expect(page.find('.board-header')).to have_content('1')
|
|
|
|
expect(page).to have_selector('.card', count: 1)
|
2016-08-09 15:53:56 +00:00
|
|
|
end
|
2016-08-03 07:42:26 +00:00
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
page.within(all('.board')[2]) do
|
|
|
|
expect(page.find('.board-header')).to have_content('2')
|
|
|
|
expect(page).to have_selector('.card', count: 2)
|
|
|
|
end
|
|
|
|
end
|
2016-08-03 07:42:26 +00:00
|
|
|
|
2016-08-10 16:19:56 +00:00
|
|
|
it 'shows confidential issues with icon' do
|
|
|
|
page.within(first('.board')) do
|
|
|
|
expect(page).to have_selector('.confidential-icon', count: 1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
it 'allows user to delete board' do
|
|
|
|
page.within(all('.board')[1]) do
|
|
|
|
find('.board-delete').click
|
2016-08-03 07:42:26 +00:00
|
|
|
end
|
2016-08-09 15:53:56 +00:00
|
|
|
expect(page).to have_selector('.board', count: 3)
|
2016-08-03 07:42:26 +00:00
|
|
|
end
|
|
|
|
|
2016-08-10 14:13:42 +00:00
|
|
|
it 'infinite scrolls list' do
|
|
|
|
50.times do
|
2016-08-11 13:41:44 +00:00
|
|
|
create(:issue, project: project, milestone: milestone_upcoming)
|
2016-08-10 14:13:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
visit namespace_project_board_path(project.namespace, project)
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
page.within(first('.board')) do
|
|
|
|
expect(page.find('.board-header')).to have_content('20')
|
|
|
|
expect(page).to have_selector('.card', count: 20)
|
|
|
|
|
|
|
|
evaluate_script("document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight")
|
|
|
|
|
|
|
|
expect(page.find('.board-header')).to have_content('40')
|
|
|
|
expect(page).to have_selector('.card', count: 40)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
context 'backlog' do
|
|
|
|
it 'shows issues in backlog with no labels' do
|
|
|
|
page.within(first('.board')) do
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(page.find('.board-header')).to have_content('6')
|
|
|
|
expect(page).to have_selector('.card', count: 6)
|
2016-08-09 15:53:56 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'is searchable' do
|
|
|
|
page.within(first('.board')) do
|
|
|
|
find('.form-control').set issue1.title
|
|
|
|
|
|
|
|
expect(page).to have_selector('.card', count: 1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'clears search' do
|
|
|
|
page.within(first('.board')) do
|
|
|
|
find('.form-control').set issue1.title
|
|
|
|
|
|
|
|
expect(page).to have_selector('.card', count: 1)
|
|
|
|
|
|
|
|
find('.board-search-clear-btn').click
|
|
|
|
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(page).to have_selector('.card', count: 6)
|
2016-08-09 15:53:56 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'moves issue from backlog into list' do
|
|
|
|
drag_to(list_to_index: 1)
|
2016-08-03 07:42:26 +00:00
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
page.within(first('.board')) do
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(page.find('.board-header')).to have_content('5')
|
|
|
|
expect(page).to have_selector('.card', count: 5)
|
2016-08-09 15:53:56 +00:00
|
|
|
end
|
2016-08-03 07:42:26 +00:00
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
page.within(all('.board')[1]) do
|
2016-08-11 13:41:44 +00:00
|
|
|
expect(page.find('.board-header')).to have_content('2')
|
|
|
|
expect(page).to have_selector('.card', count: 2)
|
2016-08-09 15:53:56 +00:00
|
|
|
end
|
2016-08-03 07:42:26 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
context 'done' do
|
|
|
|
it 'shows list of done issues' do
|
|
|
|
expect(all('.board').last).to have_selector('.card', count: 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'moves issue to done' do
|
|
|
|
drag_to(list_from_index: 0, list_to_index: 3)
|
|
|
|
|
|
|
|
expect(all('.board').last).to have_selector('.card', count: 2)
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(all('.board').last).to have_content(issue9.title)
|
2016-08-09 15:53:56 +00:00
|
|
|
expect(all('.board').last).not_to have_content(planning.title)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'removes all of the same issue to done' do
|
|
|
|
drag_to(list_from_index: 1, list_to_index: 3)
|
|
|
|
|
2016-08-11 13:41:44 +00:00
|
|
|
expect(all('.board')[1]).to have_selector('.card', count: 0)
|
2016-08-09 15:53:56 +00:00
|
|
|
expect(all('.board')[2]).to have_selector('.card', count: 1)
|
|
|
|
expect(all('.board').last).to have_content(issue6.title)
|
|
|
|
expect(all('.board').last).not_to have_content(planning.title)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'lists' do
|
2016-08-10 08:10:50 +00:00
|
|
|
it 'changes position of list' do
|
|
|
|
drag_to(list_from_index: 1, list_to_index: 2, selector: '.js-board-handle')
|
|
|
|
|
|
|
|
expect(all('.board')[1]).to have_content(development.title)
|
|
|
|
expect(all('.board')[1]).to have_content(planning.title)
|
|
|
|
end
|
|
|
|
|
2016-08-09 15:53:56 +00:00
|
|
|
it 'moves between lists' do
|
2016-08-11 13:41:44 +00:00
|
|
|
drag_to(list_from_index: 1, list_to_index: 2)
|
2016-08-09 15:53:56 +00:00
|
|
|
|
2016-08-11 13:41:44 +00:00
|
|
|
expect(all('.board')[1]).to have_selector('.card', count: 0)
|
|
|
|
expect(all('.board')[2]).to have_selector('.card', count: 2)
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(all('.board')[2]).to have_content(issue6.title)
|
|
|
|
expect(all('.board')[2].all('.card').last).not_to have_content(development.title)
|
2016-08-09 15:53:56 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'moves between lists' do
|
|
|
|
drag_to(list_from_index: 2, list_to_index: 1)
|
|
|
|
|
2016-08-11 13:41:44 +00:00
|
|
|
expect(all('.board')[1]).to have_selector('.card', count: 2)
|
2016-08-09 15:53:56 +00:00
|
|
|
expect(all('.board')[2]).to have_selector('.card', count: 1)
|
|
|
|
expect(all('.board')[1]).to have_content(issue7.title)
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(all('.board')[1].all('.card').first).not_to have_content(planning.title)
|
2016-08-09 15:53:56 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'moves from done' do
|
|
|
|
drag_to(list_from_index: 3, list_to_index: 1)
|
|
|
|
|
2016-08-11 13:41:44 +00:00
|
|
|
expect(all('.board')[1]).to have_selector('.card', count: 2)
|
2016-08-09 15:53:56 +00:00
|
|
|
expect(all('.board')[1]).to have_content(issue8.title)
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'issue card' do
|
|
|
|
it 'shows assignee' do
|
|
|
|
page.within(first('.board')) do
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(page).to have_selector('.avatar', count: 1)
|
2016-08-09 15:53:56 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'new list' do
|
|
|
|
it 'shows all labels in new list dropdown' do
|
|
|
|
click_button 'Create new list'
|
|
|
|
|
|
|
|
page.within('.dropdown-menu-issues-board-new') do
|
|
|
|
expect(page).to have_content(planning.title)
|
|
|
|
expect(page).to have_content(development.title)
|
|
|
|
expect(page).to have_content(testing.title)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'creates new list for label' do
|
|
|
|
click_button 'Create new list'
|
|
|
|
|
|
|
|
page.within('.dropdown-menu-issues-board-new') do
|
|
|
|
click_link testing.title
|
|
|
|
end
|
|
|
|
|
|
|
|
expect(page).to have_selector('.board', count: 5)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'moves issues from backlog into new list' do
|
|
|
|
page.within(first('.board')) do
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(page.find('.board-header')).to have_content('6')
|
|
|
|
expect(page).to have_selector('.card', count: 6)
|
2016-08-09 15:53:56 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
click_button 'Create new list'
|
|
|
|
|
|
|
|
page.within('.dropdown-menu-issues-board-new') do
|
|
|
|
click_link testing.title
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(first('.board')) do
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(page.find('.board-header')).to have_content('5')
|
|
|
|
expect(page).to have_selector('.card', count: 5)
|
2016-08-09 15:53:56 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'filtering' do
|
2016-08-10 08:10:50 +00:00
|
|
|
it 'filters by author' do
|
|
|
|
page.within '.issues-filters' do
|
|
|
|
click_button('Author')
|
|
|
|
|
|
|
|
page.within '.dropdown-menu-author' do
|
|
|
|
click_link(user2.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
expect(find('.js-author-search')).to have_content(user2.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(first('.board')) do
|
|
|
|
expect(page.find('.board-header')).to have_content('1')
|
|
|
|
expect(page).to have_selector('.card', count: 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(all('.board')[1]) do
|
|
|
|
expect(page.find('.board-header')).to have_content('0')
|
|
|
|
expect(page).to have_selector('.card', count: 0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'filters by assignee' do
|
|
|
|
page.within '.issues-filters' do
|
|
|
|
click_button('Assignee')
|
|
|
|
|
|
|
|
page.within '.dropdown-menu-assignee' do
|
|
|
|
click_link(user.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
expect(find('.js-assignee-search')).to have_content(user.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(first('.board')) do
|
|
|
|
expect(page.find('.board-header')).to have_content('1')
|
|
|
|
expect(page).to have_selector('.card', count: 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(all('.board')[1]) do
|
|
|
|
expect(page.find('.board-header')).to have_content('0')
|
|
|
|
expect(page).to have_selector('.card', count: 0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'filters by milestone' do
|
|
|
|
page.within '.issues-filters' do
|
2016-08-11 13:41:44 +00:00
|
|
|
click_button('Upcoming')
|
2016-08-10 08:10:50 +00:00
|
|
|
|
|
|
|
page.within '.milestone-filter' do
|
|
|
|
click_link(milestone.title)
|
|
|
|
end
|
|
|
|
|
|
|
|
expect(find('.js-milestone-select')).to have_content(milestone.title)
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(first('.board')) do
|
|
|
|
expect(page.find('.board-header')).to have_content('0')
|
|
|
|
expect(page).to have_selector('.card', count: 0)
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(all('.board')[1]) do
|
|
|
|
expect(page.find('.board-header')).to have_content('1')
|
|
|
|
expect(page).to have_selector('.card', count: 1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'filters by label' do
|
|
|
|
page.within '.issues-filters' do
|
|
|
|
click_button('Label')
|
|
|
|
|
|
|
|
page.within '.dropdown-menu-labels' do
|
|
|
|
click_link(testing.title)
|
|
|
|
find('.dropdown-menu-close').click
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(first('.board')) do
|
|
|
|
expect(page.find('.board-header')).to have_content('1')
|
|
|
|
expect(page).to have_selector('.card', count: 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(all('.board')[1]) do
|
|
|
|
expect(page.find('.board-header')).to have_content('0')
|
|
|
|
expect(page).to have_selector('.card', count: 0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-08-10 14:13:42 +00:00
|
|
|
it 'infinite scrolls list with label filter' do
|
|
|
|
50.times do
|
2016-08-11 13:41:44 +00:00
|
|
|
create(:labeled_issue, project: project, labels: [testing], milestone: milestone_upcoming)
|
2016-08-10 14:13:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
page.within '.issues-filters' do
|
|
|
|
click_button('Label')
|
|
|
|
|
|
|
|
page.within '.dropdown-menu-labels' do
|
|
|
|
click_link(testing.title)
|
|
|
|
find('.dropdown-menu-close').click
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(first('.board')) do
|
|
|
|
expect(page.find('.board-header')).to have_content('20')
|
|
|
|
expect(page).to have_selector('.card', count: 20)
|
|
|
|
|
|
|
|
evaluate_script("document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight")
|
|
|
|
|
|
|
|
expect(page.find('.board-header')).to have_content('40')
|
|
|
|
expect(page).to have_selector('.card', count: 40)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-08-10 08:10:50 +00:00
|
|
|
it 'filters by multiple labels' do
|
|
|
|
page.within '.issues-filters' do
|
|
|
|
click_button('Label')
|
|
|
|
|
|
|
|
page.within '.dropdown-menu-labels' do
|
|
|
|
click_link(testing.title)
|
|
|
|
click_link(bug.title)
|
|
|
|
find('.dropdown-menu-close').click
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(first('.board')) do
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(page.find('.board-header')).to have_content('1')
|
|
|
|
expect(page).to have_selector('.card', count: 1)
|
2016-08-10 08:10:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
page.within(all('.board')[1]) do
|
|
|
|
expect(page.find('.board-header')).to have_content('0')
|
|
|
|
expect(page).to have_selector('.card', count: 0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'filters by no label' do
|
|
|
|
page.within '.issues-filters' do
|
|
|
|
click_button('Label')
|
2016-08-09 15:53:56 +00:00
|
|
|
|
2016-08-10 08:10:50 +00:00
|
|
|
page.within '.dropdown-menu-labels' do
|
|
|
|
click_link("No Label")
|
|
|
|
find('.dropdown-menu-close').click
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(first('.board')) do
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(page.find('.board-header')).to have_content('5')
|
|
|
|
expect(page).to have_selector('.card', count: 5)
|
2016-08-10 08:10:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
page.within(all('.board')[1]) do
|
|
|
|
expect(page.find('.board-header')).to have_content('0')
|
|
|
|
expect(page).to have_selector('.card', count: 0)
|
|
|
|
end
|
|
|
|
end
|
2016-08-10 13:35:14 +00:00
|
|
|
|
|
|
|
it 'filters by clicking label button on issue' do
|
|
|
|
page.within '.issues-filters' do
|
|
|
|
click_button('Label')
|
|
|
|
|
|
|
|
page.within '.dropdown-menu-labels' do
|
|
|
|
click_link(bug.title)
|
|
|
|
find('.dropdown-menu-close').click
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(first('.board')) do
|
|
|
|
expect(page.find('.board-header')).to have_content('1')
|
|
|
|
expect(page).to have_selector('.card', count: 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(all('.board')[1]) do
|
|
|
|
expect(page.find('.board-header')).to have_content('0')
|
|
|
|
expect(page).to have_selector('.card', count: 0)
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within(first('.board')) do
|
2016-08-10 16:19:56 +00:00
|
|
|
click_button(bug.title)
|
2016-08-10 13:35:14 +00:00
|
|
|
|
2016-08-10 16:19:56 +00:00
|
|
|
expect(page).to have_selector('.card', count: 6)
|
2016-08-10 13:35:14 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
page.within('.labels-filter') do
|
|
|
|
expect(find('.dropdown-toggle-text')).not_to have_content(bug.title)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'removes label filter by clicking label button on issue' do
|
|
|
|
page.within(first('.board')) do
|
|
|
|
page.within(first('.card')) do
|
|
|
|
click_button(bug.title)
|
|
|
|
end
|
|
|
|
|
|
|
|
expect(page).to have_selector('.card', count: 1)
|
|
|
|
end
|
|
|
|
|
|
|
|
page.within('.labels-filter') do
|
|
|
|
expect(find('.dropdown-toggle-text')).to have_content(bug.title)
|
|
|
|
end
|
|
|
|
end
|
2016-08-03 07:42:26 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-08-10 08:10:50 +00:00
|
|
|
def drag_to(list_from_index: 0, card_index: 0, to_index: 0, list_to_index: 0, selector: '.board-list')
|
|
|
|
evaluate_script("simulateDrag({scrollable: document.getElementById('board-app'), from: {el: $('#{selector}').eq(#{list_from_index}).get(0), index: #{card_index}}, to: {el: $('.board-list').eq(#{list_to_index}).get(0), index: #{to_index}}});")
|
2016-08-03 07:42:26 +00:00
|
|
|
sleep 1
|
|
|
|
end
|
|
|
|
end
|