test: cover validation of valid and invalid publiccode.yml files

Open
#691 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
75/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
playwright, typescript, wasm
Domain
frontend, testing

Research direction

Start with e2e/specs/usecases/validate.spec.ts, then read the referenced spec sections §2 and §6.5 and the existing canary in e2e/specs/usecases/canary.spec.ts. Add the validation cases and reusable EditorPage helpers for notification and field errors, comparing keys only. Done means the valid, invalid, warning, and WASM canary cases pass in CI and the helpers are ready for T10.

Written by the indexing model from the issue text.

Description

enhancement

Context

Sub-task T6 of #655. See specs/add-e2e/spec.md §6.5, and §2 for the constraints (errors only after Validate, false pass without the WASM, keys only).

Scope

e2e/specs/usecases/validate.spec.ts.

  • Canary on import: an imported invalid file produces errors, which proves the WASM is active. This complements the existing canary on an empty form (e2e/specs/usecases/canary.spec.ts).
  • Valid file: import, then Validate (toolbar-submit), then the success notification.
  • Invalid file: import, then Validate:
    • the "Validation errors" notification appears;
    • field-error-* appears on the expected field, when that field is visible;
    • errors without a key appear as items in the notification.
  • File with warnings: Validate succeeds and the warning-items stay visible.
  • Assertions compare keys only, never line and column.
  • Validation helpers in EditorPage (reading errors from the notification and from field-error-*), so that T10 (conformance) can reuse them.

Acceptance criteria

  • All cases pass in CI with the WASM loaded
  • The validation helpers are part of EditorPage and ready for T10

Related

  • Parent: #655
  • Depends on: #682, #683
  • Blocks: T10 (conformance over the NoNetwork fixtures)
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.