Add website favicon support
This commit is contained in:
+15
@@ -176,6 +176,14 @@ class NetworkGuardTests(unittest.TestCase):
|
||||
self.assertIn("Username", body)
|
||||
self.assertIn("Password", body)
|
||||
|
||||
def test_favicon_route_serves_checked_in_png(self):
|
||||
handler = DummyHandler("/favicon.png")
|
||||
handler.command = "GET"
|
||||
|
||||
APP.Handler.do_GET(handler)
|
||||
|
||||
self.assertEqual(handler.file_path, http_handler.FAVICON_PATH)
|
||||
|
||||
def test_remote_login_page_escapes_hidden_next_value(self):
|
||||
handler = DummyHandler('/?next="><script>alert(1)</script>')
|
||||
handler.client_address = ("192.168.1.25", 8421)
|
||||
@@ -3482,6 +3490,13 @@ class TemplateHelperTests(unittest.TestCase):
|
||||
self.assertIn("async function api(path, options = {})", APP.CONFIG_HTML)
|
||||
self.assertIn("async function api(path, options = {})", APP.WATCHLIST_HTML)
|
||||
|
||||
def test_pages_include_favicon_link(self):
|
||||
expected = '<link rel="icon" type="image/png" sizes="32x32" href="/favicon.png">'
|
||||
self.assertIn(expected, APP.INDEX_HTML)
|
||||
self.assertIn(expected, APP.QUEUE_HTML)
|
||||
self.assertIn(expected, APP.CONFIG_HTML)
|
||||
self.assertIn(expected, APP.WATCHLIST_HTML)
|
||||
|
||||
def test_config_page_places_dependencies_before_settings_grid(self):
|
||||
self.assertIn('<section class="deps" id="deps"></section>', APP.CONFIG_HTML)
|
||||
self.assertIn('<div class="settings-grid">', APP.CONFIG_HTML)
|
||||
|
||||
Reference in New Issue
Block a user