Commit 1ba2609d authored by Douwe Maan's avatar Douwe Maan

Merge branch 'ee-fix-form_spec-failure-wait_for_ajax-unneeded-command' into 'master'

Fix form_spec.rb failure relating to wait_for_ajax and unneeded commands

See merge request !1888
parents c4a17519 92761de3
require 'rails_helper'
describe 'New/edit issue', feature: true, js: true do
describe 'New/edit issue', :feature, :js do
include GitlabRoutingHelper
include ActionView::Helpers::JavaScriptHelper
include WaitForAjax
let!(:project) { create(:project) }
let!(:user) { create(:user)}
......@@ -26,6 +27,8 @@ describe 'New/edit issue', feature: true, js: true do
describe 'multiple assignees' do
before do
click_button 'Unassigned'
wait_for_ajax
end
it 'unselects other assignees when unassigned is selected' do
......@@ -65,6 +68,9 @@ describe 'New/edit issue', feature: true, js: true do
expect(find('a', text: 'Assign to me')).to be_visible
click_button 'Unassigned'
wait_for_ajax
page.within '.dropdown-menu-user' do
click_link user2.name
end
......@@ -161,13 +167,15 @@ describe 'New/edit issue', feature: true, js: true do
it 'correctly updates the selected user when changing assignee' do
click_button 'Unassigned'
wait_for_ajax
page.within '.dropdown-menu-user' do
click_link user.name
end
expect(find('input[name="issue[assignee_ids][]"]', visible: false).value).to match(user.id.to_s)
expect(find('.dropdown-menu-user a.is-active').first(:xpath, '..')['data-user-id']).to eq(user.id.to_s)
# check the ::before pseudo element to ensure checkmark icon is present
expect(before_for_selector('.dropdown-menu-selectable a.is-active')).not_to eq('')
expect(before_for_selector('.dropdown-menu-selectable a:not(.is-active)')).to eq('')
......
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