Skip to content

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.

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.tsx
Vitest src/features/rent-payments/rent-payments.server.test.ts
An invalid amount is refused Vitest src/features/rent-payments/schemas.test.ts
Playwright 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

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.tsx
Vitest src/features/deposits/deposits.server.test.ts
A member can’t delete a payment Vitest src/features/rent-payments/rent-payments.server.test.ts

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

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

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

Playwright: e2e/rent-payments.spec.ts

Scenario Tests
The month’s payments Vitest src/features/rent-payments/RentMonthPage.test.tsx
Playwright e2e/rent-payments.spec.ts
A member sees the payments but can’t change them Vitest src/features/rent-payments/RentMonthPage.test.tsx
Playwright e2e/rent-payments.spec.ts
The breakdown of the rent and the fees Vitest src/features/rent-payments/RentMonthPage.test.tsx
Playwright e2e/rent-payments.spec.ts
The rent and the fees as one payment Vitest src/features/rent-payments/RentMonthPage.test.tsx
Playwright e2e/rent-payments.spec.ts

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

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

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.ts
Playwright 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

Playwright: e2e/flats-rent.spec.ts

Scenario Tests
A late month shows on the card Vitest src/features/rent-payments/CardRentChip.test.tsx
Playwright 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