TypeScript 61.9%
HTML 37.2%
SQL 0.7%
1import { describe, expect, it } from 'vitest';2import metaJson from './meta.json' with { type: 'json' };3import { loadFixture, runFixtureSuite } from '@rareindex/connectors/testing';4import { localMeta } from '../../api/_lib/local-meta.js';5import createConnector, { parseCategoryMarkdown } from './index.js';67const connector = createConnector(localMeta(metaJson));89describe('mpb', () => {10 runFixtureSuite(connector, it, expect);1112 it('parses model cards with availability and price ranges', async () => {13 const md = `[\\\n\\\n**Hasselblad X2D II 100c** \\\n\\\n3 available, $7,289-$7,509](https://www.mpb.com/en-us/product/hasselblad-x2d-ii-100c)`;14 const p = parseCategoryMarkdown(md, 'https://www.mpb.com/en-us/category/used-cameras/medium-format-cameras');15 expect(p.market).toBe('en-us');16 expect(p.models[0]).toMatchObject({ name: 'Hasselblad X2D II 100c', slug: 'hasselblad-x2d-ii-100c', available: 3, priceMin: 7289, priceMax: 7509, currency: 'USD' });17 const fx = loadFixture('mpb', 'medium-format');18 const out = await connector.normalize(fx.raw);19 expect(out.length).toBeGreaterThan(0);20 for (const r of out) {21 if (r.kind !== 'listing') throw new Error('expected listing');22 expect(r.attributes.categorySlug).toBe('cameras');23 expect(r.attributes.identifiers.mpb_model).toBeTruthy();24 expect(r.price).toBeGreaterThan(0);25 expect(r.currency).toBe('USD');26 expect(r.seller).toBe('MPB');27 }28 });29});30