- 설계변경 내역서에서 회차 추가 때 당초/변경 고르기 - 당초면 행마다 당초 칸으로 Index·품명·규격·단위·수량·단가·금액(GC 포함) - 회차 추가 처리를 native-progress-view.js 로 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
87 lines
3.1 KiB
Python
87 lines
3.1 KiB
Python
"""기성 환경설정: 옵션 기본값·비목 열 순서·표 머리 반영."""
|
|
|
|
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('<p')[0]);};
|
|
const plain=head({});
|
|
const custom=head({d:{code:false,gnZero:false},a:{level:true,sajung:false,gubun:true,gungu:true}});
|
|
return {plain:plain.h,custom:custom.h,jun:custom.rows[0][3]};
|
|
})()""",
|
|
)
|
|
assert result["plain"][0] == "코드" and "사정금액" in result["plain"]
|
|
assert result["custom"] == [
|
|
"레벨",
|
|
"공종",
|
|
"도급수량",
|
|
"전회수량",
|
|
"금회 입력",
|
|
"입력방법",
|
|
"금회금액",
|
|
"금회 노무",
|
|
"금회 재료",
|
|
"금회 경비",
|
|
"누계수량",
|
|
"누계금액",
|
|
"비고",
|
|
]
|
|
assert result["jun"] == ""
|
|
|
|
|
|
def test_origin_load_method_uses_original_fields():
|
|
result = run(
|
|
"math",
|
|
"""(()=>{
|
|
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,
|
|
}
|