test: cover country-specific sections

Aperta
#701 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
playwright, typescript, vite
Ambito
frontend, testing

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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)
Lingua principale
TypeScript
Stelle
33
Fork
34
Merge medio
10h 50m
PR unite (30g)
13

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di italia/publiccode-editor

Tutte le issue di italia/publiccode-editor

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.