feat(abut): 받침블럭 배근 입력 저장
- AbutRecord.rebar.block (바꾼 값만), applyBlockRebar, 프로젝트 파일 검증 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a2d0d6057f
commit
5856cfb423
4 files changed
+38
-1
No files matched your search
@@ -50,3 +50,25 @@ describe('교대 받침블럭 배근 A1 (AD6, 교대 기획서 §10)', () => {
|
||||
expect(len).toBeCloseTo(1100, 6);
|
||||
});
|
||||
});
|
||||
|
||||
import { applyBlockRebar } from '../src/core/abut/edit';
|
||||
import { checkStoredAbutments } from '../src/core/project';
|
||||
import { parseAbutments } from '../src/core/abut/parse';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import * as XLSX from 'xlsx';
|
||||
|
||||
describe('③ 받침블럭 배근 입력 저장', () => {
|
||||
const rec = parseAbutments(XLSX.read(readFileSync(fileURLToPath(new URL('../../../RAG/운곡교P1입력.xlsx', import.meta.url))), { type: 'buffer' })).abutments[0];
|
||||
it('stores only the changed values; undefined links back; refuses bad values', () => {
|
||||
const a = applyBlockRebar(rec, { spacingS1: 150, legLength: 800 });
|
||||
expect(a.rebar?.block).toEqual({ spacingS1: 150, legLength: 800 });
|
||||
expect(applyBlockRebar(a, { spacingS1: undefined }).rebar?.block).toEqual({ legLength: 800 });
|
||||
expect(() => applyBlockRebar(rec, { legLength: 0 })).toThrow();
|
||||
});
|
||||
|
||||
it('the project file keeps the 받침블럭 input and refuses a non-number', () => {
|
||||
expect(() => checkStoredAbutments([applyBlockRebar(rec, { coverTop: 60 })])).not.toThrow();
|
||||
expect(() => checkStoredAbutments([{ ...rec, rebar: { block: { coverTop: 'x' } } as never }])).toThrow('받침블럭 배근');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user