mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 09:01:17 -08:00
33 lines
906 B
TypeScript
33 lines
906 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { resolveCallNotificationCopy } from './pushCallNotificationCopy';
|
|
|
|
describe('resolveCallNotificationCopy', () => {
|
|
it('uses generic room-call copy when previews are hidden', () => {
|
|
expect(
|
|
resolveCallNotificationCopy({
|
|
notificationType: 'notification',
|
|
intentKind: 'audio',
|
|
showPreviewDetails: false,
|
|
})
|
|
).toEqual({
|
|
title: 'Room call started',
|
|
body: 'Open Sable to join.',
|
|
});
|
|
});
|
|
|
|
it('uses sender and room details for ring notifications', () => {
|
|
expect(
|
|
resolveCallNotificationCopy({
|
|
notificationType: 'ring',
|
|
intentKind: 'video',
|
|
senderDisplayName: 'Alice',
|
|
roomName: 'General',
|
|
showPreviewDetails: true,
|
|
})
|
|
).toEqual({
|
|
title: 'Incoming video call',
|
|
body: 'Alice is calling you in General',
|
|
});
|
|
});
|
|
});
|