feat: expose pricing quality controls
Quality / test (push) Canceled after 0s

Add admin stale/outlier indicators and audited manual valuation overrides, with robust submission behavior and authenticated E2E coverage.
This commit is contained in:
2026-09-09 01:28:17 -04:00
parent 75c0e89511
commit 7aa8e9eaf2
4 changed files with 53 additions and 6 deletions
@@ -46,8 +46,20 @@ test('signs in and publishes a listing after adding an inventory image', async (
await page.locator('#pricing-inventory').selectOption(createdInventoryId);
await page.getByLabel('Source identifier').fill('browser-price-1');
await page.getByLabel('Observed price (cents)').fill('2500');
await page.getByRole('button', { name: 'Add observation and calculate' }).click();
await expect(page.getByRole('list', { name: 'Market valuations' })).toContainText('Market value $25.00');
const [observationResponse, valuationResponse] = await Promise.all([
page.waitForResponse((response) => response.url().includes('/admin/pricing/observations')),
page.waitForResponse((response) => response.url().includes('/valuation') && response.request().method() === 'POST'),
page.getByRole('button', { name: 'Add observation and calculate' }).click(),
]);
expect(observationResponse.status()).toBe(201);
expect(valuationResponse.status()).toBe(200);
const valuationRow = page.getByRole('list', { name: 'Market valuations' }).getByText(createdInventoryId);
await expect(valuationRow).toContainText('Market value $25.00');
await page.getByLabel('Manual value (cents)').fill('2700');
await page.getByLabel('Override reason').fill('Verified recent sale');
await page.getByRole('button', { name: 'Save manual value' }).click();
await expect(page.getByRole('list', { name: 'Market valuations' })).toContainText('Market value $27.00');
await expect(page.getByRole('list', { name: 'Market valuations' })).toContainText('OVERRIDE confidence');
await inventoryLink.click();
await expect(page).toHaveURL(/\/admin\/inventory\/[^/]+\/images$/);
await expect(page.getByRole('heading', { name: 'Manage images' })).toBeVisible();