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

test: isMessageSequential in layout_editor has no coverage

Aperta Adatta ai principianti
#1,373 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js
Ambito
testing

Direzione di ricerca

Il file da testare è packages/layout_editor/src/lib/isMessageSequential.js. Guarda il test esistente per generateThemeFromColor.js nella stessa cartella per comprendere le convenzioni di node:test e node:assert/strict. Scrivi un file di test chiamato isMessageSequential.test.js che copra gli scenari elencati: nessun messaggio precedente, stesso utente entro l'intervallo di raggruppamento, utenti diversi, intervallo più ampio dell'intervallo di raggruppamento, messaggi di sistema, groupable: false, alias diverso e un confine giornaliero. Esegui yarn test per assicurarti che la suite layout_editor passi. Fatto quando il nuovo file di test esiste e tutti i test passano.

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

Descrizione

packages/layout_editor/src/lib/isMessageSequential.js has no test file, while generateThemeFromColor.js beside it does (yarn test → node --test src/lib/*.test.js).

It decides message grouping — same author, same alias, not a system message, groupable !== false, within the grouping range, and the same calendar day — and none of those branches are currently covered.

I'd like to add src/lib/isMessageSequential.test.js following the existing node:test / node:assert/strict conventions in that folder, covering:

  • no previous message
  • same user inside the grouping range (the grouping case)
  • different users
  • a gap wider than the grouping range
  • system messages (t set on either message)
  • groupable: false
  • differing alias
  • a day boundary inside the grouping range

No source changes — test file only.

I've written it locally already: the full layout_editor suite passes 25/25 with it, and removing the !isMessageNewDay guard from the source makes the new day-boundary test fail, so it isn't a test that passes when the behaviour is broken.

Happy to open the PR — checking here first rather than sending an unannounced one.

Lingua principale
JavaScript
Stelle
165
Fork
381
Merge medio
1g 2h
PR unite (30g)
1

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

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 RocketChat/EmbeddedChat

Tutte le issue di RocketChat/EmbeddedChat

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.