Skip to content

fix(e2e): addStockAdjustment fills qty + new required unit-cost field (unblocks e2e-select)#334

Merged
OneTwo3D merged 1 commit into
developmentfrom
fix/e2e-stock-adjustment-helper-qty-selector
Jun 21, 2026
Merged

fix(e2e): addStockAdjustment fills qty + new required unit-cost field (unblocks e2e-select)#334
OneTwo3D merged 1 commit into
developmentfrom
fix/e2e-stock-adjustment-helper-qty-selector

Conversation

@OneTwo3D

Copy link
Copy Markdown
Owner

Fixes the 4 pre-existing e2e-select allocation-test failures (regressions, sales-fulfillment, sales-management) that #333 surfaced once CI migrate was unblocked.

Root cause (reproduced against an isolated e2e DB)

A unit-cost number field was added to the bulk stock-adjustment dialog. The e2e helper addStockAdjustment filled input[type=number].last(), which now targets unit cost instead of qty — leaving qty empty (Enter a non-zero quantity), so the save never persisted (stock_movements stayed 0) and the '1 adjustment saved' confirmation never appeared. Not a production bug — the stock-adjustment flow works; the helper selector was stale.

Fix

Target the qty field specifically (step="1") and supply the now-required unit cost for the positive new-product line. addStockAdjustment is used by 16+ specs.

Validation

Set up an isolated ims_e2e Postgres, applied all migrations (also confirms #333's trigger fix applies cleanly on a fresh DB), and ran the 4 previously-failing specs locally — all pass. Watching CI e2e.

🤖 Generated with Claude Code

…it-cost field

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) <noreply@anthropic.com>
@OneTwo3D OneTwo3D merged commit cc2ce02 into development Jun 21, 2026
8 checks passed
@OneTwo3D OneTwo3D deleted the fix/e2e-stock-adjustment-helper-qty-selector branch June 21, 2026 22:21
OneTwo3D pushed a commit that referenced this pull request Jun 22, 2026
…, scjz.60 (PRs #334-#337)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant