TypeScript 61.9%
HTML 37.2%
SQL 0.7%
1import { describe, expect, it } from 'vitest';2import { ConnectorMetaSchema } from '@rareindex/connectors';3import { listFixtures, loadFixture, runFixtureSuite } from '@rareindex/connectors/testing';4import metaJson from './meta.json' with { type: 'json' };5import createConnector from './index.js';6import { parseGoauctionCalendar } from '../_g8-auctions-eu-apac-lib/goauction-platform.js';78const meta = ConnectorMetaSchema.parse(metaJson);9const connector = createConnector(meta);1011const CAL = `<div class="auction-calendar-item calendar-third "> <a href='https://chiswickauctions.co.uk/auction/details/4sept26-affordable-jewellery-watches-silver--coins---timed-online?au=1385'target='blank'> <div class="auction-calendar-image" style="background-image: url("x");"> </div> </a> <div class="auction-calendar-text "> <a href='https://chiswickauctions.co.uk/auction/details/4sept26-affordable-jewellery-watches-silver--coins---timed-online?au=1385'target='blank'> <H6>Affordable Jewellery, Watches, Silver & Coins - Timed Online</H6> </a> <div><h5>Friday 4 September 2026</h5></div></div></div>`;1213describe('chiswick-auctions', () => {14 runFixtureSuite(connector, it, expect);1516 it('fixtures: GBP results from the goauction grid', async () => {17 let sales = 0;18 for (const name of listFixtures('chiswick-auctions')) {19 for (const r of await connector.normalize(loadFixture('chiswick-auctions', name).raw)) {20 if (!('attributes' in r)) continue;21 expect(r.attributes.identifiers.chiswick_lot).toMatch(/^\d+\/\S+$/);22 if (r.kind === 'sale') {23 sales++;24 expect(r.currency).toBe('GBP');25 expect(r.auctionHouse).toBe('Chiswick Auctions');26 expect(r.buyerPremiumIncluded).toBeNull();27 }28 }29 }30 expect(sales).toBeGreaterThan(10);31 });3233 it('parses the calendar with absolute (non-www) links and H6 titles', () => {34 const sales = parseGoauctionCalendar(CAL, { base: 'https://www.chiswickauctions.co.uk', currency: 'GBP', listStyle: 'details' });35 expect(sales).toHaveLength(1);36 expect(sales[0]).toMatchObject({ id: '1385', title: 'Affordable Jewellery, Watches, Silver & Coins - Timed Online', date: '2026-09-04T00:00:00.000Z', url: 'https://chiswickauctions.co.uk/auction/details/4sept26-affordable-jewellery-watches-silver--coins---timed-online?au=1385' });37 });38});39