diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/disable_css_animation.js | 15 | ||||
-rw-r--r-- | spec/disable_css_animation_helper.rb | 9 | ||||
-rw-r--r-- | spec/features/issues/form_spec.rb | 39 |
3 files changed, 26 insertions, 37 deletions
diff --git a/spec/disable_css_animation.js b/spec/disable_css_animation.js new file mode 100644 index 00000000000..b26676d2e98 --- /dev/null +++ b/spec/disable_css_animation.js @@ -0,0 +1,15 @@ +/* eslint-disable */ +// Disable eslint because capybara does not know es6 + +var disableAnimationStyles = '-webkit-transition: none !important;' + + '-moz-transition: none !important;' + + '-ms-transition: none !important;' + + '-o-transition: none !important;' + + 'transition: none !important;' + +window.onload = function() { + var animationStyles = document.createElement('style'); + animationStyles.type = 'text/css'; + animationStyles.innerHTML = '* {' + disableAnimationStyles + '}'; + document.head.appendChild(animationStyles); +}; diff --git a/spec/disable_css_animation_helper.rb b/spec/disable_css_animation_helper.rb new file mode 100644 index 00000000000..1cc69ff55c8 --- /dev/null +++ b/spec/disable_css_animation_helper.rb @@ -0,0 +1,9 @@ +Capybara.register_driver :poltergeist do |app| + opts = { + extensions: ["#{Rails.root}/spec/disable_css_animation.js"] # or wherever + } + + Capybara::Poltergeist::Driver.new(app, opts) +end + +Capybara.javascript_driver = :poltergeist diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 7d13690f284..a12a946b1bb 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -1,4 +1,5 @@ require 'rails_helper' +require 'disable_css_animation_helper' describe 'New/edit issue', feature: true, js: true do include GitlabRoutingHelper @@ -33,48 +34,12 @@ describe 'New/edit issue', feature: true, js: true do # TODO: Figure out a better way to wait for dropdown CSS hide # animation to complete - sleep 0.3 + # sleep 0.3 expect(page.find('.dropdown-menu-user', visible: false)).not_to be_visible end end - describe 'multiple assignees' do - before do - click_button 'Unassigned' - end - - it 'unselects other assignees when unassigned is selected' do - page.within '.dropdown-menu-user' do - click_link user2.name - end - - page.within '.dropdown-menu-user' do - click_link 'Unassigned' - end - - page.within '.js-assignee-search' do - expect(page).to have_content 'Unassigned' - end - - expect(find('input[name="issue[assignee_ids][]"]', visible: false).value).to match('0') - end - - it 'toggles assign to me when current user is selected and unselected' do - page.within '.dropdown-menu-user' do - click_link user.name - end - - expect(find('a', text: 'Assign to me', visible: false)).not_to be_visible - - page.within '.dropdown-menu-user' do - click_link user.name - end - - expect(find('a', text: 'Assign to me')).to be_visible - end - end - it 'allows user to create new issue' do fill_in 'issue_title', with: 'title' fill_in 'issue_description', with: 'title' |