30 lines
1.4 KiB
TypeScript
30 lines
1.4 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
||
import { abutBearingPlanSvg, abutBearingSectionSvg, abutSolplateSvg, type AbutBearingDetail } from '../src/view/abut-bearing-svg';
|
||
|
||
// 운곡교 A1 받침 ① (교대 받침 표: 블럭 125 = 75 + 50, H 275 → T 25, h3 250, L 1000 × W 1100, T1 27.5 / T2 22.5, 회전 −4.42°).
|
||
const d: AbutBearingDetail = {
|
||
no: 1, blockMm: 1200, padMm: 1000, L: 1000, W: 1100,
|
||
h1: 75, h2: 50, h3: 250, h4: 25, T1: 27.5, T2: 22.5, rotDeg: -4.42, S: -0.5, seatEl: 44.367, z: 44.492,
|
||
};
|
||
|
||
describe('교대 받침 삽도 (시안 ② 교량받침 카드)', () => {
|
||
it('평면: block, pad and solplate L × W, turned by the bearing azimuth', () => {
|
||
const svg = abutBearingPlanSvg(d);
|
||
expect(svg).toContain('솔플 1000 × 1100');
|
||
expect(svg).toContain('패드 1000 (점선)');
|
||
expect(svg).toContain('rotate(4.420 150 130)');
|
||
expect(svg.match(/<rect /g)).toHaveLength(3);
|
||
});
|
||
|
||
it('단면: the four layers and E = h1 + h2 + h3 + h4 = 400', () => {
|
||
const svg = abutBearingSectionSvg(d);
|
||
for (const s of ['h1 75', 'h2 50', 'h3 250', 'h4 25', 'E = 400', '교좌면 EL.44.367', 'z EL.44.492']) expect(svg).toContain(s);
|
||
expect(svg.match(/<rect /g)).toHaveLength(4);
|
||
});
|
||
|
||
it('솔플레이트: L, W, T1 → T2 and the slope', () => {
|
||
const svg = abutSolplateSvg(d);
|
||
for (const s of ['T1 27.5', 'T2 22.5', 'L 1000 · W 1100', 'S -0.500 %']) expect(svg).toContain(s);
|
||
});
|
||
});
|