Files
Pier_v1/tests/member-fck.test.ts
T
ypshimandClaude Haiku 5.5 66e7d4d90d feat(abut): 벽체 배근 입력 저장 · 교대 벽체 등 fck(35)
- AbutRecord.rebar.wall (바꾼 값만), applyWallRebar, 프로젝트 파일 검증
- 교대 벽체 · 흉벽 · 날개벽 · 접속슬래브 fck(abutBody, 기본 35)를 ② 벽체·흉벽 카드에서 입력. 저판 fck 행과 같은 함수

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-11-04 16:22:15 +09:00

36 lines
1.5 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { DEFAULT_MATERIAL, fckChanged, IMPORTED_FCK, materialFor } from '../src/core/rebar/common';
describe('IMPORTED_FCK (교각도 · 교대도 기준 부재별 기본 fck)', () => {
it('is 40 for 기둥·코핑, 27 for 확대기초, 27 for 교대 저판 and 35 for 교대 벽체 등', () => {
expect(IMPORTED_FCK).toEqual({ column: 40, coping: 40, footing: 27, abutFooting: 27, abutBody: 35 });
});
});
describe('fckChanged (기본과 다르면 주황색)', () => {
it('is false at the imported default', () => {
expect(fckChanged({ column: 40, coping: 40, footing: 27, abutFooting: 27 }, 'coping')).toBe(false);
});
it('is true when the member differs from its imported default', () => {
expect(fckChanged({ coping: 42 }, 'coping')).toBe(true);
expect(fckChanged({ footing: 30 }, 'footing')).toBe(true);
});
it('is false when the member has no value yet', () => {
expect(fckChanged({}, 'column')).toBe(false);
});
});
describe('교대 저판 fck (교각 기초와 별도, 2026-11-04)', () => {
it('follows abutFooting, not the pier footing', () => {
const byMember = { footing: 30, abutFooting: 35 };
expect(materialFor(DEFAULT_MATERIAL, byMember, 'abutFooting').fck).toBe(35);
expect(materialFor(DEFAULT_MATERIAL, byMember, 'footing').fck).toBe(30);
});
it('falls back to the 공통 fck when unset (old project files)', () => {
expect(materialFor({ ...DEFAULT_MATERIAL, fck: 24 }, { footing: 30 }, 'abutFooting').fck).toBe(24);
});
});