Skip to content

: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.

831 B
Raw Blame
import { describe, expect, it } from 'vitest'

import { SignalsReportChecksReplaceCreateBody } from '@/generated/signals/api'

describe('Signals metric check replacement inputs', () => {
    it('leaves omitted display fields available for the referenced metric to supply', () => {
        const result = SignalsReportChecksReplaceCreateBody().parse({
            title: 'Checkout conversion improves',
            config: {
                metric_id: 'checkout-conversion',
                comparison: { operator: 'gte', value: 0.8 },
                monitoring: { reference_period_minutes: 1440, threshold_scaling: 'fixed' },
            },
        })
        expect(result.config.metric_kind).toBeUndefined()
        expect(result.config.value_format).toBeUndefined()
        expect(result.config.unit).toBeUndefined()
    })
})