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

40 lines
1.6 KiB
Python

import re
import pathlib
REPO = pathlib.Path(__file__).resolve().parent.parent
EDITOR_JS = (REPO / "static/js/galleryEditor.js").read_text(encoding="utf-8")
CSS = (REPO / "static/css/13-image-editor.css").read_text(encoding="utf-8")
SW = (REPO / "static/sw.js").read_text(encoding="utf-8")
def test_footer_docks_to_the_sheet_top():
# Footer bottom == sheet top (vh - sheetTop), no seam.
assert "footer.style.bottom = Math.max(0, Math.round(vh - r.top)) + 'px';" in EDITOR_JS
assert "document.body.classList.add('ge-footer-docked');" in EDITOR_JS
def test_canvas_region_sized_to_meet_the_footer():
# The canvas region is resized so its bottom meets the footer top.
assert "const desiredBottom = Math.round(r.top - footerH);" in EDITOR_JS
assert "area.style.height = want ? want + 'px' : '';" in EDITOR_JS
assert "state._footerDocked = true;" in EDITOR_JS
def test_fit_zoom_drops_pad_when_docked():
# When docked the fit uses no padding so the image fills the region flush.
assert "const pad = state._footerDocked ? 0 : 20;" in EDITOR_JS
def test_css_squares_the_docked_footer_and_hides_the_grab():
assert ".ge-editor-footer.ge-footer-floating {" in CSS
assert "border-radius: 0;" in CSS
assert "border-bottom: 0;" in CSS
assert "body.ge-footer-docked .ge-right-panel .ge-layers-grab {" in CSS
assert "display: none !important;" in CSS
def test_sw_cache_name_is_version_agnostic_pattern():
m = re.search(r"CACHE_NAME\s*=\s*'([^']+)'", SW)
assert m is not None
assert re.fullmatch(r"odysseus-v\d+-pr40-editor-precache", m.group(1))