rent-payments
10 requirements and 56 scenarios in openspec/specs/rent-payments/spec.md. A scenario’s test is test('<scenario>') inside describe('<requirement>'), in Vitest or Playwright.
Recording a rent payment
Section titled “Recording a rent payment”Playwright: e2e/flat-details.spec.ts, e2e/rent-payments.spec.ts
| Scenario | Tests |
|---|---|
| Recording this month’s rent from the details page | Playwright e2e/flat-details.spec.ts |
| A smaller amount leaves the month partly paid | Playwright e2e/flat-details.spec.ts |
| A second payment defaults to the missing amount | Playwright e2e/rent-payments.spec.ts |
| A payment date in the future is refused | Vitest src/features/rent-payments/RentMonthPage.test.tsxVitest src/features/rent-payments/rent-payments.server.test.ts |
| An invalid amount is refused | Vitest src/features/rent-payments/schemas.test.tsPlaywright e2e/rent-payments.spec.ts |
| A month outside the tenancy is refused | Vitest src/features/rent-payments/rent-payments.server.test.ts |
| A member can’t record a payment | Vitest src/features/rent-payments/rent-payments.server.test.ts |
Deleting a rent payment
Section titled “Deleting a rent payment”Playwright: e2e/rent-payments.spec.ts
| Scenario | Tests |
|---|---|
| Deleting a wrongly recorded payment | Playwright e2e/rent-payments.spec.ts |
| A payment from the deposit can’t be deleted on its own | Vitest src/features/rent-payments/RentMonthPage.test.tsxVitest src/features/deposits/deposits.server.test.ts |
| A member can’t delete a payment | Vitest src/features/rent-payments/rent-payments.server.test.ts |
Expected rent of a month
Section titled “Expected rent of a month”No Playwright test: a pure calculation from the tenancy’s rent, fee and occupants periods and dates; Vitest covers it, and the details page and the month’s payments page show it in the browser tests of “The flat details page” and “The month’s rent payments page”.
| Scenario | Tests |
|---|---|
| A full month | Vitest src/features/rent-payments/status.test.ts |
| A tenancy starting mid-month | Vitest src/features/rent-payments/status.test.ts |
| A tenancy ending mid-month | Vitest src/features/rent-payments/status.test.ts |
| A rent change during the tenancy | Vitest src/features/rent-payments/status.test.ts |
| A tenant change with a new rent mid-month | Vitest src/features/rent-payments/status.test.ts |
| No rent set | Vitest src/features/rent-payments/status.test.ts |
| The rent with the tenant fees | Vitest src/features/rent-payments/status.test.ts |
| Fees by days in a partial month | Vitest src/features/rent-payments/status.test.ts |
| Fees without a rent | Vitest src/features/rent-payments/status.test.ts |
The rent status of a month
Section titled “The rent status of a month”No Playwright test: a pure calculation from the expected rent, the payments and the day; Vitest covers it, and the details page shows the statuses in the browser tests of “The flat details page”.
| Scenario | Tests |
|---|---|
| Due until the due date | Vitest src/features/rent-payments/status.test.ts |
| Late from the day after the due date | Vitest src/features/rent-payments/status.test.ts |
| Partly paid | Vitest src/features/rent-payments/status.test.ts |
| Paid in two payments | Vitest src/features/rent-payments/status.test.ts |
| Paid more than expected | Vitest src/features/rent-payments/status.test.ts |
| A rent of 0 € is never late | Vitest src/features/rent-payments/status.test.ts |
| The due date in the first month is no earlier than the start | Vitest src/features/rent-payments/status.test.ts |
| The due day in a shorter month | Vitest src/features/rent-payments/status.test.ts |
Months not fully paid
Section titled “Months not fully paid”No Playwright test: a pure selection of months by their status; Vitest covers it, and the warnings are shown in the browser tests of “The flat details page” and “The rent payments page”.
| Scenario | Tests |
|---|---|
| Earlier months of this and last year count | Vitest src/features/rent-payments/status.test.ts |
| Months two years back don’t count | Vitest src/features/rent-payments/status.test.ts |
| An earlier tenancy’s month is warned about on the details page | Vitest src/features/properties/FlatDetailsPage.test.tsx |
| The warning opens the year of the newest month | Vitest src/features/properties/FlatDetailsPage.test.tsx |
| A month before its due date doesn’t count | Vitest src/features/rent-payments/status.test.ts |
The month’s rent payments page
Section titled “The month’s rent payments page”Playwright: e2e/rent-payments.spec.ts
| Scenario | Tests |
|---|---|
| The month’s payments | Vitest src/features/rent-payments/RentMonthPage.test.tsxPlaywright e2e/rent-payments.spec.ts |
| A member sees the payments but can’t change them | Vitest src/features/rent-payments/RentMonthPage.test.tsxPlaywright e2e/rent-payments.spec.ts |
| The breakdown of the rent and the fees | Vitest src/features/rent-payments/RentMonthPage.test.tsxPlaywright e2e/rent-payments.spec.ts |
| The rent and the fees as one payment | Vitest src/features/rent-payments/RentMonthPage.test.tsxPlaywright e2e/rent-payments.spec.ts |
The rent payments page
Section titled “The rent payments page”Playwright: e2e/rent-payments.spec.ts
| Scenario | Tests |
|---|---|
| Months newest first with their statuses | Playwright e2e/rent-payments.spec.ts |
| Rent is received in the year it is paid | Playwright e2e/rent-payments.spec.ts |
| Rent paid in advance before the tenancy | Vitest src/features/rent-payments/RentPaymentsPage.test.tsx |
| Two tenancies in the same month | Playwright e2e/rent-payments.spec.ts |
| A flat without tenancies | Playwright e2e/rent-payments.spec.ts |
Payments stay inside their tenancy
Section titled “Payments stay inside their tenancy”No Playwright test: server-side checks with the same forms and reason display as the tenancy forms’ browser tests; Vitest covers them.
| Scenario | Tests |
|---|---|
| Ending before a paid month is refused | Vitest src/features/tenancies/tenancies.server.test.ts |
| Correcting the start past a paid month is refused | Vitest src/features/tenancies/tenancies.server.test.ts |
| Moving the start within the paid month is allowed | Vitest src/features/tenancies/tenancies.server.test.ts |
| Removing a tenancy with payments is refused | Vitest src/features/tenancies/tenancies.server.test.ts |
The rent summary on the flats list
Section titled “The rent summary on the flats list”Playwright: e2e/flats-rent.spec.ts
| Scenario | Tests |
|---|---|
| The summary adds up this month’s rent of every flat | Vitest src/features/rent-payments/status.test.tsPlaywright e2e/flats-rent.spec.ts |
| A shared flat counts with its whole rent | Vitest src/features/rent-payments/status.test.ts |
| A tenancy that starts mid-month counts by days | Vitest src/features/rent-payments/status.test.ts |
| Both tenancies of a mid-month change count | Vitest src/features/rent-payments/status.test.ts |
| A payment for a month without rent is left out | Vitest src/features/rent-payments/status.test.ts |
| No summary without rent this month | Vitest src/features/rent-payments/status.test.ts |
| An archived flat is left out of the summary | Vitest src/features/rent-payments/rent-payments.server.test.ts |
The rent status on a flat’s card
Section titled “The rent status on a flat’s card”Playwright: e2e/flats-rent.spec.ts
| Scenario | Tests |
|---|---|
| A late month shows on the card | Vitest src/features/rent-payments/CardRentChip.test.tsxPlaywright e2e/flats-rent.spec.ts |
| The card shows paid, partly paid and due | Vitest src/features/rent-payments/CardRentChip.test.tsx |
| A card without a rent set | Vitest src/features/rent-payments/CardRentChip.test.tsx |
| A vacant flat has no rent status | Vitest src/features/rent-payments/CardRentChip.test.tsx |