Skip to content

ownership

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

No Playwright test: these are rules for stored periods and pure calculations; Vitest covers them with the functions and the repository, and the browser tests of the other requirements use them.

Scenario Tests
The shares on a date come from the period containing it Vitest src/features/ownership/periods.test.ts
A change ends the previous period the day before Vitest src/features/ownership/ownership.repository.server.test.ts
Shares that don’t add up to 100 % are refused Vitest src/features/ownership/periods.test.ts

Playwright: e2e/properties.spec.ts

Scenario Tests
Adding a flat records its owner from the given date Vitest src/features/properties/properties.server.test.ts
Playwright e2e/properties.spec.ts
An ownership date in the future is refused Vitest src/features/properties/schemas.test.ts
Playwright e2e/properties.spec.ts

Playwright: e2e/ownership.spec.ts

Scenario Tests
An owner records a sale of half the flat Vitest src/features/ownership/ownership.server.test.ts
Playwright e2e/ownership.spec.ts
A change on the current period’s start corrects its split Vitest src/features/ownership/ownership.server.test.ts
Playwright e2e/ownership.spec.ts
A split that doesn’t add up is refused Vitest src/features/ownership/ownership.server.test.ts
Playwright e2e/ownership.spec.ts
A change dated before the current period is refused Vitest src/features/ownership/ownership.server.test.ts
A change dated in the future is refused Vitest src/features/ownership/ownership.server.test.ts
Removing access from a person who no longer owns a share Vitest src/features/ownership/ownership.server.test.ts
A member can’t change ownership Vitest src/features/ownership/ownership.server.test.ts

Playwright: e2e/ownership.spec.ts

Scenario Tests
A member who gets a share becomes an owner Vitest src/features/ownership/ownership.server.test.ts
Playwright e2e/ownership.spec.ts
An owner whose share drops to zero becomes a member Vitest src/features/ownership/ownership.server.test.ts

Playwright: e2e/ownership.spec.ts

Scenario Tests
Undoing a change restores the previous split Vitest src/features/ownership/ownership.server.test.ts
Playwright e2e/ownership.spec.ts
The only period can’t be undone Vitest src/features/ownership/ownership.server.test.ts

Playwright: e2e/ownership.spec.ts

Scenario Tests
Correcting the date a flat was bought Vitest src/features/ownership/ownership.server.test.ts
Playwright e2e/ownership.spec.ts
The first date can’t move past the next change Vitest src/features/ownership/ownership.server.test.ts

Playwright: e2e/ownership.spec.ts

Scenario Tests
A member sees the history Vitest src/features/ownership/ownership.server.test.ts
Playwright e2e/ownership.spec.ts