deckhearth/test/lib/pricing/outbound-links.test.js
Randall Stillwell d0468015eb
Some checks failed
CI / Lint (pull_request) Has been cancelled
CI / Schema map up to date (pull_request) Has been cancelled
CI / Forbidden patterns (9 checks) (pull_request) Has been cancelled
CI / Migrations apply (node-pg-migrate) (pull_request) Has been cancelled
Visual diff / Should run? (pull_request) Has been cancelled
CI / Unit tests (vitest) (pull_request) Has been cancelled
Convoy metrics gate / Require role-event telemetry on convoy PRs (pull_request) Has been cancelled
PR Health rollup / Aggregate gate status (pull_request) Has been cancelled
Preview smoke / Should run? (pull_request) Has been cancelled
Preview smoke / Playwright smoke (pull_request) Has been cancelled
Visual diff / Screenshot diff (pull_request) Has been cancelled
feat(pricing): convoy for online prices and local stores
Add pricing schema, free API integrations (MTG bulk, TCGdex, Foolio),
valuation and sort-by-price, card detail pricing UI, and nearby store
discovery via home zip and OSM geo clients.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-08 22:47:46 -05:00

23 lines
837 B
JavaScript

import { describe, expect, it } from 'vitest';
import { buildEbayUrl, buildOutboundLinks, buildTcgplayerUrl } from '../../../lib/pricing/outbound-links.js';
describe('outbound-links', () => {
const card = { name: 'Lightning Bolt', game: 'MTG', set_name: 'Alpha' };
it('builds tcgplayer search url', () => {
expect(buildTcgplayerUrl(card)).toContain('tcgplayer.com');
expect(buildTcgplayerUrl(card)).toContain(encodeURIComponent('Lightning Bolt'));
});
it('builds ebay search url', () => {
expect(buildEbayUrl(card)).toContain('ebay.com');
expect(buildEbayUrl(card)).toContain(encodeURIComponent('Lightning Bolt Alpha MTG'));
});
it('returns both outbound links', () => {
const links = buildOutboundLinks(card);
expect(links.tcgplayer).toBeTruthy();
expect(links.ebay).toBeTruthy();
});
});