From 9c7d5892ba284a4d72ee5f450f8a485b977b7d97 Mon Sep 17 00:00:00 2001 From: Shy Alter Date: Sun, 4 Oct 2026 08:05:15 +0200 Subject: [PATCH 1/2] fix(replay-vision): use the storybook play timeout in scanner stories The play functions imported `within` from `storybook/test`. That copy of Testing Library ignores the 15s `asyncUtilTimeout` that preview.tsx sets, so `findByText` waited only 1s. On webkit under load, the root cause prompt renders after that, and MonitorRootCauseScoutForm fails. Import `within` from `@testing-library/dom` and `userEvent` from `@testing-library/user-event`, like most stories do. Generated-By: PostHog Desktop Task-Id: 06f2e6e0-d157-4a5d-be0e-b9ff9276ab93 --- .../frontend/replay_scanners/ReplayScannersScene.stories.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx index 0da166265fac..6195a55ac063 100644 --- a/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx +++ b/products/replay_vision/frontend/replay_scanners/ReplayScannersScene.stories.tsx @@ -1,4 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react' +import { within } from '@testing-library/dom' +import userEvent from '@testing-library/user-event' import { FEATURE_FLAGS } from 'lib/constants' import { App } from 'scenes/App' @@ -13,8 +15,6 @@ import { sessionFrameResponse } from '~/mocks/fixtures/sessionFrame' import { RecordingsQuery } from '~/queries/schema/schema-general' import { StartupProgramLabel } from '~/types' -import { userEvent, within } from 'storybook/test' - import { LONG, LONG_INACTIVE, summary as timelineSummary } from '../__mocks__/recordingTimelineObservations' import type { BackfillEstimateResponseApi, From b31f0e287fb74b044d0cd1a17716bac68e36e8ea Mon Sep 17 00:00:00 2001 From: Shy Alter Date: Sun, 4 Oct 2026 08:37:30 +0200 Subject: [PATCH 2/2] fix(replay-vision): declare @testing-library/dom for the scanner stories The story file now imports `within` from `@testing-library/dom`. pnpm resolves only declared packages, so TypeScript could not find the module. Declare it as a peer dependency, as other product packages do. Generated-By: PostHog Desktop Task-Id: 06f2e6e0-d157-4a5d-be0e-b9ff9276ab93 --- pnpm-lock.yaml | 3 +++ products/replay_vision/package.json | 1 + 2 files changed, 4 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 94c276113c24..9056db2dd933 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4619,6 +4619,9 @@ importers: '@storybook/react': specifier: 'catalog:' version: 10.4.6(@types/react-dom@18.3.7(@types/react@18.3.27))(@types/react@18.3.27)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.4.6(@testing-library/dom@10.4.0)(@types/react@18.3.27)(prettier@3.8.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(typescript@6.0.3) + '@testing-library/dom': + specifier: '*' + version: 10.4.0 '@types/react': specifier: 18.3.27 version: 18.3.27 diff --git a/products/replay_vision/package.json b/products/replay_vision/package.json index 428620709e03..599738f9e1f3 100644 --- a/products/replay_vision/package.json +++ b/products/replay_vision/package.json @@ -23,6 +23,7 @@ "@posthog/icons": "catalog:", "@posthog/lemon-ui": "*", "@storybook/react": "catalog:", + "@testing-library/dom": "*", "@types/react": "*", "clsx": "*", "react": "*",