aboutsummaryrefslogtreecommitdiffstats
path: root/t/map
diff options
context:
space:
mode:
Diffstat (limited to 't/map')
-rw-r--r--t/map/tests.t29
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();