Commit 78e3ff13 authored by Phil Hughes's avatar Phil Hughes

Fixed up specs

parent 3c4ff902
...@@ -25,13 +25,13 @@ describe 'Issue Boards add issue modal', :feature, :js do ...@@ -25,13 +25,13 @@ describe 'Issue Boards add issue modal', :feature, :js do
context 'modal interaction' do context 'modal interaction' do
it 'opens modal' do it 'opens modal' do
click_button('Add issues') click_add_issues
expect(page).to have_selector('.add-issues-modal') expect(page).to have_selector('.add-issues-modal')
end end
it 'closes modal' do it 'closes modal' do
click_button('Add issues') click_add_issues
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
find('.close').click find('.close').click
...@@ -41,7 +41,7 @@ describe 'Issue Boards add issue modal', :feature, :js do ...@@ -41,7 +41,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
end end
it 'closes modal if cancel button clicked' do it 'closes modal if cancel button clicked' do
click_button('Add issues') click_add_issues
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
click_button 'Cancel' click_button 'Cancel'
...@@ -53,7 +53,7 @@ describe 'Issue Boards add issue modal', :feature, :js do ...@@ -53,7 +53,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
context 'issues list' do context 'issues list' do
before do before do
click_button('Add issues') click_add_issues
wait_for_vue_resource wait_for_vue_resource
end end
...@@ -86,7 +86,7 @@ describe 'Issue Boards add issue modal', :feature, :js do ...@@ -86,7 +86,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
first('.board-delete').click first('.board-delete').click
click_button('Add issues') click_add_issues
wait_for_vue_resource wait_for_vue_resource
...@@ -230,4 +230,10 @@ describe 'Issue Boards add issue modal', :feature, :js do ...@@ -230,4 +230,10 @@ describe 'Issue Boards add issue modal', :feature, :js do
end end
end end
end end
def click_add_issues
page.within('.issue-boards-search') do
click_button('Add issues')
end
end
end end
...@@ -6,6 +6,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -6,6 +6,7 @@ describe 'Issue Boards', :feature, :js do
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
let(:board) { create(:board, project: project) } let(:board) { create(:board, project: project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:issue) { create(:issue, project: project) }
let!(:planning) { create(:label, project: project, name: 'Planning') } let!(:planning) { create(:label, project: project, name: 'Planning') }
let!(:list1) { create(:list, board: board, label: planning, position: 0) } let!(:list1) { create(:list, board: board, label: planning, position: 0) }
...@@ -30,17 +31,15 @@ describe 'Issue Boards', :feature, :js do ...@@ -30,17 +31,15 @@ describe 'Issue Boards', :feature, :js do
expect(page).not_to have_selector('.boards-backlog-help') expect(page).not_to have_selector('.boards-backlog-help')
end end
it 'closes backlog help box when clicking add issues button inside box' do it 'closes backlog help box after adding issues' do
page.within '.boards-backlog-help' do page.within '.boards-backlog-help' do
click_button 'Add issues' click_button 'Add issues'
end end
expect(page).not_to have_selector('.boards-backlog-help') page.within('.add-issues-modal') do
end find('.card').click
it 'closes backlog help box when clicking add issues button' do click_button 'Add 1 issue'
page.within '.issue-boards-search' do
click_button 'Add issues'
end end
expect(page).not_to have_selector('.boards-backlog-help') expect(page).not_to have_selector('.boards-backlog-help')
......
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