Files
Pier_v1/tests/block-rebar-plan-svg.test.ts
T
ypshimandClaude Haiku 5.5 fa1ec3e864 feat(rebar): dimensions on the block rebar plan
- The S2 layout along the 교축 (below the block), the S1 layout along the 교각축
  (beside it), and the block width, in the same form as the C–C section.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-26 14:19:52 +09:00

43 lines
1.8 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { buildPier } from '../src/core/geometry';
import { blockRebarPlanSvg } from '../src/view/block-rebar-plan-svg';
import { loadP1 } from './helpers';
const count = (svg: string, re: RegExp) => (svg.match(re) ?? []).length;
describe('받침블럭 배근 평면 (승인 2026-10-26)', () => {
it('a separate pair: 8 S2 and 8 S1 lines per block, each with two leg dots', () => {
const svg = blockRebarPlanSvg(buildPier(loadP1()), 0);
expect(count(svg, /stroke="#0F5C66" stroke-width="8"/g)).toBe(16);
expect(count(svg, /stroke="#B4531F" stroke-width="8"/g)).toBe(16);
expect(count(svg, /<circle/g)).toBe(64);
});
it('a 일체 pair: 19 S2 lines and 8 S1 lines, with their leg dots', () => {
const svg = blockRebarPlanSvg(buildPier({ ...loadP1(), bearingLayout: '일체' }), 0);
expect(count(svg, /stroke="#0F5C66" stroke-width="8"/g)).toBe(19);
expect(count(svg, /stroke="#B4531F" stroke-width="8"/g)).toBe(8);
expect(count(svg, /<circle/g)).toBe(54);
});
it('labels only the row numbers S1 and S2', () => {
const svg = blockRebarPlanSvg(buildPier(loadP1()), 0);
expect(svg).toContain('>S2<');
expect(svg).toContain('>S1<');
});
});
describe('받침블럭 배근 평면 치수 (승인 2026-10-26)', () => {
it('shows the S2 layout 162.5 · 7@125=875 · 162.5 and the block width 1200', () => {
const svg = blockRebarPlanSvg(buildPier(loadP1()), 0);
expect(svg).toContain('162.5 · 7@125=875 · 162.5');
expect(svg).toContain('>1200<');
});
it('a 일체 pair shows the 2500 block width and the 19-bar S2 layout', () => {
const svg = blockRebarPlanSvg(buildPier({ ...loadP1(), bearingLayout: '일체' }), 0);
expect(svg).toContain('>2500<');
expect(svg).toContain('@125=2250');
});
});