Skip to content

383 — should check when user have client Expense ultimate permission

Description

Verifies that an employee with the "Expense ultimate" client role (scoped to one client) can edit any expense for that client — including the owner's — but invoices remain hidden.

Preconditions

  • A signed-in owner who will create the client role, plus an invited employee who will be added as a member of the first client with that role.
  • Seed data: two clients with expenses for both owner and employee on the first client.

Steps

  1. As the owner, go to Roles → Client roles, add a client role with the test title, toggle "Expense ultimate" on, then save. Expected: the new role exists.
  2. Add the employee to the first client with that role via API. Expected: the member is added with the matching role id.
  3. Reset the session and sign in as the employee. Open Additional Items. Expected: "Additional items", "Flat rates", "Templates" tabs are shown and both expenses (owner's + employee's) for the first client are visible (2 rows).
  4. Click Edit on the owner's expense, rename it to "Test", and save. Expected: an "Updated" confirmation popup appears and the renamed item is shown — proving cross-user edit within the client scope.
  5. Navigate to Finance → Invoices. Expected: the Finance area shows only "Billing statements" and "Invoices" tabs and the invoice list is empty.
  • Spec: playwright/tests/integration/permissions.spec.ts (line 691)