Add admin stale/outlier indicators and audited manual valuation overrides, with robust submission behavior and authenticated E2E coverage.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user