Default browser notifications on through a first-login permission prompt with category controls
Hop-State: A_06FPDKC36EGSF1DQQ929QZR Hop-Proposal: R_06FPDKBGHD5F0RARPQPEGTG Hop-Task: T_06FPDJYX8ADKQPCJRTD1TS8 Hop-Attempt: AT_06FPDJYX89JABJ674EYANCR
This commit is contained in:
@@ -3,6 +3,7 @@ import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
browserNotificationsEnabledKey,
|
||||
getBrowserNotificationContent,
|
||||
parseBrowserNotificationPreferences,
|
||||
} from './browser';
|
||||
|
||||
describe('browser notification presentation', () => {
|
||||
@@ -11,6 +12,21 @@ describe('browser notification presentation', () => {
|
||||
.toBe('synapsis:browser-notifications:user-1');
|
||||
});
|
||||
|
||||
it('defaults every notification category on and preserves explicit choices', () => {
|
||||
expect(parseBrowserNotificationPreferences(null)).toEqual({
|
||||
follow: true,
|
||||
like: true,
|
||||
repost: true,
|
||||
mention: true,
|
||||
reply: true,
|
||||
});
|
||||
expect(parseBrowserNotificationPreferences('{"like":false}')).toMatchObject({
|
||||
follow: true,
|
||||
like: false,
|
||||
mention: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('links post interactions to the relevant post', () => {
|
||||
expect(getBrowserNotificationContent({
|
||||
id: 'notification-1',
|
||||
|
||||
Reference in New Issue
Block a user