Skip to content

378 — should check when user have Hourly rate ultimate permission

Description

Verifies that an employee with the "Hourly rate ultimate" (billable) user role gains the "Hourly rates" finance tab where they can edit all rates, and starts seeing rate/price values on time records.

Preconditions

  • A signed-in owner who will create the role, plus an invited employee who will receive it.
  • Seed data: bank account, two clients, expenses (owner + employee), four billable (hourly) rates, expense templates, plus one project/task/time record per client. The employee's seeded time record uses rate 100.

Steps

  1. As the owner, go to Roles → User roles, add a user role with the test title, toggle "Hourly rate ultimate" (billable ultimate) on, then save. Expected: the new role appears in the user roles list.
  2. Assign the role to the invited employee via API and reset the session.
  3. Sign in as the employee and open Additional Items. Expected: the page shows "Additional items", "Flat rates", "Templates" tabs and the Finance area shows "Hourly rates", "Billing statements", "Invoices" tabs. Only the employee's own additional item is listed (1 row).
  4. Navigate to Finance → Invoices. Expected: the invoice list is empty (Hourly rate ultimate alone doesn't grant invoice access).
  5. Open Finance → Hourly rates. Expected: all 4 seeded hourly rates are visible.
  6. Click Edit on the owner's hourly rate, set a new random rate value and save. Expected: an "Updated" confirmation popup appears and the rate row reflects the new value.
  7. Navigate to Time tracking → Time entries and open the first time record. Expected: the modal opens for the employee, and the hourly Rate and Price fields are now visible, both showing 100.
  • Spec: playwright/tests/integration/permissions.spec.ts (line 473)