Skip to content

582 — should fill only ${flow.label} and assert rest of expanded fields

Description

Parameterized scenario that verifies each individually creatable section of the user form (work capacity; cost rate + commission; contract details) saves correctly, leaves only the relevant accordions expanded on reopen, collapses cleanly when removed, and resets to empty defaults when re-added. One test run per flow label.

Preconditions

  • Signed-in admin on a freshly seeded organization.
  • The Users page is open.

Steps

  1. Click "Add user" and switch the modal to the detailed view; enter the new user's email.
  2. Fill ONLY the fields for the flow under test:
    • "work capacity" flow: expand "Add work capacity" and fill value, hours-per unit, and productivity coefficient.
    • "cost rate and commission" flow: expand "Add cost rate" and fill the value; expand "Add commission" and fill the value.
    • "contract details" flow: expand "Add contract details", pick a contract type, then choose a contract expiry date three days in the future.
  3. Click Create. Expected: a "user created" popup is shown.
  4. Reload the Users page and double-click the new user to open the detail page. Expected: the email shown matches what was entered.
  5. Expected: only the section(s) filled in step 2 are expanded; all other creatable accordions (work capacity, cost rate, commission, contract details) are collapsed. For the "cost rate and commission" flow both Cost rate AND Commission are expanded.
  6. Expected: the saved values inside the expanded section(s) match exactly what was entered (capacity value/unit/coefficient, or cost-rate + commission values, or contract type + expiry date).
  7. Click the section's "Remove" button(s) (Remove work capacity / Remove cost rate + Remove commission / Remove contract details), click Save, and reload. Expected: an "updated" confirmation popup appears and after reload all four creatable accordions are collapsed.
  8. Re-expand the same section(s) again via the "Add" button. Expected: all fields are empty (value/coefficient blank, unit selector reads "Select", contract type/expiry blank).
  • Spec: playwright/tests/integration/user.spec.ts (line 272)