Fix V3 shell active states
All checks were successful
CD Pipeline / deploy (push) Successful in 1m3s
All checks were successful
CD Pipeline / deploy (push) Successful in 1m3s
This commit is contained in:
@@ -211,7 +211,7 @@ def test_ai_history_uses_v2_shell_and_real_history_apis():
|
||||
assert "假商品" not in template
|
||||
|
||||
assert "@ai_bp.route('/ai_history')" in route_source
|
||||
assert "render_template('ai_history.html')" in route_source
|
||||
assert "render_template('ai_history.html', active_page='ai_history')" in route_source
|
||||
assert "@ai_bp.route('/api/ai/history')" in route_source
|
||||
assert "ai_history_service.get_history_list" in route_source
|
||||
assert "ai_history_service.get_statistics" in route_source
|
||||
@@ -238,6 +238,7 @@ def test_ai_recommend_uses_v2_shell_and_runtime_category_data():
|
||||
|
||||
assert "@ai_bp.route('/ai_recommend')" in route_source
|
||||
assert "render_template('ai_recommend.html'" in route_source
|
||||
assert "active_page='ai_recommend'" in route_source
|
||||
assert "product_categories=product_categories" in route_source
|
||||
assert "@ai_bp.route('/api/ai/generate_copy'" in route_source
|
||||
assert "@ai_bp.route('/api/ai/web_search'" in route_source
|
||||
|
||||
29
tests/test_shell_active_page_contract.py
Normal file
29
tests/test_shell_active_page_contract.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def test_ai_and_system_pages_pass_active_page_to_v3_shell():
|
||||
ai_routes = (ROOT / "routes/ai_routes.py").read_text(encoding="utf-8")
|
||||
system_routes = (ROOT / "routes/system_public_routes.py").read_text(encoding="utf-8")
|
||||
|
||||
assert "render_template('ai_recommend.html'," in ai_routes
|
||||
assert "active_page='ai_recommend'" in ai_routes
|
||||
assert "render_template('ai_history.html', active_page='ai_history')" in ai_routes
|
||||
assert "render_template('ai_intelligence.html', active_page='ai_intelligence')" in ai_routes
|
||||
assert "render_template('logs.html', active_page='logs')" in system_routes
|
||||
|
||||
|
||||
def test_ai_and_logs_titles_use_ewoooc_brand():
|
||||
templates = [
|
||||
ROOT / "templates/ai_recommend.html",
|
||||
ROOT / "templates/ai_intelligence.html",
|
||||
ROOT / "templates/ai_history.html",
|
||||
ROOT / "templates/logs.html",
|
||||
]
|
||||
|
||||
for template_path in templates:
|
||||
source = template_path.read_text(encoding="utf-8")
|
||||
assert "EwoooC" in source
|
||||
assert "WOOO TECH" not in source
|
||||
Reference in New Issue
Block a user