24 lines
837 B
JavaScript
24 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();
|
||
|
|
});
|
||
|
|
});
|