: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 { expectLogic } from 'kea-test-utils'
import { initKeaTests } from '~/test/init'
import { visualReviewPreferencesLogic } from './visualReviewPreferencesLogic'
describe('visualReviewPreferencesLogic', () => {
let logic: ReturnType<typeof visualReviewPreferencesLogic.build>
beforeEach(() => {
initKeaTests()
logic = visualReviewPreferencesLogic()
logic.mount()
})
afterEach(() => {
logic.unmount()
})
it('defaults adding snapshot images to the comment to off so it is opt-in', async () => {
await expectLogic(logic).toMatchValues({ addImagesToComment: false })
})
it.each([true, false])('remembers the addImagesToComment choice (%s)', async (enabled) => {
await expectLogic(logic, () => {
logic.actions.setAddImagesToComment(enabled)
}).toMatchValues({ addImagesToComment: enabled })
})
})