Files
Pier_v1/tests/bearing-plan-svg.test.ts
T
ypshimandClaude Haiku 5.5 9b79083d50 fix(bearing): C4·C5 are the 교축 distances from the bearing to the block edges (승인 2026-10-26)
- bearingEdgeDistances now reads the block geometry: 분리 1200 blocks are
  centred on the bearing (600 / 600); 일체 uses the pair's 2500 block (outer
  margins 601, within the 5 mm tolerance of 600).
- The plan labels C4 and C5 from these values; the coping-edge definition is removed.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-26 12:25:15 +09:00

33 lines
1.4 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { buildPier } from '../src/core/geometry';
import { bearingPlanSvg } from '../src/view/bearing-plan-svg';
import { loadP1 } from './helpers';
const separate = buildPier(loadP1());
const integrated = buildPier({ ...loadP1(), bearingLayout: '일체' });
describe('교량받침 상세 평면 (승인 2026-10-26)', () => {
it('shows C4 and C5 from the bearing to the block edges along the 교축 (600 each)', () => {
const svg = bearingPlanSvg(separate, 0);
expect(svg).toContain('C4 600');
expect(svg).toContain('C5 600');
});
it('분리 draws two 1200 outlines; 일체 draws one 2500 outline (block outline only)', () => {
expect((bearingPlanSvg(separate, 0).match(/width="1200" height="1200"/g) ?? []).length).toBe(2);
expect(bearingPlanSvg(integrated, 0)).toContain('width="2500" height="1200"');
});
it('the drawing values are overlaid as dashed outlines only when given', () => {
const plain = bearingPlanSvg(separate, 0);
expect(plain).not.toContain('stroke-dasharray="40 25"');
const overlay = { front: { A: 700, B: 640 }, back: { A: 700, B: 540 } };
const svg = bearingPlanSvg(separate, 0, overlay);
expect((svg.match(/stroke-dasharray="40 25"/g) ?? []).length).toBe(2);
});
it('an unknown pair index gives an empty drawing', () => {
expect(bearingPlanSvg(separate, 99)).toBe('');
});
});