feat: add public listing detail web flow

This commit is contained in:
2026-09-08 19:40:11 -04:00
parent 3d17637711
commit fd6d4cf37b
10 changed files with 128 additions and 16 deletions
+14 -2
View File
@@ -1,6 +1,18 @@
import assert from 'node:assert/strict';
import test from 'node:test';
test('web workspace exposes a catalog test entrypoint', () => {
assert.ok(true);
import { getPublicListing } from '../src/services/catalog-service.js';
test('fetches a public listing detail through the API service', async () => {
const originalFetch = globalThis.fetch;
globalThis.fetch = async (url) => {
assert.equal(url, 'http://localhost:3000/api/v1/public/listings/listing-1');
return { ok: true, async json() { return { data: { id: 'listing-1' } }; } };
};
try {
assert.deepEqual(await getPublicListing('listing-1'), { id: 'listing-1' });
} finally {
globalThis.fetch = originalFetch;
}
});