mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:13:07 +00:00
- Collections Notification e PushSubscription com migration - Sino no header (mobile + desktop) com drawer de avisos lidos/não lidos - Hooks em municipalityUpdate, supporter, activity e convite aceito - Push Web via web-push + handlers no service worker /campanha/sw.js - Opt-in LGPD em /campanha/perfil (chave campanha-notificacoes-push) - Testes unit/int de contrato e access Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
20 lines
736 B
TypeScript
20 lines
736 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { notificationTypeLabels, notificationTypes } from '@/lib/notificationContract'
|
|
import { buildCampaignServiceWorkerScript } from '@/utilities/campaignPwa'
|
|
|
|
describe('notificationContract', () => {
|
|
it('labels every notification type', () => {
|
|
for (const type of notificationTypes) {
|
|
expect(notificationTypeLabels[type]).toBeTruthy()
|
|
}
|
|
})
|
|
})
|
|
|
|
describe('buildCampaignServiceWorkerScript', () => {
|
|
it('includes push and notificationclick handlers', () => {
|
|
const script = buildCampaignServiceWorkerScript('test-build')
|
|
expect(script).toContain("self.addEventListener('push'")
|
|
expect(script).toContain("self.addEventListener('notificationclick'")
|
|
})
|
|
})
|