Skip to content

deposits

8 requirements and 37 scenarios in openspec/specs/deposits/spec.md. A scenario’s test is test('<scenario>') inside describe('<requirement>'), in Vitest or Playwright.

Playwright: e2e/deposits.spec.ts

Scenario Tests
Adding a tenant with a deposit Vitest src/features/tenancies/tenancy-deposit.server.test.ts
Playwright e2e/deposits.spec.ts
A tenancy without a deposit Vitest src/features/tenancies/tenancy-deposit.server.test.ts
Playwright e2e/deposits.spec.ts
A deposit over three months’ rent is warned about Vitest src/features/tenancies/TenancyForm.test.tsx
Playwright e2e/deposits.spec.ts
An invalid deposit is refused Vitest src/features/tenancies/TenancyForm.test.tsx
Vitest src/features/tenancies/schemas.test.ts
Playwright e2e/deposits.spec.ts
Correcting the deposit Vitest src/features/tenancies/tenancy-deposit.server.test.ts
Playwright e2e/deposits.spec.ts
A member can’t set a deposit Vitest src/features/tenancies/tenancy-deposit.server.test.ts

Playwright: e2e/deposits.spec.ts

Scenario Tests
The deposit card of the current tenancy Vitest src/features/tenancies/TenancyPage.test.tsx
Playwright e2e/deposits.spec.ts
An ended tenancy’s deposit status Vitest src/features/tenancies/TenancyPage.test.tsx
A member sees the deposit but can’t change it Vitest src/features/tenancies/TenancyPage.test.tsx
Playwright e2e/deposits.spec.ts

Playwright: e2e/deposits.spec.ts

Scenario Tests
Returning a deposit in full Vitest src/features/deposits/DepositReturnForm.test.tsx
Vitest src/features/deposits/deposits.server.test.ts
Playwright e2e/deposits.spec.ts
Returning with deductions Vitest src/features/deposits/DepositReturnForm.test.tsx
Vitest src/features/deposits/deposits.server.test.ts
Playwright e2e/deposits.spec.ts
Deductions can’t exceed the deposit Vitest src/features/deposits/deposits.server.test.ts
Vitest src/features/deposits/deposit.test.ts
Deductions need an amount Vitest src/features/deposits/deposits.server.test.ts
Vitest src/features/deposits/deposit.test.ts
A return before the last rent day is refused Vitest src/features/deposits/deposits.server.test.ts
Vitest src/features/deposits/deposit.test.ts
A return date in the future is refused Vitest src/features/deposits/deposits.server.test.ts
Vitest src/features/deposits/deposit.test.ts
Playwright e2e/deposits.spec.ts
A tenancy without a deposit has no return Vitest src/features/deposits/deposits.server.test.ts
Vitest src/features/deposits/deposit.test.ts
A second return is refused Vitest src/features/deposits/deposits.server.test.ts
Vitest src/features/deposits/deposit.test.ts
A member can’t record a return Vitest src/features/deposits/deposits.server.test.ts
Playwright e2e/deposits.spec.ts

No Playwright test: the allocation is a pure calculation, and its effect in the browser is shown by “Recording a deposit return”’s Playwright test, where the month the rent kept covers turns paid.

Scenario Tests
The rent kept pays the missing month Vitest src/features/deposits/deposits.server.test.ts
Vitest src/features/deposits/deposit.test.ts
Playwright e2e/deposits.spec.ts
The rent kept covers the oldest months first Vitest src/features/deposits/deposits.server.test.ts
Vitest src/features/deposits/deposit.test.ts
The rent kept can’t exceed the rent missing Vitest src/features/deposits/deposits.server.test.ts
Vitest src/features/deposits/deposit.test.ts
The rent kept counts in the year of the return Vitest src/features/year-summary/year-summary.server.test.ts
Vitest src/features/year-summary/summary.test.ts

Playwright: e2e/deposits.spec.ts

Scenario Tests
Correcting the amount kept for damage Vitest src/features/deposits/deposits.server.test.ts
Playwright e2e/deposits.spec.ts
Correcting the rent kept replaces its payments Vitest src/features/deposits/deposits.server.test.ts
Deleting a return removes its payments Vitest src/features/deposits/deposits.server.test.ts
Playwright e2e/deposits.spec.ts
Opening the return from the correction form Playwright e2e/deposits.spec.ts
The deposit can’t go below the amounts kept Vitest src/features/tenancies/tenancy-deposit.server.test.ts
A member can’t delete a return Vitest src/features/deposits/deposits.server.test.ts

Playwright: e2e/deposits.spec.ts

Scenario Tests
The reminder after the last rent day Vitest src/features/tenancies/TenancyPage.test.tsx
Vitest src/features/deposits/deposit.test.ts
Playwright e2e/deposits.spec.ts
No reminder before the last rent day Vitest src/features/tenancies/TenancyPage.test.tsx
Vitest src/features/deposits/deposit.test.ts
Playwright e2e/deposits.spec.ts
The reminder stays while a new tenant lives in the flat Vitest src/features/tenancies/TenancyPage.test.tsx
A tenancy without a deposit has no reminder Vitest src/features/tenancies/TenancyPage.test.tsx
Vitest src/features/deposits/deposit.test.ts

Playwright: e2e/deposits.spec.ts

Scenario Tests
The end form shows the deposit Vitest src/features/tenancies/EndTenancyForm.test.tsx
Playwright e2e/deposits.spec.ts
No deposit, no deposit section Vitest src/features/tenancies/EndTenancyForm.test.tsx
Playwright e2e/deposits.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
Cancelling the ending of a returned tenancy is refused Vitest src/features/tenancies/tenancy-deposit.server.test.ts
Moving a fixed term’s end past the return is refused Vitest src/features/tenancies/tenancy-deposit.server.test.ts
Deleting a flat removes its deposit returns Vitest src/features/deposits/deposit-return.repository.server.test.ts