Skip to content

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.

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.ts
Playwright e2e/year-summary.spec.ts
A flat without a share is named, not summarised Vitest src/features/year-summary/year-summary.server.test.ts
Playwright e2e/year-summary.spec.ts
No share in any flat Vitest src/features/year-summary/year-summary.server.test.ts
Playwright e2e/year-summary.spec.ts
Moving to the previous year Vitest src/features/year-summary/year-summary.server.test.ts
Playwright e2e/year-summary.spec.ts

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

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.ts
Vitest 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

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

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

Playwright: e2e/year-summary.spec.ts

Scenario Tests
The rows of a flat Vitest src/features/year-summary/year-summary.server.test.ts
Playwright 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.ts
Playwright e2e/year-summary.spec.ts
A flat without a share that year Vitest src/features/year-summary/FlatTaxPage.test.tsx
Vitest src/features/year-summary/year-summary.server.test.ts
Playwright e2e/year-summary.spec.ts

Playwright: e2e/year-summary.spec.ts

Scenario Tests
Missing housing company details Vitest src/features/year-summary/FlatTaxPage.test.tsx
Vitest src/features/year-summary/summary.test.ts
Playwright 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.tsx
Vitest 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

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

Playwright: e2e/year-summary.spec.ts

Scenario Tests
A month not paid Vitest src/features/year-summary/summary.test.ts
Playwright 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

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

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

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.tsx
Vitest src/features/year-summary/year-summary.server.test.ts

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.ts
Vitest src/features/year-summary/summary.test.ts

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

Playwright: e2e/year-summary.spec.ts

Scenario Tests
Downloading the own share’s PDF Vitest src/features/year-summary/PdfButton.test.tsx
Playwright e2e/year-summary.spec.ts
The PDF follows the chosen holder Vitest src/features/year-summary/PdfButton.test.tsx
Playwright e2e/year-summary.spec.ts
No PDF without flats in the summary Vitest src/features/year-summary/YearSummaryPage.test.tsx
Playwright e2e/year-summary.spec.ts
Building the PDF fails Vitest src/features/year-summary/PdfButton.test.tsx

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

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

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

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

Playwright: e2e/year-summary.spec.ts

Scenario Tests
A former owner sees their period Vitest src/features/year-summary/year-summary.server.test.ts
Playwright 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

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

Playwright: e2e/year-summary.spec.ts

Scenario Tests
The rental income after costs of the year Vitest src/features/year-summary/estimate.test.ts
Playwright e2e/year-summary.spec.ts
The rental income after costs of a flat Vitest src/features/year-summary/FlatTaxPage.test.tsx
Playwright e2e/year-summary.spec.ts
No card without flats Vitest src/features/year-summary/YearSummaryPage.test.tsx

Playwright: e2e/year-summary.spec.ts

Scenario Tests
The estimate of the own share Vitest src/features/year-summary/estimate.test.ts
Playwright 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

Playwright: e2e/year-summary.spec.ts

Scenario Tests
A loss in the year Vitest src/features/year-summary/YearSummaryPage.test.tsx
Vitest src/features/year-summary/estimate.test.ts
Playwright e2e/year-summary.spec.ts
No income after costs Vitest src/features/year-summary/estimate.test.ts

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.tsx
Vitest 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