Skip to content

110 — Restock, withdraw, restock again, then edit movement price

Description

Multiple restocks and withdrawals; editing the second restock to unit 250 updates the row and keeps the first restock at 150. Tests weighted-average recalculation.

Preconditions

  • Clean database
  • User logged in with ADMIN and WAREHOUSEMAN roles
  • Three storage categories pre-created (Nářadí, Materiál, Ochranné pomůcky)
  • Storage items and contract pre-created via API (per scenario)

Steps

  1. Restock 10 @ 150, withdraw 3, restock 5 @ 150 — Expected: Three movements
  2. Edit second restock to unit 250 — Expected: Row shows 250 @ qty 5 = 1 250
  3. First restock unchanged at 150 — Expected: Still 1 500
  4. Withdraw 2 more — Expected: Uses weighted average; 2 withdrawal rows total
  • Spec: tests/e2e/tests/storage.spec.ts