-
-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12963 from murjax/map-network-check-8230
Show alert if map cannot load
- Loading branch information
Showing
3 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'system_helper' | ||
|
||
RSpec.describe 'Map' do | ||
context 'map can load' do | ||
it 'does not show alert' do | ||
url_whitelist = page.driver.browser.url_whitelist | ||
page.driver.browser.url_whitelist = nil | ||
|
||
assert_raises(Capybara::ModalNotFound) do | ||
accept_alert { visit '/map' } | ||
end | ||
|
||
page.driver.browser.url_whitelist = url_whitelist | ||
end | ||
end | ||
|
||
context 'map cannot load' do | ||
it 'shows alert' do | ||
message = accept_alert { visit '/map' } | ||
expect(message).to eq( | ||
"Unable to load map. Please check your browser " \ | ||
"settings and allow 3rd party cookies for this website." | ||
) | ||
end | ||
end | ||
end |