refactor: split CSS and JS into modular files (SRP)

This commit is contained in:
2025-12-26 13:55:02 +01:00
parent 94cf36bff3
commit 2e5731b5d6
47 changed files with 8882 additions and 2298 deletions

View File

@@ -110,13 +110,18 @@ class TestTemplateIntegration:
assert b"</html>" in content
async def test_templates_load_required_javascript(self, client):
"""Test that index template loads all required JavaScript files."""
"""Test that index template loads all required JavaScript modules."""
response = await client.get("/")
assert response.status_code == 200
content = response.content
# Check for main app.js
assert b"/static/js/app.js" in content
# Check for modular JS structure (shared modules)
assert b"/static/js/shared/constants.js" in content
assert b"/static/js/shared/auth.js" in content
assert b"/static/js/shared/api-client.js" in content
# Check for index-specific modules
assert b"/static/js/index/app-init.js" in content
# Check for localization.js
assert b"/static/js/localization.js" in content
@@ -131,8 +136,8 @@ class TestTemplateIntegration:
"""Test that queue template includes WebSocket support."""
response = await client.get("/queue")
assert response.status_code == 200
# Check for websocket_client.js implementation
assert b"websocket_client.js" in response.content
# Check for modular websocket client
assert b"/static/js/shared/websocket-client.js" in response.content
async def test_index_includes_search_functionality(self, client):
"""Test that index page includes search functionality."""