import test from 'node:test'; import assert from 'node:assert/strict'; import { dayReminderPush, restTimerPush, testPush } from './push-messages.js'; test('localizes every server-generated notification in pt-BR', () => { assert.deepEqual(restTimerPush('pt-BR'), { title: 'Descanso terminado 💪', body: 'Hora da próxima série.', tag: 'rest-timer', }); assert.deepEqual(testPush('pt-BR'), { title: 'KuentaGYM', body: 'Notificação de teste ✅ — é assim que os alertas aparecem.', tag: 'test', }); assert.deepEqual(dayReminderPush('pt-BR', { name: 'Treino A', emoji: '💪' }), { title: '💪 Treino A hoje', body: 'Está no seu plano — vamos treinar 💪', tag: 'day-reminder', }); }); test('localizes every server-generated notification in Spanish', () => { assert.deepEqual(restTimerPush('es'), { title: 'Descanso terminado 💪', body: 'Toca la siguiente serie.', tag: 'rest-timer', }); assert.deepEqual(testPush('es'), { title: 'KuentaGYM', body: 'Notificación de prueba ✅ — así se ven los avisos.', tag: 'test', }); assert.deepEqual(dayReminderPush('es', { name: 'Empuje A', emoji: '💪' }), { title: '💪 Empuje A hoy', body: 'Está en tu plan — ¡vamos! 💪', tag: 'day-reminder', }); assert.equal(dayReminderPush('es', null).title, 'Entreno planificado para hoy'); }); test('keeps the existing English copy as the fallback', () => { assert.deepEqual(restTimerPush('fr'), restTimerPush('en')); assert.equal(dayReminderPush('unknown', null).title, 'Workout planned today'); assert.equal(testPush(undefined).body, 'Test notification ✅ — this is what alerts look like.'); });