aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-04-04 09:49:38 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-08-03 21:35:40 +0100
commit30426bc093541066f8cc2f40b4a23261d5e4526c (patch)
tree528a2d6b8f481ba63f31f0ef09477445678a5e62 /t
parent9f341adabd2a22de7e13c43e860bb3741017bf58 (diff)
[UK] Pull in cobrand asset files on national site.
Also add body name to layer defaults, so they are only used where appropriate. Switch mapit area javascript calls to GeoJSON, so we can drop KML support in OpenLayers.wfs.js which saves a small amount of bandwidth.
Diffstat (limited to 't')
-rw-r--r--t/cobrand/national_assets.t30
-rw-r--r--t/map/tests.t8
2 files changed, 34 insertions, 4 deletions
diff --git a/t/cobrand/national_assets.t b/t/cobrand/national_assets.t
new file mode 100644
index 000000000..378425193
--- /dev/null
+++ b/t/cobrand/national_assets.t
@@ -0,0 +1,30 @@
+use FixMyStreet::TestMech;
+my $mech = FixMyStreet::TestMech->new;
+
+# Create test data
+my $body = $mech->create_body_ok( 2561, 'Bristol County Council' );
+
+
+subtest 'cobrand assets includes cobrand assets javascript', sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'fixmystreet' ],
+ MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+ $mech->get_ok("/report/new?latitude=51.494885&longitude=-2.602237");
+ $mech->content_contains('buckinghamshire/assets.js');
+ };
+};
+
+subtest 'cobrand assets includes not applied on cobrand sites', sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'bathnes' ],
+ MAPIT_URL => 'http://mapit.uk/',
+ MAP_TYPE => 'FMS,OSM,BathNES,Buckinghamshire',
+ }, sub {
+ $mech->get_ok("/report/new?latitude=51.494885&longitude=-2.602237");
+ $mech->content_lacks('buckinghamshire/assets.js');
+ $mech->content_contains('bathnes/assets.js');
+ };
+};
+
+done_testing();
diff --git a/t/map/tests.t b/t/map/tests.t
index e6749b813..5575eafbb 100644
--- a/t/map/tests.t
+++ b/t/map/tests.t
@@ -3,11 +3,11 @@ use Test::More;
my $requires = {
'Angus' => 'angus/js.js',
- 'BathNES' => 'bathnes/js.js',
+ 'BathNES' => 'bathnes/assets.js',
'Bing' => 'map-bing-ol.js',
- 'Bristol' => 'bristol/js.js',
- 'Bromley' => 'bromley/map.js',
- 'Buckinghamshire' => 'buckinghamshire/js.js',
+ 'Bristol' => 'bristol/assets.js',
+ 'Bromley' => 'bromley/assets.js',
+ 'Buckinghamshire' => 'buckinghamshire/assets.js',
'FMS' => 'map-fms.js',
'Google' => 'map-google.js',
'GoogleOL' => 'map-google-ol.js',