Files
Pier_v1/tests/block-rebar-settings.test.ts

26 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { buildPier } from '../src/core/geometry';
import { barDepths, bearingBlockRebar, DEFAULT_BLOCK_REBAR, totals } from '../src/core/rebar/bearing-block';
import { loadP1 } from './helpers';
describe('받침블럭 철근 설정 (승인 2026-10-26)', () => {
it('the defaults give the P1 depths: S2 50, S1 69.1 (= 피복 + S1/2 + S2/2 with H19)', () => {
expect(barDepths(DEFAULT_BLOCK_REBAR)).toEqual({ S2: 50, S1: 50 + 19.1 });
});
it('S1 depth follows the top cover: 피복 60 → S1 79.1, S2 60', () => {
expect(barDepths({ ...DEFAULT_BLOCK_REBAR, coverTop: 60 })).toEqual({ S2: 60, S1: 60 + 19.1 });
});
it('separate spacings: S1 @100 across 1200 gives 10 bars; S2 stays @125 (8 bars)', () => {
const m = buildPier({ ...loadP1(), blockRebar: { spacingS1: 100 } });
const t = totals(bearingBlockRebar(m));
expect(t.S1).toBe(10 * 10);
expect(t.S2).toBe(8 * 10);
});
it('P1 with the defaults keeps S1 80 and S2 80', () => {
expect(totals(bearingBlockRebar(buildPier(loadP1())))).toEqual({ S1: 80, S2: 80 });
});
});