chore(quality): apply ruff autofixes and formatting (223 fixes, regression-free: 118/118 tests pass)

This commit is contained in:
Agent Zero
2026-06-10 21:24:24 +00:00
parent c53af91d74
commit aec40d03ac
56 changed files with 459 additions and 528 deletions
+13 -6
View File
@@ -27,6 +27,7 @@ def _read(rel: str) -> str:
# api.js
# ---------------------------------------------------------------------------
def test_api_js_exports_api_and_ApiError():
content = _read("js/api.js")
assert "export class ApiError" in content
@@ -56,6 +57,7 @@ def test_api_js_handles_204_no_content():
# store.js
# ---------------------------------------------------------------------------
def test_store_js_defines_auth_and_notifications():
content = _read("js/store.js")
assert "Alpine.store('auth'" in content
@@ -81,6 +83,7 @@ def test_store_js_notifications_has_push_and_dismiss():
# app.css
# ---------------------------------------------------------------------------
def test_app_css_contains_tailwind_overrides():
content = _read("css/app.css")
# The file defines custom CSS variables (--crm-primary, etc.)
@@ -107,10 +110,10 @@ def test_app_css_has_toast_styles():
# ---------------------------------------------------------------------------
COMPONENTS = [
("account-list.js", "accountList"),
("deal-kanban.js", "dealKanban"),
("activity-list.js", "activityList"),
("dashboard-kpis.js", "dashboardKpis"),
("account-list.js", "accountList"),
("deal-kanban.js", "dealKanban"),
("activity-list.js", "activityList"),
("dashboard-kpis.js", "dashboardKpis"),
]
@@ -120,11 +123,13 @@ def test_alpine_component_defined(filename, factory):
globally with Alpine.data(name, factory)."""
content = _read(f"components/{filename}")
# factory function definition
assert f"export function {factory}" in content, \
assert f"export function {factory}" in content, (
f"{filename} missing `export function {factory}()`"
)
# Alpine.data() registration
assert f"Alpine.data('{factory}'" in content, \
assert f"Alpine.data('{factory}'" in content, (
f"{filename} missing `Alpine.data('{factory}', …)` registration"
)
def test_deal_kanban_handles_drag_and_drop():
@@ -159,6 +164,7 @@ def test_account_list_uses_pagination():
# notifications.js (toast component)
# ---------------------------------------------------------------------------
def test_notifications_js_registers_toast_container():
content = _read("js/components/notifications.js")
assert "toastContainer" in content
@@ -169,6 +175,7 @@ def test_notifications_js_registers_toast_container():
# auth.js
# ---------------------------------------------------------------------------
def test_auth_js_exports_login_logout_register():
content = _read("js/auth.js")
assert "export async function login" in content