test: cover country-specific sections

Open
#701 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
playwright, typescript, vite
Domain
frontend, testing

Research direction

Read specs/add-e2e/spec.md sections 2.6 and 6.7, then inspect e2e/specs/usecases/country-default.spec.ts and e2e/specs/usecases/country-italy.spec.ts plus the Playwright project configuration. Cover the listed default and import/reset behaviors, including uppercase IT in generated YAML. The countrySpecific=none expectation depends on a maintainer decision about B5, so confirm that decision before finalizing the test.

Written by the indexing model from the issue text.

Description

Context

Sub-task T8 of #655. See specs/add-e2e/spec.md §6.7, and §2.6: VITE_DEFAULT_COUNTRY_SECTIONS is read at build time, while ?countrySpecific= is read at runtime and only accepts all and italy.

Scope

e2e/specs/usecases/country-default.spec.ts (project default) and e2e/specs/usecases/country-italy.spec.ts (project country-italy, built with VITE_DEFAULT_COUNTRY_SECTIONS=italy into dist-italy).

default project (none)
  • No Italy section by default.
  • ?countrySpecific=italy and ?countrySpecific=all show it.
  • Importing a file with an IT section:
    • the Italy section appears;
    • the query param becomes countrySpecific=italy;
    • the output YAML has uppercase IT, because the file's version is 0.5 or later.
  • Reset (toolbar-reset → reset-confirm-submit): the section disappears and the query param is removed.
country-italy project
  • The Italy section is visible by default.
  • ?countrySpecific=none currently does not hide it (B5). Depending on the decision below, this is either test.fail() linked to the B5 issue, or an assertion that documents the current behaviour.

Open decision

Is ?countrySpecific=none being ignored when the build default is italy a bug (B5)? Owner: product / maintainers. If yes, open the B5 issue before merging so test.fail() can link to it.

Acceptance criteria

  • Both projects pass in CI; country-italy* specs run only in the country-italy project
  • Query param sync is covered on import and on reset
  • Uppercase IT is checked in the generated YAML
  • The B5 behaviour is covered according to the decision (test.fail() + issue link, or a documenting assertion)

Related

  • Parent: #655
  • Depends on: #682, #683
  • Linked bug: B5 (to be opened if judged a bug)
Dominant language
TypeScript
Stars
33
Forks
34
Avg merge
10h 50m
Merged PRs (30d)
13

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from italia/publiccode-editor

All issues in italia/publiccode-editor

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.