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.

773 B
Raw Blame
import { BLOCK_RUNTIME_PATH } from './blockDefinitions'
import { canvasCapabilities } from './blockProject'

describe('canvasCapabilities', () => {
    it('allows the insights that Insight blocks show and keeps the ones already allowed', () => {
        const files = {
            [BLOCK_RUNTIME_PATH]: '',
            'src/canvas.tsx':
                '<Insight blockId="a" shortId="Abc123" />\n<Insight\n  blockId="b"\n  title={"Signups > 1"}\n  shortId="Xyz789"\n/>\n<Insight blockId="c" />',
        }
        const capabilities = canvasCapabilities({ posthog: { insights: ['Old111', 'Abc123'] } }, files)
        expect(capabilities?.posthog?.insights).toEqual(['Old111', 'Abc123', 'Xyz789'])
        expect(capabilities?.posthog?.inlineQueries).toBe(true)
    })
})