feat: add wizard e2e test query edge case#35380
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR adds support for fixture generation in E2E tests for the @posthog/wizard package by introducing the ability to mock wizard data in debug mode and increasing rate limits for development environments. The changes involve two main components:
- Adding support for mock wizard data when PostHog is running in debug mode and a specific header (
X-PostHog-Wizard-Fixture-Generation) is present - Increasing the wizard rate limit in development from 20/day to 1000/day
The test coverage is comprehensive, with new test cases that verify both the positive and negative scenarios for mock data usage.
Confidence score: 2/5
- Can be merged with caution, but needs attention to critical issues.
- There is a critical bug in the rate limit setting that needs to be fixed.
- The rate limit change in
rate_limit.pyneeds immediate attention.
The bug in rate_limit.py is severe - the rate setting code has an assignment error. The line:
if settings.DEBUG:
"1000/day"This code creates a string literal but doesn't assign it to anything. It should be:
if settings.DEBUG:
rate = "1000/day"This bug means that the rate limit will remain at 20/day even in debug mode, which will affect the E2E testing functionality this PR aims to enable.
2 files reviewed, 1 comment
Problem
To support the fixture generation during E2E tests in the
@posthog/wizardpackage, we need to support mocking the cache value, since we never authenticate through the browser in the E2E flow.Context: PostHog/wizard#101
Changes
X-PostHog-Wizard-Fixture-Generationheader is specified.How did you test this code?
Added tests for checking the changed functionality.
Did you write or update any docs for this change?
👉 Stay up-to-date with PostHog coding conventions for a smoother review.