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.

702 B
Raw Blame
import type { MeApi } from '@/api/users'

import { buildAccount } from './account'

describe('account analytics privacy', () => {
    test.each([true, false, null, undefined])('keeps anonymization safe for preference %s', (preference) => {
        const me: MeApi = {
            id: 1,
            uuid: 'example-user',
            distinct_id: 'example-user',
            email: '[email protected]',
            first_name: 'Example',
            last_name: 'Person',
            team: null,
            organization: null,
            organizations: [],
            anonymize_data: preference,
        }

        expect(buildAccount(me, []).user.anonymizeData).toBe(preference !== false)
    })
})