From cd587c568b8d01f6cb39adf54458441dbea76586 Mon Sep 17 00:00:00 2001 From: OneTwo3D IMS Date: Sun, 21 Jun 2026 21:54:44 +0000 Subject: [PATCH] fix(e2e): addStockAdjustment fills qty (step=1) + the new required unit-cost field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 4 allocation e2e tests (regressions, sales-fulfillment, sales-management) failed at addStockAdjustment waiting for '1 adjustment saved' that never appeared. Root cause (reproduced against an isolated e2e DB): a unit-cost number field was added to the bulk-adjustment dialog, so the helper's input[type=number].last() now filled UNIT COST instead of qty — leaving qty empty ('Enter a non-zero quantity'), so the save never persisted (stock_movements stayed 0). Target the qty field specifically (step=1) and supply the now-required unit cost for the positive new-product line. Not a production bug: the stock adjustment flow works; the helper selector was stale. Verified all 4 previously-failing specs pass locally against an isolated ims_e2e DB. Co-Authored-By: Claude Opus 4.8 (1M context) --- e2e/helpers.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/e2e/helpers.ts b/e2e/helpers.ts index 910c0955..e638a10c 100644 --- a/e2e/helpers.ts +++ b/e2e/helpers.ts @@ -127,7 +127,11 @@ export async function addStockAdjustment(page: Page, sku: string, qty: number, w } } } - await dialog.locator('input[type="number"]').last().fill(String(qty)) + // The qty field is step="1"; a separate required unit-cost field (step="any", + // title "Unit cost…") was added later, so target qty specifically rather than the + // last number input, and supply a unit cost for the positive new-product line. + await dialog.locator('input[type="number"][step="1"]').last().fill(String(qty)) + await dialog.locator('input[title^="Unit cost"]').last().fill('10') await dialog.getByRole('button', { name: /save adjustments/i }).click() await dialog.getByText(/1 adjustment saved\./i).waitFor()