diff options
Diffstat (limited to 't/map')
-rw-r--r-- | t/map/tests.t | 29 | ||||
-rw-r--r-- | t/map/tilma/original.t | 6 |
2 files changed, 32 insertions, 3 deletions
diff --git a/t/map/tests.t b/t/map/tests.t new file mode 100644 index 000000000..1123133e4 --- /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' => 'bristol/js.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(); diff --git a/t/map/tilma/original.t b/t/map/tilma/original.t index b29155bee..e89251285 100644 --- a/t/map/tilma/original.t +++ b/t/map/tilma/original.t @@ -92,17 +92,17 @@ for my $test ( $report->state($test->{state}); $report->update; - my ( $on_map_all, $on_map_list, $nearby, $dist ) = + my ( $on_map, $nearby, $dist ) = FixMyStreet::Map::map_features($c, bbox => "0,0,0,0"); - ok $on_map_list; + ok $on_map; ok $nearby; ok $dist; my $id = $report->id; my $colour = $test->{colour}; - my $pin_colour = $c->cobrand->pin_colour($on_map_all->[0], 'around'); + my $pin_colour = $c->cobrand->pin_colour($on_map->[0], 'around'); is $pin_colour, $colour, 'pin colour'; }; } |