Commit e3ad1bb4 authored by Stan Hu's avatar Stan Hu

Merge branch 'attempt-to-fix-board_with_milestone_spec-1' into 'master'

Improve board_with_milestone_spec

Closes #1960

See merge request !1840
parents 43141f7d 9e25ba01
...@@ -26,6 +26,9 @@ describe 'Board with milestone', :feature, :js do ...@@ -26,6 +26,9 @@ describe 'Board with milestone', :feature, :js do
expect(find('.tokens-container')).to have_content(milestone.title) expect(find('.tokens-container')).to have_content(milestone.title)
wait_for_vue_resource wait_for_vue_resource
find('.card', match: :first)
expect(all('.board')[1]).to have_selector('.card', count: 1) expect(all('.board')[1]).to have_selector('.card', count: 1)
end end
end end
...@@ -48,6 +51,9 @@ describe 'Board with milestone', :feature, :js do ...@@ -48,6 +51,9 @@ describe 'Board with milestone', :feature, :js do
end end
expect(find('.tokens-container')).to have_content(milestone.title) expect(find('.tokens-container')).to have_content(milestone.title)
find('.card', match: :first)
expect(all('.board')[1]).to have_selector('.card', count: 1) expect(all('.board')[1]).to have_selector('.card', count: 1)
end end
...@@ -56,6 +62,9 @@ describe 'Board with milestone', :feature, :js do ...@@ -56,6 +62,9 @@ describe 'Board with milestone', :feature, :js do
expect(page).not_to have_css('.js-visual-token') expect(page).not_to have_css('.js-visual-token')
expect(find('.tokens-container')).not_to have_content(milestone.title) expect(find('.tokens-container')).not_to have_content(milestone.title)
find('.card', match: :first)
expect(page).to have_selector('.board', count: 2) expect(page).to have_selector('.board', count: 2)
expect(all('.board')[1]).to have_selector('.card', count: 2) expect(all('.board')[1]).to have_selector('.card', count: 2)
end end
...@@ -64,6 +73,9 @@ describe 'Board with milestone', :feature, :js do ...@@ -64,6 +73,9 @@ describe 'Board with milestone', :feature, :js do
update_board_milestone('Upcoming') update_board_milestone('Upcoming')
expect(find('.tokens-container')).not_to have_content(milestone.title) expect(find('.tokens-container')).not_to have_content(milestone.title)
find('.board', match: :first)
expect(all('.board')[1]).to have_selector('.card', count: 0) expect(all('.board')[1]).to have_selector('.card', count: 0)
end end
...@@ -145,9 +157,10 @@ describe 'Board with milestone', :feature, :js do ...@@ -145,9 +157,10 @@ describe 'Board with milestone', :feature, :js do
click_button 'Add issues' click_button 'Add issues'
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
card = find('.card', :first)
expect(page).to have_selector('.card', count: 1) expect(page).to have_selector('.card', count: 1)
first('.card').click card.click
click_button 'Add 1 issue' click_button 'Add 1 issue'
end end
......
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