Skip to content

381 — should check when user have client Invoice ultimate permission

Description

Verifies that an employee with the "Invoice ultimate" client role (scoped to a single client) can fully edit that client's invoices with all row actions enabled, but does not gain the Finance settings tab.

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 2 invoices each (4 total) plus the standard Finance seed.

Steps

  1. As the owner, go to Roles → Client roles, add a client role with the test title, toggle "Invoice ultimate" on, then save. Expected: the new role exists.
  2. Add the employee to the first client with this 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 only the employee's own additional item is listed (1 row).
  4. Open Settings. Expected: the Settings tabs are "Teams", "Time Tracking", "Quick filters", "Personal" (no Finance — client-scoped invoice ultimate doesn't grant global Finance settings).
  5. Navigate to Finance → Invoices. Expected: the Finance area shows only "Billing statements" and "Invoices" tabs and only the 2 invoices for the first client are visible.
  6. Inspect the row actions. Expected: the row-action button is visible on both invoices (2 of 2).
  7. Open invoice YYYY-0001. Expected: the invoice detail opens in fully editable state.
  • Spec: playwright/tests/integration/permissions.spec.ts (line 606)