This commit is contained in:
@@ -171,4 +171,19 @@ test('creates an admin saved view through the CSRF-protected API', async () => {
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
}
|
||||
});
|
||||
|
||||
test('lists seller-scoped latest market valuations', async () => {
|
||||
const originalFetch = globalThis.fetch;
|
||||
globalThis.fetch = async (url) => {
|
||||
assert.equal(url, '/api/v1/admin/valuations');
|
||||
return { ok: true, async json() { return { data: [{ id: 'valuation-1', inventoryItemId: 'item-1', valueMinor: 2500 }] }; } };
|
||||
};
|
||||
|
||||
try {
|
||||
const { listAdminValuations } = await import('../src/services/admin-pricing-service.js');
|
||||
assert.deepEqual(await listAdminValuations(), [{ id: 'valuation-1', inventoryItemId: 'item-1', valueMinor: 2500 }]);
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user