Aktualisiere die Version auf 1.8.12, passe die Protokollnachricht für den QTTR-Import an und füge Tests für die QTTR-Importsignatur hinzu.
Some checks failed
Code Analysis and Production Deploy / analyze (push) Failing after 5m15s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Has been skipped

This commit is contained in:
Torsten Schulz (local)
2026-09-30 09:30:24 +02:00
parent 835a31a72e
commit 87e08df93a
4 changed files with 33 additions and 4 deletions

23
tests/qttr-import.spec.ts Normal file
View File

@@ -0,0 +1,23 @@
import { describe, expect, it } from 'vitest'
import { qttrListSignature } from '../server/utils/qttr-import.js'
describe('QTTR import signature', () => {
it('ignores TTR-only players so daily TTR changes cannot trigger a QTTR push', () => {
const qttrRows = [
{ playerNumber: 1, playerName: 'QTTR Spieler', currentQttr: 1500, currentTtr: 1512 }
]
const withChangedTtrOnlyPlayer = [
...qttrRows,
{ playerNumber: 2, playerName: 'Nur TTR', currentQttr: null, currentTtr: 1333 }
]
expect(qttrListSignature(withChangedTtrOnlyPlayer)).toBe(qttrListSignature(qttrRows))
})
it('changes when an actual QTTR value changes', () => {
const previous = [{ playerNumber: 1, playerName: 'QTTR Spieler', currentQttr: 1500 }]
const updated = [{ playerNumber: 1, playerName: 'QTTR Spieler', currentQttr: 1501 }]
expect(qttrListSignature(updated)).not.toBe(qttrListSignature(previous))
})
})