Skip to content

147 — Create protocol of each variant generates unique code and grid row

Description

For every ProtocolVariant (WORK_HANDOVER, CONSTRUCTION_SITE, COMPLETED_WORK_LIST, DOCUMENTATION, TRAINING, RETAINAGE_REQUEST_SHORT_TERM, RETAINAGE_REQUEST_LONG_TERM), creating a protocol through the create modal generates a unique code with the variant's prefix and shows a row in the flat grid bound to the chosen received order, with the correct type chip and the IN_PROCESS state chip. Parametrized — one test per variant.

Preconditions

  • Clean database (TestControl.cleanDb())
  • User logged in with ADMIN and ACCOUNTING roles
  • Customer, contract and a received order created via API

Steps

  1. Navigate to /protocols and click "Přidat protokol" — Expected: "Vyberte objednávku" dialog opens
  2. Select the received order and click "Vybrat" — Expected: "Vyberte typ protokolu" dialog opens
  3. Click "Nový" (new-protocol-{VARIANT}), fill the issued date (+ item price for COMPLETED_WORK_LIST) and save — Expected: navigates to the protocol detail page
  4. Return to /protocolsExpected: exactly one grid row
  5. Assert the row — Expected: code matches ^{PREFIX}\d{8}$, type chip protocol-type-chip-{VARIANT}, state chip protocol-state-chip-IN_PROCESS, received-order cell shows the order code
  • Spec: tests/e2e/tests/protocols.spec.ts
  • Code prefixes: WORK_HANDOVER=PPD, CONSTRUCTION_SITE=ZPS, COMPLETED_WORK_LIST=SPP, DOCUMENTATION=ZPD, TRAINING=PZO, RETAINAGE_REQUEST_SHORT_TERM=ZKZ, RETAINAGE_REQUEST_LONG_TERM=ZDZ