feat(parse): report per-sheet recognition and block error sheets

- parseWorkbook returns a report per sheet (table counts, issues, ok)
- sheets with E-level issues cannot be selected (spec section 2.3)
- pier input carries its source sheet name

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-21 17:43:36 +09:00
1 parent 35d89dc4e2
commit 01d2bf4958
8 files changed
+122 -16

No files matched your search

+17
View File
@@ -32,3 +32,20 @@ describe('parseWorkbook (P1 sheet intent.PR)', () => {
expect(p1.bearings[0].azimuthDeg).toBeCloseTo(75.9489, 4);
});
});
describe('sheet report (spec §2.3)', () => {
it('marks the P1 sheet as selectable and counts its tables', () => {
const { sheets } = parseWorkbook(loadWorkbook());
expect(sheets).toHaveLength(1);
expect(sheets[0]).toMatchObject({ name: 'intent.PR', ok: true, piers: 1, tables: { pier: 1, ip: 1, bearing: 1 } });
});
it('marks a sheet with a bad azimuth (E03) as not selectable and drops its pier', () => {
const wb = loadWorkbook();
wb.Sheets['intent.PR']['F32'].v = '75.9';
const { piers, sheets, issues } = parseWorkbook(wb);
expect(issues.map((i) => i.code)).toContain('E03');
expect(sheets[0].ok).toBe(false);
expect(piers).toHaveLength(0);
});
});