wip(est-test): 개발 중 저장 3 — 깃 싱크(11-08)

This commit is contained in:
2026-11-08 17:44:13 +09:00
parent d39eece45e
commit db71cdbf7c
28 changed files with 1027 additions and 202 deletions
@@ -1,6 +1,44 @@
from test_est_rea_parity import run
def test_quantity_totals_handles_large_estimate_and_ambiguous_targets():
result = run(
"math",
"""(()=>{
const p=EstNative.empty();
p.tables.EstMainDat=Array.from({length:5000},(_,i)=>({PkID:i+1,Code:'C'+i,Level:0}));
p.quantities=Array.from({length:5000},(_,i)=>({Code:'Q'+i,formula:'1',TargetKey:'id:'+(i+1)}));
const totals=EstQuantity.totals(p,'manual');
p.tables.EstMainDat.push({PkID:1,Code:'other',Level:0});
let duplicate=false;
try { EstQuantity.totals(p,'manual'); } catch(e) { duplicate=e.message.includes('중복'); }
return {count:totals.size,first:totals.get(0),last:totals.get(4999),duplicate};
})()""",
)
assert result == {"count": 5000, "first": 1, "last": 1, "duplicate": True}
def test_quantity_target_options_are_loaded_when_focused():
result = run(
"math",
"""(()=>{
const p=EstNative.empty();
p.tables.EstMainDat=[{PkID:1,Code:'A',Name:'첫 행'},
{PkID:2,Code:'B',Name:'둘째 행'},{PkID:3,Code:'C',Level:1}];
globalThis.EstApp={esc:v=>String(v),state:{project:p}};
const handlers={}; globalThis.document={addEventListener:(name,fn)=>handlers[name]=fn};
const html=EstQuantity.targetSelect(p,{TargetKey:'id:2',TargetCode:'B'},'manual',0);
EstQuantity.install();
const select={dataset:{quantitySelect:'manual'},value:'id:2',innerHTML:''};
handlers.focusin({target:select});
return {initialOptions:(html.match(/<option/g)||[]).length,
loadedOptions:(select.innerHTML.match(/<option/g)||[]).length,
selected:select.value,loaded:select.dataset.quantityOptionsLoaded};
})()""",
)
assert result == {"initialOptions": 2, "loadedOptions": 3, "selected": "id:2", "loaded": "1"}
def test_excel_quantity_cell_rejects_invalid_address_or_non_numeric_value():
result = run(
"math",