"""기성 환경설정: 옵션 기본값·비목 열 순서·표 머리 반영.""" from test_est_rea_parity import run def test_defaults_and_part_order(): result = run( "math", """(()=>{ const d=EstProgressView.get({}); const o=(x)=>EstProgressView.parts(EstProgressView.get({Display:{order:x.order},AccomOption:x})); return {code:d.code,sajung:d.sajung,gubun:d.gubun, a:o({order:0}),b:o({order:2,siljuk:true}),c:o({order:3}),d:o({order:5})}; })()""", ) assert result == { "code": True, "sajung": True, "gubun": False, "a": ["T", "N", "G", "J"], "b": ["N", "G", "J", "S", "T"], "c": ["G", "N", "J", "T"], "d": ["T", "N", "G", "J"], } def test_view_headers_follow_options_and_zero_hiding(): result = run( "math", """(()=>{ const p=EstNative.empty();p.options.SourceRefresh=false; p.tables.EstMainDat=[{Code:'A',Name:'a',GN:10,GU:100},{LinkIndex:54}]; const q=EstNative.calculate(p);q.progress=[{id:'r1',name:'1회',inputs:{},locked:false}]; const g=globalThis;g.EstApp={...(g.EstApp||{}),esc:String,number:String}; g.EstProgressWonga={render:()=>''}; const box=(t,tools,body)=>body,button=()=>'',table=(h,rows)=>JSON.stringify({h,rows}); const st={progressPage:0,selection:new Set()}; const head=(o)=>{q.options.Display=o.d;q.options.AccomOption=o.a; return JSON.parse(EstProgressView.view({...st},q,{box,button,table}).split('
{ const rows=[{Index:2,Index_:1,Name:'b',Name_:'a',Size:'s',Size_:' ',GN:5,GN_:3,GU:10,GU_:8,GC:50,GC_:24}, {Name:'c',GN:1,GU:4}]; const o=EstProgress.originRows(rows); const p=EstNative.empty();p.options.SourceRefresh=false; p.tables.EstMainDat=[{Code:'A',Name:'a',GN:10,GN_:4,GU:100,GU_:100},{LinkIndex:54}]; const q=EstNative.calculate(p); q.progress=[{id:'r1',name:'1회',inputs:{},locked:false,loadMethod:'origin'}, {id:'r2',name:'2회',inputs:{},locked:false}]; const a=EstProgress.calculate(q,'r1').rows[0].GN; q.progress=[q.progress[1]]; const b=EstProgress.calculate(q,'r2').rows[0].GN; return {o:o.map(r=>[r.Index,r.Name,r.Size,r.GN,r.GU,r.GC]),a,b}; })()""", ) assert result == { "o": [[1, "a", "s", 3, 8, 24], [None, "c", None, 1, 4, None]], "a": 4, "b": 10, }