Files
webmail/lib/__tests__/web-push-properties.test.ts
T
Linus Rath adbec718ef feat: let admins keep sender and subject out of push notifications, enforced by the server
The push preview route now reads the device policy of the login it
serves (its scopes worked out from the login's own JMAP session, every
non-personal account counted as a group) and under
`pushWithoutContent` asks the mail server for the message's ids only,
so sender, subject and text never reach the notification. The service
worker shows "New mail" for such an answer. A policy that can't be read
counts as on.

The three existing push preview route tests now mock the config manager
with the default policy: without it the route can't read a policy in the
test environment and holds the text back, which those tests didn't mean
to cover. No assertion changed.
2026-11-01 08:40:02 +01:00

13 lines
543 B
TypeScript

import { describe, expect, it } from 'vitest';
import { EMAIL_PUSH_PROPERTIES } from '@/lib/web-push';
// The emailPush subscription goes through the push service: it may carry
// ids only. With from, subject or preview here, they would reach the push
// service around the device policy "Push without sender and subject",
// whose text the server holds back in app/api/push/preview.
describe('EMAIL_PUSH_PROPERTIES', () => {
it('stays id and threadId', () => {
expect([...EMAIL_PUSH_PROPERTIES]).toEqual(['id', 'threadId']);
});
});