aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/offline.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-12-19 09:23:21 +0000
committerMatthew Somerville <matthew@mysociety.org>2020-02-14 10:38:49 +0000
commit0e80a90bebc12fe381892386f9ffd751edb38d7c (patch)
tree50f5ac13f745f6142c9b6cab726dacda2fb447fe /t/app/controller/offline.t
parent43290e5f733b4e88c6b4e5467b7e446a416a4682 (diff)
Initial service worker.
This basic service worker behaves identically to the existing appcache - some static scripts and CSS are cached, any HTML offline instead returns a static HTML page that knows how to show data on stored problems out of localStorage (stored there when /my/planned was visited online). Inspect form submissions will be captured and can be synced back when online. Once feature parity is established, we will then remove appcache, switch from using localStorage to the cache API, and hopefully move all offline support into the service worker.
Diffstat (limited to 't/app/controller/offline.t')
-rw-r--r--t/app/controller/offline.t12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/app/controller/offline.t b/t/app/controller/offline.t
index 505e605a0..d2a5009ec 100644
--- a/t/app/controller/offline.t
+++ b/t/app/controller/offline.t
@@ -33,4 +33,16 @@ FixMyStreet::override_config {
};
};
+subtest 'service worker' => sub {
+ $mech->get_ok('/service-worker.js');
+ $mech->content_contains('translation_strings');
+ $mech->content_contains('offline/fallback');
+};
+
+subtest 'offline fallback page' => sub {
+ $mech->get_ok('/offline/fallback');
+ $mech->content_contains('Offline');
+ $mech->content_contains('offline_list');
+};
+
done_testing(); \ No newline at end of file