Files
Pier_v1/tests/column-diameter.test.ts
T
CopilotandCopilot 06e1b97a62
ITAM Code Check / build-and-config-check (push) Failing after 37s
ITAM Docker Build Check / docker-build-check (push) Failing after 1m0s
교각 프로그램 초기 버전
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 15:55:01 +09:00

33 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, it } from 'vitest';
import { buildPier } from '../src/core/geometry';
import { columnDiameterIssues } from '../src/core/column-check';
import { columnInputFor, columnRebar } from '../src/core/rebar/column';
import { loadP1 } from './helpers';
describe('기둥 직경 D 입력 (승인 2026-10-23)', () => {
it('the default (absent) is 2000 mm and gives the P1 results', () => {
const m = buildPier(loadP1());
expect(m.columnDiameterMm).toBe(2000);
expect(columnInputFor(m).D).toBe(2000);
expect(columnRebar(columnInputFor(m)).mainP1).toBe(230);
});
it('a larger D (2500) changes the column radius and the rebar, and the model follows the input', () => {
const m = buildPier({ ...loadP1(), columnDiameterMm: 2500 });
expect(m.columnDiameterMm).toBe(2500);
expect(m.columns[0].diameter).toBeCloseTo(2.5, 6);
const col = columnRebar(columnInputFor(m));
expect(col.r1).toBeCloseTo(2500 / 2 - 125 - 0, 0); // r1 = D/2 − c, the outer bar radius
});
it('the checks: range and 50 mm steps, D below the Level width, D + 2c within the coping width, arc spacing', () => {
const m = buildPier(loadP1());
expect(columnDiameterIssues(2000, m)).toEqual([]);
expect(columnDiameterIssues(2050, m)).toEqual([]);
expect(columnDiameterIssues(3200, m).length).toBe(1);
expect(columnDiameterIssues(2025, m).length).toBe(1);
expect(columnDiameterIssues(2100, m).some((x) => x.includes('Level 폭'))).toBe(true);
expect(columnDiameterIssues(2050, m).some((x) => x.includes('코핑 폭'))).toBe(false);
});
});