637 — should update rate only when a higher-priority dimension is picked¶
Description¶
Exercises the per-pick rate progression in the new-time-record modal under priority TASK > TAGS > PROJECT > CLIENT > TEAM > USER. With one billable rate seeded per dimension (distinct values 1001–1006), picking each entity in the order Label → Client → Project → Task should only transition the Rate when the newly picked dimension outranks every dimension already in the time record:
- Label-pick transitions the rate from the on-open USER match to the Label rate (snackbar + yellow border).
- Client-pick and Project-pick keep the matched rate at Label (no transition, no warning UI).
- Task-pick transitions the rate to the Task rate (snackbar + yellow border again).
Preconditions¶
- Signed-in tenant owner with a fresh organization, owner added to the seeded team.
- Six billable rates seeded via API, one per dimension (Task=1001, Tags=1002, Project=1003, Client=1004, Team=1005, User=1006). The Task / Project / Client rates carry their parent dimensions per the UI's auto-fill (Task → Project → Client; Project → Client).
- Automatic Prefill (Time tracking → Personal) disabled for this user.
- Priority set to
TASK > TAGS > PROJECT > CLIENT > TEAM > USERviaupdateBillableRatePriority.
Steps¶
- Click the
+shortcut → Time record. Expected: the New time record modal opens. User auto-fills to the owner; no "Rate and price updated" snackbar fires on open because the form's prior rate was null. - Pick the seeded Label in the Labels combo. Expected: "Rate and price updated based on matched hourly rate" snackbar appears; Rate = 1002, Price = 1002; both inputs render with
data-input-border-color="warning"(yellow border). - Pick the seeded Client in the Client combo. Expected: Rate stays 1002, Price stays 1002. No new transition snackbar.
- Pick the seeded Project in the Project combo. Expected: Rate stays 1002, Price stays 1002.
- Pick the seeded Task in the Task combo. Expected: "Rate and price updated" snackbar reappears; Rate = 1001, Price = 1001; warning border returns.
- Click Create to save the record (so the modal closes cleanly). Expected: "Created" snackbar.
- Navigate to Finance Settings → Hourly rates, open the Change priority dialog, drag the items to the order
PROJECT > TASK > TAGS > CLIENT > TEAM > USER, and Save. Expected: "Updated" snackbar; dialog closes;billableRatePriorityquery reflects the dragged order. - Open the
+→ Time record modal again. Pick Client. Expected: "Rate and price updated" snackbar; Rate = 1004 (Client rate); warning border on Rate & Price. - Pick Label. Expected: snackbar; Rate = 1002 (Label rate); warning border.
- Pick Project. Expected: snackbar; Rate = 1003 (Project rate); warning border.
- Pick Task. Expected: Rate stays 1003 — PROJECT still outranks TASK, so no transition snackbar or yellow border re-appears.
Related¶
- Spec:
playwright/tests/integration/hourlyRate.spec.ts - GraphQL:
matchingBillableRate,updateBillableRatePriority,createBillableRate,patchTimeTrackingUserSettings - UI testids:
timeRecordFormRateValueInput,timeRecordFormPriceValueInput,data-input-border-coloronInputBorder