Skip to content

documents

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

Playwright: e2e/documents.spec.ts

Scenario Tests
Adding a financial statement Playwright e2e/documents.spec.ts
The name is suggested from the file Vitest src/features/documents/DocumentForm.test.tsx
Playwright e2e/documents.spec.ts
A document needs a name Vitest src/features/documents/DocumentForm.test.tsx
Playwright e2e/documents.spec.ts
Another flat’s tenancy in the address is ignored Playwright e2e/documents.spec.ts
A member can’t add a document Vitest src/features/documents/documents.server.test.ts
Playwright e2e/documents.spec.ts

Playwright: e2e/documents.spec.ts

Scenario Tests
A photo is resized before upload Playwright e2e/documents.spec.ts
A PDF is stored as it is Vitest src/features/documents/documents.server.test.ts
Playwright e2e/documents.spec.ts
A file that isn’t an image or a PDF is refused Vitest src/features/documents/documents.server.test.ts
Playwright e2e/documents.spec.ts
A file over 10 MB is refused Vitest src/features/documents/documents.server.test.ts

Playwright: e2e/documents.spec.ts

Scenario Tests
A lease names its tenancy Playwright e2e/documents.spec.ts
Another flat’s tenancy is refused Vitest src/features/documents/documents.server.test.ts
A lease stays when its tenancy is removed Vitest src/features/documents/document.repository.server.test.ts

Playwright: e2e/documents.spec.ts

Scenario Tests
Documents are grouped by kind, newest first Vitest src/features/documents/DocumentsPage.test.tsx
Playwright e2e/documents.spec.ts
Filtering by kind Vitest src/features/documents/DocumentsPage.test.tsx
Playwright e2e/documents.spec.ts
A flat without documents Vitest src/features/documents/DocumentsPage.test.tsx
Playwright e2e/documents.spec.ts
An owner sees their storage use Vitest src/features/documents/DocumentsPage.test.tsx
Playwright e2e/documents.spec.ts
A member sees the documents but can’t add Playwright e2e/documents.spec.ts
Another user can’t open the documents page Playwright e2e/documents.spec.ts

Playwright: e2e/documents.spec.ts

Scenario Tests
An owner opens a document Vitest src/features/documents/DocumentDetails.test.tsx
Playwright e2e/documents.spec.ts
A member opens a document Vitest src/features/documents/DocumentDetails.test.tsx
Playwright e2e/documents.spec.ts
A deleted document is not found Vitest src/features/documents/documents.server.test.ts
Playwright e2e/documents.spec.ts

Playwright: e2e/documents.spec.ts

Scenario Tests
A member downloads a document Vitest src/features/documents/documents.server.test.ts
Playwright e2e/documents.spec.ts
A user without access can’t open a document’s file Vitest src/features/documents/documents.server.test.ts
Playwright e2e/documents.spec.ts
Opening an image document full screen Playwright e2e/documents.spec.ts

Playwright: e2e/documents.spec.ts

Scenario Tests
Renaming a document Vitest src/features/documents/documents.server.test.ts
Playwright e2e/documents.spec.ts
Changing a lease to another kind removes its tenancy Vitest src/features/documents/documents.server.test.ts
Playwright e2e/documents.spec.ts
Editing a deleted document is refused Vitest src/features/documents/documents.server.test.ts
A member can’t edit a document Vitest src/features/documents/documents.server.test.ts
Playwright e2e/documents.spec.ts

Playwright: e2e/documents.spec.ts

Scenario Tests
Deleting a document and its file Playwright e2e/documents.spec.ts
Cancelling keeps the document Playwright e2e/documents.spec.ts
A member can’t delete a document Vitest src/features/documents/documents.server.test.ts

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
Receipts and documents count together Vitest src/features/documents/documents.server.test.ts
A document over the size is refused Vitest src/features/documents/documents.server.test.ts
Another owner’s documents don’t count Vitest src/features/documents/documents.server.test.ts

Playwright: e2e/documents.spec.ts

Scenario Tests
The current tenancy’s lease Vitest src/features/tenancies/TenancyPage.test.tsx
Vitest src/features/tenancies/tenancy-lease.server.test.ts
Playwright e2e/documents.spec.ts
Adding the lease from the tenancy page Playwright e2e/documents.spec.ts
A lease of another tenancy isn’t on the card Vitest src/features/tenancies/tenancy-lease.server.test.ts
A member sees the lease but can’t add one Vitest src/features/tenancies/TenancyPage.test.tsx
Playwright e2e/documents.spec.ts