Skip to content

Commit cc2ce02

Browse files
OneTwo3DOneTwo3D IMSclaude
authored
fix(e2e): addStockAdjustment fills qty (step=1) + the new required unit-cost field (#334)
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: OneTwo3D IMS <dev@onetwo3d.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6f50d8b commit cc2ce02

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎e2e/helpers.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ export async function addStockAdjustment(page: Page, sku: string, qty: number, w
127127
}
128128
}
129129
}
130-
await dialog.locator('input[type="number"]').last().fill(String(qty))
130+
// The qty field is step="1"; a separate required unit-cost field (step="any",
131+
// title "Unit cost…") was added later, so target qty specifically rather than the
132+
// last number input, and supply a unit cost for the positive new-product line.
133+
await dialog.locator('input[type="number"][step="1"]').last().fill(String(qty))
134+
await dialog.locator('input[title^="Unit cost"]').last().fill('10')
131135
await dialog.getByRole('button', { name: /save adjustments/i }).click()
132136

133137
await dialog.getByText(/1 adjustment saved\./i).waitFor()

0 commit comments

Comments
 (0)