year-summary
25 requirements and 101 scenarios in openspec/specs/year-summary/spec.md. A scenario’s test is test('<scenario>') inside describe('<requirement>'), in Vitest or Playwright.
The year summary page
Section titled “The year summary page”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| The cards of the flats owned in the year | Vitest src/features/year-summary/year-summary.server.test.tsPlaywright e2e/year-summary.spec.ts |
| A flat without a share is named, not summarised | Vitest src/features/year-summary/year-summary.server.test.tsPlaywright e2e/year-summary.spec.ts |
| No share in any flat | Vitest src/features/year-summary/year-summary.server.test.tsPlaywright e2e/year-summary.spec.ts |
| Moving to the previous year | Vitest src/features/year-summary/year-summary.server.test.tsPlaywright e2e/year-summary.spec.ts |
The year the summary opens on
Section titled “The year the summary opens on”No Playwright test: the opening year depends on today’s date, which a browser test can’t set for the server; Vitest covers it with a fixed today.
| Scenario | Tests |
|---|---|
| In spring the previous year opens | Vitest src/features/year-summary/summary.test.ts |
| From July the current year opens | Vitest src/features/year-summary/summary.test.ts |
| A first share this year | Vitest src/features/year-summary/summary.test.ts |
| The years of another owner | Vitest src/features/year-summary/year-summary.server.test.ts |
| A member without a share moves between years | Vitest src/features/year-summary/year-summary.server.test.ts |
Flats in the year summary
Section titled “Flats in the year summary”No Playwright test: the archived and mid-year ownership cases need ownership periods in the past; the page’s Playwright test covers a flat included and one left out, and Vitest covers the rules.
| Scenario | Tests |
|---|---|
| An archived flat is included | Vitest src/features/year-summary/year-summary.server.test.tsVitest src/features/year-summary/summary.test.ts |
| A share starting during the year | Vitest src/features/year-summary/summary.test.ts |
| A share ended during the year | Vitest src/features/year-summary/summary.test.ts |
Form 7H rows of the own share
Section titled “Form 7H rows of the own share”No Playwright test: a pure calculation over many periods and dates; the form 7H page’s Playwright test shows rows computed by it.
| Scenario | Tests |
|---|---|
| Rent counts in the year it was paid | Vitest src/features/year-summary/summary.test.ts |
| Income entries add to the rent | Vitest src/features/year-summary/summary.test.ts |
| Maintenance charges and water in row 2.2 | Vitest src/features/year-summary/summary.test.ts |
| An income-recognised financing charge in row 2.3 | Vitest src/features/year-summary/summary.test.ts |
| A treatment change during the year | Vitest src/features/year-summary/summary.test.ts |
| Entries in rows 2.4 and 2.5 | Vitest src/features/year-summary/summary.test.ts |
| Damage kept from a deposit lowers row 2.4 | Vitest src/features/year-summary/summary.test.ts |
| Damage compensation over the repairs leaves row 2.4 at 0 | Vitest src/features/year-summary/summary.test.ts |
| The current year counts the months so far | Vitest src/features/year-summary/summary.test.ts |
Shares on the cash basis
Section titled “Shares on the cash basis”No Playwright test: needs ownership changes in the past; the calculation is covered by Vitest.
| Scenario | Tests |
|---|---|
| A share change during the year | Vitest src/features/year-summary/summary.test.ts |
| A charge month follows its first day | Vitest src/features/year-summary/summary.test.ts |
| Rounding a part once | Vitest src/features/year-summary/summary.test.ts |
| A deposit return counts at the share on its date | Vitest src/features/year-summary/summary.test.ts |
The form 7H page of a flat
Section titled “The form 7H page of a flat”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| The rows of a flat | Vitest src/features/year-summary/year-summary.server.test.tsPlaywright e2e/year-summary.spec.ts |
| The case law note under row 2.3 | Vitest src/features/year-summary/FlatTaxPage.test.tsx |
| A flat the user can’t see | Vitest src/features/year-summary/year-summary.server.test.tsPlaywright e2e/year-summary.spec.ts |
| A flat without a share that year | Vitest src/features/year-summary/FlatTaxPage.test.tsxVitest src/features/year-summary/year-summary.server.test.tsPlaywright e2e/year-summary.spec.ts |
Flat details for form 7H
Section titled “Flat details for form 7H”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| Missing housing company details | Vitest src/features/year-summary/FlatTaxPage.test.tsxVitest src/features/year-summary/summary.test.tsPlaywright e2e/year-summary.spec.ts |
| One tenancy for part of the year | Vitest src/features/year-summary/summary.test.ts |
| Several tenancies in the year | Vitest src/features/year-summary/FlatTaxPage.test.tsxVitest src/features/year-summary/summary.test.ts |
| The share at the end of the year | Vitest src/features/year-summary/summary.test.ts |
| The share at the end of the user’s period | Vitest src/features/year-summary/summary.test.ts |
The Not on form 7H card
Section titled “The Not on form 7H card”No Playwright test: a capitalised treatment, improvements and returned deposits in the past need data a browser test would set up through many forms; the amounts are covered by Vitest, and the form 7H page’s Playwright test checks that the card is left out without them.
| Scenario | Tests |
|---|---|
| Capitalised financing charges | Vitest src/features/year-summary/summary.test.ts |
| An improvement is shown, not counted | Vitest src/features/year-summary/summary.test.ts |
| Damage compensation over the repairs is shown | Vitest src/features/year-summary/summary.test.ts |
Checks in the year summary
Section titled “Checks in the year summary”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| A month not paid | Vitest src/features/year-summary/summary.test.tsPlaywright e2e/year-summary.spec.ts |
| A partly paid month | Vitest src/features/year-summary/summary.test.ts |
| Vacant months with charges | Vitest src/features/year-summary/summary.test.ts |
| A financing charge without a treatment | Vitest src/features/year-summary/summary.test.ts |
| A share change | Vitest src/features/year-summary/summary.test.ts |
| A share bought during the year | Vitest src/features/year-summary/summary.test.ts |
Copying form 7H values
Section titled “Copying form 7H values”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| Copying an amount | Playwright e2e/year-summary.spec.ts |
| Amounts and shares in the copy format | Vitest src/features/year-summary/copy.test.ts |
Choosing whose figures
Section titled “Choosing whose figures”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| The sheet lists the year’s owners | Vitest src/features/year-summary/year-summary.server.test.ts |
| No selector for a sole owner | Vitest src/features/year-summary/year-summary.server.test.ts |
| The choice follows the year and the flat | Playwright e2e/year-summary.spec.ts |
| A person without a share that year | Vitest src/features/year-summary/year-summary.server.test.ts |
| An unknown person in the URL | Vitest src/features/year-summary/year-summary.server.test.ts |
Another owner’s figures
Section titled “Another owner’s figures”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| A co-owner’s cards | Vitest src/features/year-summary/year-summary.server.test.ts |
| A member sees an owner’s figures | Vitest src/features/year-summary/year-summary.server.test.ts |
| A flat the user can’t see is not counted | Vitest src/features/year-summary/year-summary.server.test.ts |
| A co-owner’s form 7H page | Vitest src/features/year-summary/FlatTaxPage.test.tsxVitest src/features/year-summary/year-summary.server.test.ts |
The whole flats
Section titled “The whole flats”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| The whole flats include a flat without the own share | Vitest src/features/year-summary/year-summary.server.test.ts |
| The whole flat counts every owner’s share | Vitest src/features/year-summary/summary.test.ts |
| An owner change in the middle of the year | Vitest src/features/year-summary/year-summary.server.test.tsVitest src/features/year-summary/summary.test.ts |
The whole flat’s page
Section titled “The whole flat’s page”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| The whole flat’s rows and owners | Vitest src/features/year-summary/year-summary.server.test.ts |
| Opening an owner from the whole flat | Vitest src/features/year-summary/FlatTaxPage.test.tsx |
Downloading the year summary as a PDF
Section titled “Downloading the year summary as a PDF”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| Downloading the own share’s PDF | Vitest src/features/year-summary/PdfButton.test.tsxPlaywright e2e/year-summary.spec.ts |
| The PDF follows the chosen holder | Vitest src/features/year-summary/PdfButton.test.tsxPlaywright e2e/year-summary.spec.ts |
| No PDF without flats in the summary | Vitest src/features/year-summary/YearSummaryPage.test.tsxPlaywright e2e/year-summary.spec.ts |
| Building the PDF fails | Vitest src/features/year-summary/PdfButton.test.tsx |
The PDF’s cover page
Section titled “The PDF’s cover page”No Playwright test: a browser test can only see that a PDF was downloaded; the pages’ content is checked from the PDF’s document model in Vitest.
| Scenario | Tests |
|---|---|
| The cover page of the own share | Vitest src/features/year-summary/pdf-document.test.ts |
| A share change on the cover | Vitest src/features/year-summary/pdf-document.test.ts |
| Flats not included on the cover | Vitest src/features/year-summary/pdf-document.test.ts |
| The estimate on the own share’s cover | Vitest src/features/year-summary/pdf-document.test.ts |
| No estimate on another owner’s cover | Vitest src/features/year-summary/pdf-document.test.ts |
A flat’s page in the PDF
Section titled “A flat’s page in the PDF”No Playwright test: a browser test can only see that a PDF was downloaded; the pages’ content is checked from the PDF’s document model in Vitest.
| Scenario | Tests |
|---|---|
| Every tenancy of the year | Vitest src/features/year-summary/pdf-document.test.ts |
| A tenancy starting after today is not listed | Vitest src/features/year-summary/pdf-document.test.ts |
| The rows and checks of a flat | Vitest src/features/year-summary/pdf-document.test.ts |
| The rental income after costs on a flat’s page | Vitest src/features/year-summary/pdf-document.test.ts |
The whole flats’ PDF
Section titled “The whole flats’ PDF”No Playwright test: a browser test can only see that a PDF was downloaded; the pages’ content is checked from the PDF’s document model in Vitest.
| Scenario | Tests |
|---|---|
| The whole flats’ cover | Vitest src/features/year-summary/pdf-document.test.ts |
| The whole flat’s page | Vitest src/features/year-summary/pdf-document.test.ts |
Text the PDF font can’t show
Section titled “Text the PDF font can’t show”No Playwright test: the replacement is a pure function over text, covered by Vitest.
| Scenario | Tests |
|---|---|
| Names outside the font | Vitest src/features/year-summary/pdf-text.test.ts |
| Finnish and Swedish letters are kept | Vitest src/features/year-summary/pdf-text.test.ts |
| The PDF’s messages need no replacement | Vitest src/features/year-summary/pdf-document.test.ts |
A former owner’s year summary
Section titled “A former owner’s year summary”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| A former owner sees their period | Vitest src/features/year-summary/year-summary.server.test.tsPlaywright e2e/year-summary.spec.ts |
| No flat pages for a former owner | Playwright e2e/year-summary.spec.ts |
| Only the own share of a former flat | Vitest src/features/year-summary/year-summary.server.test.ts |
| The years after a former owner’s period | Vitest src/features/year-summary/year-summary.server.test.ts |
| A former owner’s read-only form 7H page | Playwright e2e/year-summary.spec.ts |
| A member who leaves after their share ended | Vitest src/features/year-summary/year-summary.server.test.ts |
Tenants in a former owner’s period
Section titled “Tenants in a former owner’s period”No Playwright test: the scenarios need tenancies on both sides of a sale in the past; the clipping is a pure function covered by Vitest, and the former owner’s page is covered by “A former owner’s year summary”.
| Scenario | Tests |
|---|---|
| Only the former owner’s tenants | Vitest src/features/year-summary/summary.test.ts |
| A tenancy only after the sale | Vitest src/features/year-summary/summary.test.ts |
| A former owner who kept access sees the whole year | Vitest src/features/year-summary/summary.test.ts |
Rental income after costs
Section titled “Rental income after costs”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| The rental income after costs of the year | Vitest src/features/year-summary/estimate.test.tsPlaywright e2e/year-summary.spec.ts |
| The rental income after costs of a flat | Vitest src/features/year-summary/FlatTaxPage.test.tsxPlaywright e2e/year-summary.spec.ts |
| No card without flats | Vitest src/features/year-summary/YearSummaryPage.test.tsx |
The capital income tax estimate
Section titled “The capital income tax estimate”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| The estimate of the own share | Vitest src/features/year-summary/estimate.test.tsPlaywright e2e/year-summary.spec.ts |
| The estimate is rounded to whole euros | Vitest src/features/year-summary/estimate.test.ts |
| No estimate for another owner | Vitest src/features/year-summary/YearSummaryPage.test.tsx |
| No estimate for the whole flats | Vitest src/features/year-summary/YearSummaryPage.test.tsx |
| A former owner’s flat in the estimate | Vitest src/features/year-summary/year-summary.server.test.ts |
A rental loss in the estimate
Section titled “A rental loss in the estimate”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| A loss in the year | Vitest src/features/year-summary/YearSummaryPage.test.tsxVitest src/features/year-summary/estimate.test.tsPlaywright e2e/year-summary.spec.ts |
| No income after costs | Vitest src/features/year-summary/estimate.test.ts |
Finnish originals of tax terms
Section titled “Finnish originals of tax terms”Playwright: e2e/year-summary.spec.ts
| Scenario | Tests |
|---|---|
| A row name in Swedish | Vitest src/features/year-summary/FlatTaxPage.test.tsx |
| A row name in English | Playwright e2e/year-summary.spec.ts |
| No originals in Finnish | Vitest src/features/year-summary/FlatTaxPage.test.tsxVitest src/features/year-summary/pdf-document.test.ts |
| A title with a bracket | Vitest src/features/year-summary/FlatTaxPage.test.tsx |
| Originals in the PDF | Vitest src/features/year-summary/pdf-document.test.ts |