transactions
10 requirements and 42 scenarios in openspec/specs/transactions/spec.md. A scenario’s test is test('<scenario>') inside describe('<requirement>'), in Vitest or Playwright.
Logging an entry
Section titled “Logging an entry”Playwright: e2e/transactions.spec.ts
| Scenario | Tests |
|---|---|
| Logging an annual repair | Vitest src/features/transactions/transactions.server.test.tsPlaywright e2e/transactions.spec.ts |
| An invalid amount is refused | Vitest src/features/transactions/schemas.test.ts |
| A future date is refused | Vitest src/features/transactions/transactions.server.test.tsVitest src/features/transactions/rules.test.ts |
| A date before the ownership is refused | Vitest src/features/transactions/transactions.server.test.tsVitest src/features/transactions/rules.test.ts |
| A member can’t log an entry | Vitest src/features/transactions/transactions.server.test.ts |
Entry categories
Section titled “Entry categories”Playwright: e2e/transactions.spec.ts
| Scenario | Tests |
|---|---|
| The chosen category shows its tax hint | Vitest src/features/transactions/TransactionForm.test.tsxPlaywright e2e/transactions.spec.ts |
| An improvement is not deducted all at once | Vitest src/features/transactions/TransactionForm.test.tsx |
| Rent is not a category | Vitest src/features/transactions/TransactionForm.test.tsx |
| A category of the other type is refused | Vitest src/features/transactions/schemas.test.ts |
The entries page
Section titled “The entries page”Playwright: e2e/transactions.spec.ts
| Scenario | Tests |
|---|---|
| Opening the entries page from the details page | Playwright e2e/transactions.spec.ts |
| Entries are grouped by month, newest first | Vitest src/features/transactions/TransactionsPage.test.tsxPlaywright e2e/transactions.spec.ts |
| Choosing an earlier year | Vitest src/features/transactions/TransactionsPage.test.tsx |
| A flat without entries | Vitest src/features/transactions/TransactionsPage.test.tsxPlaywright e2e/transactions.spec.ts |
| A member sees the entries but can’t add them | Vitest src/features/transactions/TransactionsPage.test.tsx |
Entry details
Section titled “Entry details”Playwright: e2e/transactions.spec.ts
| Scenario | Tests |
|---|---|
| The details of an expense | Vitest src/features/transactions/TransactionDetails.test.tsxPlaywright e2e/transactions.spec.ts |
| An entry logged by a co-owner | Vitest src/features/transactions/TransactionDetails.test.tsx |
Attaching a receipt
Section titled “Attaching a receipt”Playwright: e2e/transactions.spec.ts
| Scenario | Tests |
|---|---|
| Logging an expense with a receipt photo | Vitest src/features/transactions/transactions.server.test.tsPlaywright e2e/transactions.spec.ts |
| A PDF receipt is stored as it is | Vitest src/features/transactions/transactions.server.test.ts |
| A file that isn’t an image or a PDF is refused | Vitest src/features/transactions/transactions.server.test.ts |
| A file over 10 MB is refused | Vitest src/features/transactions/transactions.server.test.ts |
Viewing and downloading a receipt
Section titled “Viewing and downloading a receipt”Playwright: e2e/transactions.spec.ts
| Scenario | Tests |
|---|---|
| A member downloads a receipt | Vitest src/features/transactions/receipt-response.server.test.ts |
| A user without access can’t open a receipt | Vitest src/features/transactions/receipt-response.server.test.ts |
| Opening a receipt full screen | Playwright e2e/transactions.spec.ts |
Editing an entry
Section titled “Editing an entry”Playwright: e2e/transactions.spec.ts
| Scenario | Tests |
|---|---|
| Correcting the amount | Vitest src/features/transactions/transactions.server.test.tsPlaywright e2e/transactions.spec.ts |
| A co-owner edits an entry | Vitest src/features/transactions/transactions.server.test.ts |
| Replacing the receipt deletes the old file | Vitest src/features/transactions/transactions.server.test.tsPlaywright e2e/transactions.spec.ts |
| Removing the receipt | Vitest src/features/transactions/transactions.server.test.ts |
| Editing a deleted entry is refused | Vitest src/features/transactions/transactions.server.test.ts |
| A member can’t edit an entry | Vitest src/features/transactions/transactions.server.test.ts |
Deleting an entry
Section titled “Deleting an entry”Playwright: e2e/transactions.spec.ts
| Scenario | Tests |
|---|---|
| Deleting an entry with its receipt | Vitest src/features/transactions/transactions.server.test.tsPlaywright e2e/transactions.spec.ts |
| Cancelling keeps the entry | Vitest src/features/transactions/TransactionForm.test.tsx |
| A member can’t delete an entry | Vitest src/features/transactions/transactions.server.test.ts |
Storage quota for receipts
Section titled “Storage quota for receipts”No Playwright test: reaching the quota needs 500 MB or 1,000 stored files; Workers tests cover the check with recorded sizes, and a component test shows the message.
| Scenario | Tests |
|---|---|
| A receipt over the file count is refused | Vitest src/features/transactions/transactions.server.test.ts |
| A receipt over the size is refused | Vitest src/features/transactions/transactions.server.test.ts |
| Another owner’s files don’t count | Vitest src/features/transactions/transactions.server.test.ts |
| Documents count towards the receipt quota | Vitest src/features/transactions/transactions.server.test.ts |
New entry from the bottom bar
Section titled “New entry from the bottom bar”Playwright: e2e/archive-flat.spec.ts, e2e/navigation.spec.ts
| Scenario | Tests |
|---|---|
| The only owned flat is chosen already | Playwright e2e/navigation.spec.ts |
| Choosing among owned flats | Vitest src/features/transactions/TransactionForm.test.tsxPlaywright e2e/navigation.spec.ts |
| A user without flats is asked to add one | Playwright e2e/navigation.spec.ts |
| A member of shared flats only can’t add entries | Playwright e2e/navigation.spec.ts |
| An archived flat is not offered | Vitest src/features/transactions/transactions.server.test.ts |
| A user whose owned flats are all archived | Vitest src/features/transactions/transactions.server.test.tsPlaywright e2e/archive-flat.spec.ts |