feat: upgrade toolbox for v1.2.1
CI / test (pull_request) Canceled after 52s
PR合并自动部署 / release-check (pull_request) Successful in 13s
PR合并自动部署 / deploy (pull_request) Successful in 13s

This commit is contained in:
2026-08-10 02:05:21 +08:00
parent 30f335c83b
commit 8e94f053b1
12 changed files with 1135 additions and 324 deletions
+45
View File
@@ -81,6 +81,51 @@ def test_toolbox_and_games_资源入口与移动端触控样式存在():
assert "@media (max-width: 700px)" in styles
def test_v121_工具箱分类与响应式函数探索器资源完整():
template = (settings.BASE_DIR / "templates" / "index.html").read_text(
encoding="utf-8"
)
app = (STATIC_ROOT / "js" / "app.js").read_text(encoding="utf-8")
toolbox = (STATIC_ROOT / "js" / "toolbox.js").read_text(encoding="utf-8")
graph = (STATIC_ROOT / "js" / "graph.js").read_text(encoding="utf-8")
styles = (STATIC_ROOT / "css" / "app.css").read_text(encoding="utf-8")
assert template.count("js/graph.js") == 1
assert 'data-tool="mental"' not in template
assert 'class="tool-groups"' in template
assert 'data-calc-category="calculus"' in template
assert 'value="solve_system"' in template
assert 'value="matrix_eigenvalues"' in template
assert 'id="graph-function-list"' in template
assert 'id="graph-x-min"' in template
assert 'id="graph-y-max"' in template
assert 'id="graph-auto-fit"' in template
assert 'id="graph-expression"' not in template
assert 'id="graph-range"' not in template
assert "function setCalculatorCategory(" in toolbox
assert "window.HuluGraph?.init()" in toolbox
assert "drawGraph" not in toolbox
assert 'tool === "mental"' not in toolbox
assert "drawGraph" not in app
assert 'tool === "mental"' not in app
assert "function addFunction(" in graph
assert "function drawAxes(" in graph
assert "function niceStep(" in graph
assert "window.devicePixelRatio" in graph
assert '"pointerdown"' in graph
assert '"wheel"' in graph
assert "ResizeObserver" in graph
assert "最多同时绘制 8 条曲线" in graph
assert ".tool-groups" in styles
assert ".calc-category-tabs" in styles
assert ".graph-function-row" in styles
assert ".graph-stage" in styles
assert "aspect-ratio: 16 / 10" in styles
assert "touch-action: none" in styles
def test_latex_默认源码可渲染且_katex_静态资源完整():
template = (settings.BASE_DIR / "templates" / "index.html").read_text(encoding="utf-8")
app = (STATIC_ROOT / "js" / "app.js").read_text(encoding="utf-8")