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.

711 B
Raw Blame
import '@testing-library/jest-dom'

import { cleanup, render, screen } from '@testing-library/react'

import { initKeaTests } from '~/test/init'

import { SurveyResponseDisplay } from './SurveyResponseDisplay'

describe('SurveyResponseDisplay', () => {
    beforeEach(() => {
        initKeaTests()
    })

    afterEach(() => {
        cleanup()
    })

    it('renders without mounting surveyLogic when $survey_id is missing', () => {
        render(
            <SurveyResponseDisplay
                eventProperties={{ $survey_name: 'Custom survey sent event', $survey_response: 'hello' }}
            />
        )

        expect(screen.getByText('Custom survey sent event')).toBeInTheDocument()
    })
})