: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
fix(test): discard-changes test with assertion reordering and toPass retry pattern (#61542)
mendral-app[bot]ff8a05f5ebb3
diff --git a/playwright/e2e/product-analytics/insights/trends.spec.ts b/playwright/e2e/product-analytics/insights/trends.spec.tsindex f6c7f1c606e5..8baf0803b270 100644--- a/playwright/e2e/product-analytics/insights/trends.spec.ts+++ b/playwright/e2e/product-analytics/insights/trends.spec.ts@@ -324,9 +324,11 @@ test.describe('Trends insights', () => {await expect(insight.trends.dateRangeButton).toContainText('Last 30 days')await expect(insight.saveButton).toBeEnabled()await insight.discard()- await insight.trends.waitForChart()- await expect(insight.trends.dateRangeButton).toContainText('Last 7 days')+ // Wait for mode transition to complete first (Edit → View)await expect(insight.editButton).toBeVisible()+ await insight.trends.waitForChart()+ // Handle race where DateFilter state is lost during mode transition remount+ await expect(insight.trends.dateRangeButton).toContainText('Last 7 days', { timeout: 10_000 })})await test.step('edit again, make a change, and save', async () => {