feat: add shareable catalog pagination

This commit is contained in:
2026-09-08 19:54:56 -04:00
parent fd6d4cf37b
commit 7e5ca1448f
6 changed files with 76 additions and 8 deletions
+15
View File
@@ -15,4 +15,19 @@ test('fetches a public listing detail through the API service', async () => {
} finally {
globalThis.fetch = originalFetch;
}
});
test('encodes catalog search pagination in the API request', async () => {
const originalFetch = globalThis.fetch;
globalThis.fetch = async (url) => {
assert.equal(url, 'http://localhost:3000/api/v1/public/search?query=card+set&page=3&limit=20');
return { ok: true, async json() { return { data: { items: [], pagination: {} } }; } };
};
try {
const { searchCatalog } = await import('../src/services/catalog-service.js');
await searchCatalog({ query: 'card set', page: 3 });
} finally {
globalThis.fetch = originalFetch;
}
});