import { describe, expect, it } from 'vitest'; import { nameSpecLookupKey, normalizeNameSpecText, } from '../src/services/lastSalePriceByNameSpecService'; describe('lastSalePriceByNameSpec normalize', () => { it('strips spaces and lowercases', () => { expect(normalizeNameSpecText(' 大 白菜 ')).toBe('大白菜'); expect(normalizeNameSpecText('ABC')).toBe('abc'); }); it('builds stable name+spec keys', () => { expect(nameSpecLookupKey('大白菜', '一级')).toBe(nameSpecLookupKey('大 白菜', '一 级')); expect(nameSpecLookupKey('大白菜', '一级')).not.toBe(nameSpecLookupKey('大白菜', '二级')); }); });