v2.5.0: add admin auto refresh toggle

This commit is contained in:
Виталий Литвинов
2026-04-25 16:38:19 +03:00
parent 98e4be8831
commit cae552ec87
4 changed files with 126 additions and 2 deletions

View File

@@ -199,6 +199,19 @@ class AdminFeatureTests(unittest.TestCase):
self.assertIn('class="keys-list" id="usersTable"', index)
self.assertNotIn('class="keys-table"', index)
def test_topbar_has_five_second_auto_refresh_toggle(self):
app_js = (ROOT / "admin-web" / "static" / "app.js").read_text(encoding="utf-8")
styles = (ROOT / "admin-web" / "static" / "styles.css").read_text(encoding="utf-8")
index = (ROOT / "admin-web" / "static" / "index.html").read_text(encoding="utf-8")
self.assertIn('id="autoRefreshToggle"', index)
self.assertIn('data-i18n-title="autoRefresh"', index)
self.assertIn("gotelegram-auto-refresh", app_js)
self.assertIn("AUTO_REFRESH_MS = 5000", app_js)
self.assertIn("setInterval", app_js)
self.assertIn("clearInterval", app_js)
self.assertIn(".auto-refresh-toggle", styles)
if __name__ == "__main__":
unittest.main()