diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-11-14 12:32:28 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-11-15 15:57:38 +0000 |
commit | 5846b85b117714041be38ae4a79c2a849aba73ae (patch) | |
tree | 1b015825325dd8f433640f9553c892336a802738 /t/map | |
parent | 15acb885f5240f63a5e19c4474851291518f0677 (diff) |
Move map JS to code, to be used on all pages.
Diffstat (limited to 't/map')
-rw-r--r-- | t/map/tests.t | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/map/tests.t b/t/map/tests.t new file mode 100644 index 000000000..f34ccfa6d --- /dev/null +++ b/t/map/tests.t @@ -0,0 +1,29 @@ +use FixMyStreet::Map; +use Test::More; + +my $requires = { + 'Angus' => 'angus/js.js', + 'Bing' => 'map-bing-ol.js', + 'Bristol' => 'map-wmts-bristol.js', + 'Bromley' => 'bromley/map.js', + 'FMS' => 'map-fms.js', + 'Google' => 'map-google.js', + 'GoogleOL' => 'map-google-ol.js', + 'OSM' => 'OpenStreetMap.js', + 'CycleMap' => 'OpenStreetMap.js', + 'MapQuest' => 'OpenStreetMap.js', + 'StreetView' => 'map-streetview.js', + 'TonerLite' => 'map-toner-lite.js', + 'Zurich' => 'map-wmts-zurich.js', +}; + +foreach (FixMyStreet::Map->maps) { + next if /WMTSBase/; # Only its subclasses have JS + my $js = $_->map_javascript; + my $test_file = $js->[-1]; + s/.*:://; + isnt $requires->{$_}, undef, "$_ requires present"; + like $test_file, qr/$requires->{$_}/, "$_ JS okay"; +} + +done_testing(); |