"""The brush options strip fits on one line and hides its secondary controls (Spacing / Smoothing / Blend / pen-pressure) behind a caret ("v") dropdown, matching the wand's "More" treatment.""" from pathlib import Path import re ROOT = Path(__file__).resolve().parents[1] CSS = (ROOT / "static/css/13-image-editor.css").read_text(encoding="utf-8") CONTROLS = (ROOT / "static/js/editor/build/controls.js").read_text(encoding="utf-8") OPTIONS = (ROOT / "static/js/editor/build/options-bar.js").read_text(encoding="utf-8") STROKE = (ROOT / "static/js/editor/stroke-tool-sliders.js").read_text(encoding="utf-8") GALLERY = (ROOT / "static/js/galleryEditor.js").read_text(encoding="utf-8") SW = (ROOT / "static/sw.js").read_text(encoding="utf-8") def test_brush_strip_has_a_caret_more_dropdown(): assert '' in CONTROLS assert 'id="ge-brush-more"' in CONTROLS assert 'aria-haspopup="true" aria-expanded="false"' in CONTROLS assert "ge-brush-more-btn" in CONTROLS assert '' in CONTROLS assert 'class="ge-brush-more-menu" id="ge-brush-more-menu" hidden' in CONTROLS def test_secondary_brush_controls_live_after_the_menu_open(): i = CONTROLS.index('id="ge-brush-more-menu"') j = CONTROLS.index('ge-brush-preset-row', i) block = CONTROLS[i:j] for marker in ('id="ge-brush-spacing"', 'id="ge-brush-smoothing"', 'id="ge-brush-blend"', 'ge-brush-pressure-row', 'id="ge-brush-flow-row"', 'id="ge-brush-softness-row"'): assert marker in block, marker def test_brush_size_label_drops_the_redundant_word(): # The px value stays but the redundant "Size" word next to the brush is gone. assert '