Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Share one token-link builder across tests

Aperta
#470 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
66/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
testing

Direzione di ricerca

Start in src/__tests__/test-helpers.ts beside makePhraseLink, then read the six listed test files and their existing link builders. Consolidate token-link creation while preserving status-based default ids, explicit id overrides, and overridable surface text; check whether segment-link builders are also duplicated. Run the test suite and confirm it passes unchanged.

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

Descrizione

enhancement

Six test files each build approved token links with their own helper. Replace them with one makeTokenLink in src/__tests__/test-helpers.ts, beside makePhraseLink.

Today

File Builder Default id Uses
analysis-repository-conformance.ts (#469) tokenLink(id, analysisId, tokenRef, surfaceText) none; the caller passes it 4
types/type-guards.test.ts tokenLink(analysisId, status?, tokenRef?) ref:analysis:status 10
utils/analysis-book.test.ts mkTokenLink(analysisId, tokenRef) ref:analysis 12
utils/project-analysis-summary.test.ts mkTokenLink(analysisId, tokenRef) ref:analysis 11
utils/reanchor-analysis.test.ts makeTokenLink(tokenRef, surfaceText, analysisId?) ref:analysis 76
utils/analysis-violations.test.ts linkTo(analysisId, tokenRef, id?) tl-ref 6

Watch for

  • Unique default ids. type-guards.test.ts puts the status in the id, so two links on one token and payload stay distinct. The shared default must keep that.
  • Explicit ids. analysis-violations.test.ts passes the same id twice to trigger duplicateLinkId, so callers must still be able to set the id.
  • Surface text. Some builders default it to the token ref; reanchor-analysis.test.ts needs a real one for drift detection. Default it, but allow an override.

As the data layer plan lands

  • Sequencing. Blocked by 1e (#434); blocks 3b (#441). 3b to 3i (#441 to #448) add parity and conformance tests that build many links, and they start on the shared builder.
  • 1e (#434). Rewrites the project summaries, so project-analysis-summary.test.ts gets consolidated as 1e leaves it.
  • 3b (#441). ChangeSets are keyed by record type and id, so fixture ids must be unique and stable.
  • 3j (#449). Its done-when reuses the drift cases in reanchor-analysis.test.ts, the biggest user here, for the host reanchor pass. Consolidating first lets those cases move without their own builder.
  • 4c (#455). Deletes the WebView reanchor passes, so reanchor-analysis.test.ts goes or moves with them. Whatever remains should already use the shared builder.
  • Segment links may have the same duplication. Check it in the same pass, and add a makeSegmentLink if so.

Done when

The test files build token links only through makeTokenLink, and the suite passes unchanged.

Lingua principale
TypeScript
Stelle
2
Fork
0
Merge medio
1g 20h
PR unite (30g)
53

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 sillsdev/interlinearizer-extension

Tutte le issue di sillsdev/interlinearizer-extension

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.