feat(abut): 흉벽 배근 입력 저장

- AbutRecord.rebar.parapet (바꾼 값만), applyParapetRebar, 프로젝트 파일 검증

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-11-04 17:02:04 +09:00
1 parent 25a4a84138
commit ba71911edc
4 files changed
+34 -1

No files matched your search

+18
View File
@@ -140,3 +140,21 @@ describe('교대 흉벽 · 브라켓 배근 A1 (AD5, 교대흉벽철근.md §11)
expect(bar(r, 'P1').modified).toBe(false);
});
});
import { applyParapetRebar, applyWallRebar } from '../src/core/abut/edit';
import { checkStoredAbutments } from '../src/core/project';
describe('③ 흉벽 배근 입력 저장', () => {
it('stores only the changed values next to the 벽체 ones; undefined links a group back; refuses bad values', () => {
const a = applyParapetRebar(applyWallRebar(rec, { sL: 150 }), { sHoriz: 150, s10: 350 });
expect(a.rebar).toEqual({ wall: { sL: 150 }, parapet: { sHoriz: 150, s10: 350 } });
expect(applyParapetRebar(a, { sHoriz: undefined }).rebar?.parapet).toEqual({ s10: 350 });
expect(() => applyParapetRebar(rec, { k67V: 0 })).toThrow('P6 · P7 배수');
expect(() => applyParapetRebar(rec, { L10: -1 })).toThrow();
});
it('the project file keeps the 흉벽 input and refuses a non-number', () => {
expect(() => checkStoredAbutments([applyParapetRebar(rec, { c: 80 })])).not.toThrow();
expect(() => checkStoredAbutments([{ ...rec, rebar: { parapet: { c: 'x' } } as never }])).toThrow('흉벽 배근');
});
});