Tests: cover the filesystem boundary in content.ts

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
72/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
sqlite, typescript
Ambito
testing

Direzione di ricerca

Start in src/lib/server/content.check.ts, which already covers create, save, trash and import, and read getPostFilePath, listPosts, importAllLlmDrafts and the postsRev logic it exercises. Add cases for path rejection, on-disk .md and .llm.md ingestion, idempotent import and a stable postsRev, then run pnpm test. Done when the new cases pass against a temp checkout and each one fails when its guard is removed.

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

Descrizione

good first issue

Context

src/lib/server/content.check.ts covers create, save, trash, restore, purge and .llm.md import. The paths that touch the filesystem boundary are not covered.

Scope

Add checks to src/lib/server/content.check.ts for:

  • getPostFilePath rejects .. traversal, absolute paths and non-.md paths;
  • an edited x.md on disk is ingested as an ext version on the next listPosts, and a new file is imported;
  • a changed .llm.md becomes an llm version;
  • importAllLlmDrafts is idempotent;
  • listPosts returns a stable postsRev when nothing changed and a new one after a save.

Acceptance criteria

  • pnpm test runs the new cases against a throwaway checkout under the system temp directory.
  • Each case fails when its guard is removed.

Estimate: about 3 hours.

Lingua principale
HTML
Stelle
0
Fork
0
Merge medio
1m
PR unite (30g)
2

Preparare l'ambiente

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 mrgnw/cfcms

Tutte le issue di mrgnw/cfcms

Issue simili

Altre issue su Testing & QA

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.