sync snapshot from LAN repo (source master-zg @ 40658c74)
This commit is contained in:
1 parent
ea9dcff9c0
commit
754b61572c
179 files changed
+26085
-8788
No files matched your search
@@ -8,6 +8,10 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from deerflow.html_runtime.generated_page_chrome import (
|
||||
_normalize_body_top_spacing,
|
||||
apply_generated_page_chrome,
|
||||
)
|
||||
from deerflow.skills.parser import parse_skill_file
|
||||
from deerflow.skills.storage.local_skill_storage import LocalSkillStorage
|
||||
from deerflow.skills.types import SkillCategory
|
||||
@@ -106,6 +110,24 @@ def test_default_json_renders_editable_x_html(tmp_path: Path) -> None:
|
||||
renderer._write_new(output, html)
|
||||
|
||||
|
||||
def test_generated_brand_header_preserves_x_responsive_css_boundaries() -> None:
|
||||
template = (SKILL_ROOT / "assets" / "x-template.html").read_text(encoding="utf-8")
|
||||
|
||||
normalized = _normalize_body_top_spacing(template)
|
||||
branded, notes = apply_generated_page_chrome(
|
||||
template,
|
||||
system_name="测试系统001",
|
||||
logo_url="/api/public/html-runtime/generated-page-logo?v=test",
|
||||
)
|
||||
|
||||
assert normalized == template
|
||||
assert "@media (max-width: 680px) {\n body {" in normalized
|
||||
assert "@media (max-width: 680px) body{" not in normalized
|
||||
assert 'data-df-generated-header' in branded
|
||||
assert "@media (max-width: 680px) {\n body {" in branded
|
||||
assert notes == ["已自动应用单页面品牌页眉"]
|
||||
|
||||
|
||||
def test_validation_rejects_missing_module_and_duplicate_posts() -> None:
|
||||
renderer = _load_renderer()
|
||||
data = json.loads((SKILL_ROOT / "assets" / "default-data.json").read_text(encoding="utf-8"))
|
||||
|
||||
Reference in new issue
Block a user