feat(view): standing input and names for the P1 project (운곡교P1 · 운곡교)
- The sample button and ?sample=1 fill the project name 운곡교P1 and the bridge name 운곡교. The sample is RAG/운곡교P1입력.xlsx. - Test: the app's copy stays byte-identical to the RAG file (skipped when the RAG folder is absent) and reads one pier, P1, T형, 말뚝기초, 10 bearings. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4d8bbf7f6e
commit
12239c6652
2 files changed
+35
-2
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { parseWorkbook } from '../src/core/parseWorkbook';
|
||||
import { loadWorkbook } from './helpers';
|
||||
|
||||
// The standing input is RAG/운곡교P1입력.xlsx. The app serves a copy in public/samples; the two must stay identical.
|
||||
const RAG_INPUT = fileURLToPath(new URL('../../../RAG/운곡교P1입력.xlsx', import.meta.url));
|
||||
const APP_COPY = fileURLToPath(new URL('../public/samples/운곡교P1입력.xlsx', import.meta.url));
|
||||
|
||||
describe('표준 입력 파일 (운곡교P1입력.xlsx)', () => {
|
||||
it('the app sample is byte-identical to RAG/운곡교P1입력.xlsx', () => {
|
||||
if (!existsSync(RAG_INPUT)) return; // RAG folder not present in this checkout
|
||||
expect(readFileSync(APP_COPY).equals(readFileSync(RAG_INPUT))).toBe(true);
|
||||
});
|
||||
|
||||
it('reads one pier, P1, T형, 말뚝기초, with 10 bearings', () => {
|
||||
const { piers, issues } = parseWorkbook(loadWorkbook());
|
||||
expect(issues).toEqual([]);
|
||||
expect(piers.map((p) => p.name)).toEqual(['P1']);
|
||||
expect(piers[0].type).toBe('T형');
|
||||
expect(piers[0].foundationType).toBe('말뚝기초');
|
||||
expect(piers[0].bearings).toHaveLength(10);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user