Skip to content

382 — should check when user have client Expense basic permission

Description

Verifies that an employee with the "Expense basic" client role (scoped to one client) can see — read-only — every expense on that client (including ones belonging to other users), 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, 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 basic" on, then save. Expected: the new role exists.
  2. Add the employee to the first client with the new 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 the owner's and the employee's expenses on that client are listed (2 rows).
  4. Open the employee's own expense. Expected: the form opens in read-only state. Press Escape to close.
  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 648)