feat: add webchat pwa push subscription support

This commit is contained in:
William Valentin
2026-02-18 10:46:55 -08:00
parent 02fa604c7c
commit 8234cc93f3
17 changed files with 743 additions and 2 deletions
+23
View File
@@ -147,6 +147,13 @@ describe('configSchema — server', () => {
expect(result.server.nodes.push.enabled).toBe(false);
});
it('defaults webchat push settings', () => {
const result = configSchema.parse(minimalConfig);
expect(result.server.webchat_push.enabled).toBe(false);
expect(result.server.webchat_push.vapid_public_key).toBeUndefined();
expect(result.server.webchat_push.max_subscriptions).toBe(5000);
});
it('accepts custom node policy settings', () => {
const result = configSchema.parse({
...minimalConfig,
@@ -194,6 +201,22 @@ describe('configSchema — server', () => {
expect(result.server.discovery.service_type).toBe('_custom._tcp');
expect(result.server.discovery.txt).toEqual({ env: 'dev' });
});
it('accepts custom webchat push settings', () => {
const result = configSchema.parse({
...minimalConfig,
server: {
webchat_push: {
enabled: true,
vapid_public_key: 'BOrSAMPLEPUBLICKEY____',
max_subscriptions: 42,
},
},
});
expect(result.server.webchat_push.enabled).toBe(true);
expect(result.server.webchat_push.vapid_public_key).toBe('BOrSAMPLEPUBLICKEY____');
expect(result.server.webchat_push.max_subscriptions).toBe(42);
});
});
describe('configSchema — browser', () => {