from pathlib import Path from src.phase_z2_pipeline import ( _expand_dx_effect_component, _load_component_expansion_registry, parse_mdx, ) def test_t23_registry_contains_dx_effect(): registry = _load_component_expansion_registry() entry = registry["components"]["DxEffect"] assert entry["source_path"] == "samples/src/components/dx.astro" assert entry["parent_policy"] == "keep_under_containing_numbered_section" assert "persona_column" in entry["expands_to"] def test_t23_dx_effect_expands_to_three_persona_groups(): expanded, trace = _expand_dx_effect_component("before\n\nafter") assert "= 1 def test_t23_parse_mdx02_expands_dx_effect_inside_parent_section(): mdx = next( p for p in Path("samples/mdx").glob("02*.mdx") if "원본" not in p.name ) _, sections, _ = parse_mdx(mdx) by_id = {s.section_id: s for s in sections} section = by_id["02-2"] assert "= 3 assert section.sub_sections assert section.sub_sections[0]["component"] == "DxEffect" assert section.sub_sections[0]["status"] == "expanded"