:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { getNotificationDescription } from './notificationDescription'
describe('getNotificationDescription', () => {
test.each([
[{ url: { value: 'https://hooks.example.com/path' } }, 'hooks.example.com'],
[{ url: { value: 'not a valid URL' } }, 'not a valid URL'],
[{ webhookUrl: { value: 'https://discord.com/api/webhooks/123/token' } }, 'discord.com'],
[{ webhookUrl: { value: 'not a valid webhook URL' } }, 'not a valid webhook URL'],
[{ channel: { value: '#alerts' } }, '#alerts'],
[{ email: { value: '[email protected]' } }, '[email protected]'],
[undefined, null],
])('returns the destination description for inputs %#', (inputs, expected) => {
expect(getNotificationDescription({ inputs })).toBe(expected)
})
})