import { describe, expect, it } from 'vitest'; import metaJson from './meta.json' with { type: 'json' }; import { loadFixture, runFixtureSuite } from '@rareindex/connectors/testing'; import { localMeta } from '../_lib/local-meta.js'; import createConnector, { specs } from './index.js'; const connector = createConnector(localMeta(metaJson)); describe('analog-shift', () => { runFixtureSuite(connector, it, expect); it('parses spec lines and emits watch listings with references', async () => { expect(specs('Reference: 1675 Year: 1968 Case Size: 40mm Condition: Excellent')).toMatchObject({ reference: '1675', year: '1968', 'case size': '40mm', condition: 'Excellent' }); const fx = loadFixture('analog-shift', 'products-p1'); const out = await connector.normalize(fx.raw); expect(out.length).toBeGreaterThan(0); for (const r of out) { if (r.kind !== 'listing') throw new Error('expected listing'); expect(['rolex', 'patek_philippe', 'audemars_piguet', 'omega', 'other_watches']).toContain(r.attributes.categorySlug); expect(r.attributes.identifiers.analogshift_sku).toBeTruthy(); expect(r.seller).toBe('Analog:Shift'); if (r.price !== null) expect(r.currency).toBe('USD'); } }); });