Unit tests for the morning summary's title, local day and wanted rules
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 90/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- testing
Direzione di ricerca
Leggi app/packages/core/src/notifications/summary.ts e usa app/tests/app/notification-summary-schedule.test.ts e app/tests/app/notification-levels-core.test.ts come modelli. Aggiungi app/tests/app/notification-summary-core.test.ts con i casi node:test specificati, quindi esegui il comando di test della issue. Il lavoro è concluso quando i casi passano senza modifiche al codice di produzione e i controlli del repository restano verdi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
The morning summary (#350) sends one push a day that counts what waits in a person's inbox. Three small pure functions decide whether it is sent, which day it counts as, and what the title says. They run only inside the larger summary tests; none has a test of its own, so a change to the wording or the day boundary would not be caught where it happens.
Found on main at 75df7fffd by searching app/tests for each exported name in app/packages/core/src: no test file names summaryTitle, summaryWanted or localDay.
Files
app/packages/core/src/notifications/summary.tslocalDay(now, timeZone)(line 18): the local calendar day asYYYY-MM-DD.summaryWanted(preferences)(line 23): true only whensummaryEnabledis on and the level is not "Nothing".summaryTitle(count, more)(line 35):1 thing waits in your inbox,N things wait in your inbox,N+ things wait in your inbox.
- Pattern to copy:
app/tests/app/notification-summary-schedule.test.ts(imports from../../packages/core/src/notifications/...js) andapp/tests/app/notification-levels-core.test.ts(imports from@flux/core; itsfresh()helper at line 22 builds stored preferences fromDEFAULT_PREFERENCES, andapplyPreferenceChange(fresh(), { level: 'nothing' })sets a level).
Checked before filing: a draft of the cases below passed against main at cb25512e6 in the test image, so the tests describe today's behaviour and need no production change.
Acceptance criteria
- A new file
app/tests/app/notification-summary-core.test.ts(the-coresuffix means: no database, no network) covers, withnode:testandnode:assert/strict:summaryTitle: singular for 1, plural for 0 and 2, the+form whenmoreis true (also for 1).summaryWanted: false whensummaryEnabledis false; false at the "Nothing" level even when enabled; true when enabled at "Needs you" and at "Everything".localDay: the same instant gives different days inUTCandPacific/Kiritimati; a time-zone change of day at local midnight (an instant one second before and one second after).
- No production code changes. If a test shows a real bug, open a separate issue with the failing case instead of fixing it here.
- The new tests pass, and the repository checks stay green.
How to check
docker build --file docker/Dockerfile --target test --tag flux-unit app
docker run --rm --network none flux-unit node_modules/.bin/tsx --test tests/app/notification-summary-core.test.ts
docker image rm flux-unit
python3 scripts/check_agent_setup.py
git diff --check
See CONTRIBUTING for the fork and PR steps. Put Closes #<this issue> in the PR description.
- Lingua principale
- TypeScript
- Stelle
- 3
- Fork
- 0
- Merge medio
- 19h 42m
- PR unite (30g)
- 383
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ColdPhase/flux
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 95/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 91/100
I maintainer di solito rispondono entro 1 giorno
-
Screen sharing: Sharp text up to 30 fps, full 1080p60 Smooth motion, measure with hardware encodingAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Kubernetes / Helm deploymentAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ColdPhase/flux
Issue simili
-
docker infra P1 security size:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
josephfung/curia#2408 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
ehmpathy/rhachet-roles-ehmpathy#1231 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue help wanted
Difficoltà 2/5 Mezza giornata Idoneità per principianti 70/100
danielw-sudo/agentuto#32 ·
I maintainer di solito rispondono entro 1 giorno
-
type:docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
nightgauge/nightgauge#2836 ·
I maintainer di solito rispondono entro 1 giorno