import { describe, expect, it } from 'vitest'; import { buildPier } from '../src/core/geometry'; import { bearingPlanSvg } from '../src/view/bearing-plan-svg'; import { loadP1, p1Pairs } from './helpers'; // Bridge context (A1 ↔ P1 girder pairs) as in the app, so the solplate slope is computed (2026-11-06). const P1CTX = { pairs: p1Pairs() }; const separate = buildPier(loadP1(), P1CTX); const integrated = buildPier({ ...loadP1(), bearingLayout: '일체' }, P1CTX); 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('draws the solplate of each bearing from its plan (L = A + 100 = 800, W = B + 100 = 740, 2026-11-06)', () => { expect((bearingPlanSvg(separate, 0).match(/width="800" height="740"/g) ?? []).length).toBe(2); }); it('an unknown pair index gives an empty drawing', () => { expect(bearingPlanSvg(separate, 99)).toBe(''); }); });