Fix specs for not having `onbeforeunload` anymore.

pull/5354/head
Wieland Lindenthal 8 years ago
parent c13ef9fb78
commit a3167b3b39
  1. 2
      spec/features/security/angular_xss_spec.rb
  2. 16
      spec/features/work_packages/cancel_editing_spec.rb

@ -131,8 +131,6 @@ describe 'Angular expression escaping', type: :feature do
expect(preview.text).to match /\{\{[\s\w]+\}\}/
btn_cancel.click
page.driver.browser.switch_to.alert.accept
expect(page).to have_no_selector('#content_text')
end
end

@ -68,10 +68,19 @@ describe 'Cancel editing work package', js: true do
expect(page).to have_selector('h2', text: 'OpenProject')
end
it 'shows an alert when moving to other pages' do
it 'does not show an alert when moving to other pages' do
# This used to show an alert until browsers dropped support
# for `onbeforeunload`.
#
# We want to find a way how to to regain that possibility
# at some later point in time. Until then we keep that block
# and only flip
# move_to_home_page(alert: true)
# to
# move_to_home_page(alert: false)
paths.each do |path|
expect_active_edit(path)
move_to_home_page
move_to_home_page(alert: false)
end
end
@ -85,9 +94,6 @@ describe 'Cancel editing work package', js: true do
expect(page).to have_selector('.wp-edit-field.subject.-active')
expect(wp_page).not_to have_alert_dialog
# Actually move somewhere to accept the beforeunload
move_to_home_page
end
it 'cancels the editing when clicking the button' do

Loading…
Cancel
Save