Files
odysseus/tests/test_editor_pen_path_js.py
T
pewdiepie-archdaemonandClaude Opus 5.5 5fac693c1c feat(photo-editor): Ajax Image Editor client (Photoshop-parity tools)
Photoshop-parity editor client: layers, selection/masking, brushes,
smart filters, LUT import, Quick Edit, mobile gestures, workspaces,
batch operations, and the service-worker versioning (v978->v1006).

Source: vendor/photocraft (ad1cff44) photo-editor client files, merged
onto upstream/dev (a8c147b2). Conflict resolution documented in
pr_work/A_conflicts.md; editor files taken from vendor/photocraft
(upstream's editor is an earlier snapshot of the same feature).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 11:57:35 +00:00

61 lines
1.5 KiB
Python

from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def read(rel):
return (ROOT / rel).read_text(encoding="utf-8")
def test_pen_path_module_exists():
src = read("static/js/editor/tools/pen-path.js")
for token in [
"export function createPenPathTool(",
"ensurePathLayer",
"drawPath",
"commitPath",
"cancelPath",
"finish",
"hasDraft",
]:
assert token in src
def test_toolbar_exposes_path_tool():
src = read("static/js/editor/build/toolbar.js")
assert "path: { label: 'Pen Path'" in src
assert "'path'" in src
assert "['pen', 'path']" in src
assert "['text', 'shape']" in src
def test_controls_have_path_section():
src = read("static/js/editor/build/controls.js")
for token in [
'id="ge-path-section"',
'id="ge-path-finish"',
'id="ge-path-cancel"',
'id="ge-path-fill"',
'id="ge-path-stroke"',
]:
assert token in src
def test_gallery_wires_path_tool():
src = read("static/js/galleryEditor.js")
for token in [
"from './editor/tools/pen-path.js'",
"createPenPathTool(",
"state.tool === 'path'",
"_pathTool.begin(e)",
"_pathTool.cancel()",
"_ensurePathLayer",
"_drawPathDraft",
]:
assert token in src
def test_pen_path_module_is_precached():
src = read("static/sw.js")
assert "/static/js/editor/tools/pen-path.js" in src