test(referto): copri generaReferto e il branch guest di vincitoreSet
buildRefertoHtml mancava il caso vinc nullo con guest in vantaggio; generaReferto (window.open/print) non era testato affatto perché richiede un DOM — aggiunto un test component in happy-dom che mocka window.open.
This commit is contained in:
@@ -60,6 +60,15 @@ describe('buildRefertoHtml (referto.js)', () => {
|
||||
expect(html).toContain('1 – 0')
|
||||
})
|
||||
|
||||
it('ricava il vincitore guest dal conteggio punti se vinc è nullo', () => {
|
||||
const striscia = [
|
||||
{ serv: 'h', ris: 'g'.repeat(25) + 'h'.repeat(20), vinc: null },
|
||||
]
|
||||
const html = buildRefertoHtml(statoConSet(striscia), NOW)
|
||||
// conteggio punti guest > home, pur con vinc null → 0 – 1
|
||||
expect(html).toContain('0 – 1')
|
||||
})
|
||||
|
||||
it('include la progressione punto-punto con classi per squadra', () => {
|
||||
const striscia = [
|
||||
{ serv: 'h', ris: 'hhg', vinc: null },
|
||||
|
||||
Reference in New Issue
Block a user