aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/offline.t
diff options
context:
space:
mode:
Diffstat (limited to 't/app/controller/offline.t')
-rw-r--r--t/app/controller/offline.t19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/app/controller/offline.t b/t/app/controller/offline.t
index d2a5009ec..876475264 100644
--- a/t/app/controller/offline.t
+++ b/t/app/controller/offline.t
@@ -1,5 +1,7 @@
use FixMyStreet::TestMech;
+use FixMyStreet::DB;
use Path::Tiny;
+use Memcached;
my $mech = FixMyStreet::TestMech->new;
@@ -11,6 +13,7 @@ FixMyStreet::override_config {
my $image_path = path('t/app/controller/sample.jpg');
$image_path->copy($theme_dir->child('sample.jpg'));
subtest 'manifest' => sub {
+ Memcached::delete("manifest_theme:test");
my $j = $mech->get_ok_json('/.well-known/manifest.webmanifest');
is $j->{name}, 'FixMyStreet', 'correct name';
is $j->{theme_color}, '#ffd000', 'correct theme colour';
@@ -20,6 +23,22 @@ FixMyStreet::override_config {
sizes => '133x100'
}, 'correct icon';
};
+ subtest 'themed manifest' => sub {
+ Memcached::delete("manifest_theme:test");
+ FixMyStreet::DB->resultset('ManifestTheme')->create({
+ cobrand => "test",
+ name => "My Test Cobrand FMS",
+ short_name => "Test FMS",
+ background_colour => "#ff00ff",
+ theme_colour => "#ffffff",
+ });
+
+ my $j = $mech->get_ok_json('/.well-known/manifest.webmanifest');
+ is $j->{name}, 'My Test Cobrand FMS', 'correctly overridden name';
+ is $j->{short_name}, 'Test FMS', 'correctly overridden short_name';
+ is $j->{background_color}, '#ff00ff', 'correctly overridden background colour';
+ is $j->{theme_color}, '#ffffff', 'correctly overridden theme colour';
+ };
$theme_dir->remove_tree;
};