Files
odysseus/tests/test_editor_main_menus_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

62 lines
1.6 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_topbar_has_file_edit_help_menus():
src = read("static/js/editor/build/topbar.js")
for token in [
'id="ge-file-menu-btn"',
'id="ge-file-menu"',
'id="ge-edit-menu-btn"',
'id="ge-edit-menu"',
'id="ge-help-menu-btn"',
'id="ge-help-menu"',
'data-file-action',
'data-edit-action',
'data-help-action',
]:
assert token in src
def test_main_menu_bar_order():
src = read("static/js/editor/build/topbar.js")
order = [
'id="ge-file-menu-btn"',
'id="ge-edit-menu-btn"',
'id="ge-image-menu-btn"',
'id="ge-layer-menu-btn"',
'id="ge-type-menu-btn"',
'id="ge-selection-menu-btn"',
'id="ge-filter-menu-btn"',
'id="ge-view-menu-btn"',
'id="ge-window-menu-btn"',
'id="ge-help-menu-btn"',
]
positions = [src.find(token) for token in order]
assert all(pos >= 0 for pos in positions)
assert positions == sorted(positions)
def test_wire_extra_menus_handles_file_edit_help():
src = read("static/js/editor/wire-extra-menus.js")
for token in [
"ge-file-menu-btn",
"ge-edit-menu-btn",
"ge-help-menu-btn",
"[data-file-action]",
"[data-edit-action]",
"[data-help-action]",
]:
assert token in src
def test_wire_topbar_registers_all_menus():
src = read("static/js/editor/wire-topbar.js")
for token in ["'ge-file-menu'", "'ge-edit-menu'", "'ge-help-menu'"]:
assert token in src