Commit 1faf67f0 authored by Phil Hughes's avatar Phil Hughes

Added tests for infinite scrolling lists

parent f60a030e
......@@ -93,6 +93,25 @@ describe 'Issue Boards', feature: true, js: true do
expect(page).to have_selector('.board', count: 3)
end
it 'infinite scrolls list' do
50.times do
create(:issue, project: project)
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
context 'backlog' do
it 'shows issues in backlog with no labels' do
page.within(first('.board')) do
......@@ -334,6 +353,31 @@ describe 'Issue Boards', feature: true, js: true do
end
end
it 'infinite scrolls list with label filter' do
50.times do
create(:labeled_issue, project: project, labels: [testing])
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
it 'filters by multiple labels' do
page.within '.issues-filters' do
click_button('Label')
......
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