Skip to content

567 — Should create two rows, add time records, mirror in calendar, then delete one row

Description

Verifies the round-trip between timesheet and calendar: entering hours into a timesheet day-cell creates a calendar event with the matching client/project/duration, and deleting a timesheet row also removes its calendar events.

Preconditions

  • Signed-in user on a fresh organization.
  • One seeded client, one seeded project, at least two seeded tasks.
  • Timesheet is open on the current week.

Steps

  1. Add row 1 with Client + Project + Billable. Expected: total rows = 1.
  2. Add row 2 with Client + Project + Task + Billable. Expected: total rows = 2; the column totals and each row's total are still zero.
  3. Click Tuesday in row 1 and enter 8 hours. Expected: "Updated" toast appears.
  4. Click Wednesday in row 2 and enter 6 hours 40 minutes. Expected: "Updated" toast appears; the column totals and each row's total now reflect the entered durations.
  5. Switch to Calendar and choose the Week view. Expected: 2 calendar events for the week — one 08:00 Client + Project event and one 06:40 Client + Project + Task event, both billable.
  6. Switch back to Timesheet and delete row 2 (the row with the task). Confirm the deletion. Expected: "Deleted" toast and total rows = 1.
  7. Switch to Calendar / Week view again. Expected: only 1 calendar event remains — the 08:00 Client + Project event; the 06:40 event is gone.
  • Spec: playwright/tests/integration/timesheet.spec.ts (line 359)