upgrade: adopt V8.31.1 (theme 1.3/1.4 redesigns, editor deep-canvas, guided launch, component library)
Overlay 190 upstream items (V8.22→8.31) preserving trade-pro theme, registry tests, and design docs. Re-applied full patch set on identical anchors (discovery/env_for/blocks.css/type-mapping/locale-override/ theme_color/frontend entries/test_theme_pro_v3 mods) plus compose pins. Verified: theme suites 35/35; dual-baseline full run 415 passed vs pristine 386+29 ours, FAILED-set diff EMPTY (same 10 Windows env fails). Live: container 8.31.1-dev.1 healthy, hesupipe 192 entries intact, trade-pro build 203 pages 0 errors. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
"""V8.22 studio canvas wiring and editor-published separation."""
|
||||
from pathlib import Path
|
||||
from bs4 import BeautifulSoup
|
||||
ROOT=Path(__file__).resolve().parents[1]
|
||||
|
||||
def test_canvas_resources_are_real_and_editor_only():
|
||||
bridge=(ROOT/'app/static/studio-canvas-bridge.js').read_text(encoding='utf-8')
|
||||
source=(ROOT/'app/main.py').read_text(encoding='utf-8')
|
||||
editor=(ROOT/'app/static/editor.js').read_text(encoding='utf-8')
|
||||
assert 'studio-canvas-bridge.js' in source
|
||||
assert 'studio-canvas-bridge.js' not in (ROOT/'app/builder.py').read_text(encoding='utf-8')
|
||||
for command in ('reorder','resize-columns','add-after','duplicate','delete','inline-text'):
|
||||
assert command in editor and command in bridge
|
||||
assert 'eval(' not in bridge and 'new Function(' not in bridge
|
||||
assert 'event.source!==frame.contentWindow' in editor
|
||||
|
||||
def test_editor_canvas_hints_and_save_remain_accessible():
|
||||
soup=BeautifulSoup((ROOT/'app/templates/editor.html').read_text(encoding='utf-8'),'html.parser')
|
||||
assert soup.select_one('#sfInsertHint')['hidden'] == ''
|
||||
assert soup.select_one('#sitePreview')['sandbox']==['allow-scripts']
|
||||
assert soup.select_one('#saveDraftButton')
|
||||
assert soup.select_one('#publishDesignButton')
|
||||
Reference in New Issue
Block a user