deckhearth/test/lib/card-text-match.test.js
varutasu 0b4f419f49
Scanner identify upgrade — Phase 1 hot path (#156)
* docs(convoy): seed scanner identify upgrade epic and sub-convoys

Baseline scan_attempts telemetry and three-phase plan for faster, more
accurate card identification without touching scanner chrome.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(scanner): tighten Layer-1 identify hot path (Phase 1)

Cut verify hold-still gates, OCR collector numbers on Layer 1, request
structured Gemini JSON, and skip automatic L2 refine when L1 opens the
printing picker. Includes convoy UX/architecture briefs and unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 20:21:20 -05:00

16 lines
619 B
JavaScript

import { describe, expect, it } from 'vitest';
import { extractCollectorNumberCandidate } from '../../lib/ocr-worker.js';
describe('extractCollectorNumberCandidate', () => {
it('extracts slash-style collector numbers', () => {
expect(extractCollectorNumberCandidate('015 / 208\nRare')).toBe('015/208');
});
it('extracts compact numbers from the last numeric line', () => {
expect(extractCollectorNumberCandidate('Some set symbol\n123/456')).toBe('123/456');
});
it('returns empty for non-numeric noise', () => {
expect(extractCollectorNumberCandidate('Creature — Human')).toBe('');
});
});