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.
Ownership is recorded as periods
Section titled “Ownership is recorded as periods”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 |
The first ownership period
Section titled “The first ownership period”Playwright: e2e/properties.spec.ts
| Scenario | Tests |
|---|---|
| Adding a flat records its owner from the given date | Vitest src/features/properties/properties.server.test.tsPlaywright e2e/properties.spec.ts |
| An ownership date in the future is refused | Vitest src/features/properties/schemas.test.tsPlaywright e2e/properties.spec.ts |
Changing a flat’s ownership
Section titled “Changing a flat’s ownership”Playwright: e2e/ownership.spec.ts
| Scenario | Tests |
|---|---|
| An owner records a sale of half the flat | Vitest src/features/ownership/ownership.server.test.tsPlaywright e2e/ownership.spec.ts |
| A change on the current period’s start corrects its split | Vitest src/features/ownership/ownership.server.test.tsPlaywright e2e/ownership.spec.ts |
| A split that doesn’t add up is refused | Vitest src/features/ownership/ownership.server.test.tsPlaywright 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 |
Roles follow the current shares
Section titled “Roles follow the current shares”Playwright: e2e/ownership.spec.ts
| Scenario | Tests |
|---|---|
| A member who gets a share becomes an owner | Vitest src/features/ownership/ownership.server.test.tsPlaywright e2e/ownership.spec.ts |
| An owner whose share drops to zero becomes a member | Vitest src/features/ownership/ownership.server.test.ts |
Undoing the latest ownership change
Section titled “Undoing the latest ownership change”Playwright: e2e/ownership.spec.ts
| Scenario | Tests |
|---|---|
| Undoing a change restores the previous split | Vitest src/features/ownership/ownership.server.test.tsPlaywright e2e/ownership.spec.ts |
| The only period can’t be undone | Vitest src/features/ownership/ownership.server.test.ts |
Correcting the first ownership date
Section titled “Correcting the first ownership date”Playwright: e2e/ownership.spec.ts
| Scenario | Tests |
|---|---|
| Correcting the date a flat was bought | Vitest src/features/ownership/ownership.server.test.tsPlaywright e2e/ownership.spec.ts |
| The first date can’t move past the next change | Vitest src/features/ownership/ownership.server.test.ts |
Showing a flat’s ownership history
Section titled “Showing a flat’s ownership history”Playwright: e2e/ownership.spec.ts
| Scenario | Tests |
|---|---|
| A member sees the history | Vitest src/features/ownership/ownership.server.test.tsPlaywright e2e/ownership.spec.ts |