feat: add webchat pwa push subscription support
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user