File tree Expand file tree Collapse file tree 2 files changed +2130
-0
lines changed
fixtures/npm-registry/packuments Expand file tree Collapse file tree 2 files changed +2130
-0
lines changed Original file line number Diff line number Diff line change 1+ import { expect , test } from './test-utils'
2+
3+ test . describe ( 'Package Replacement Suggestions' , ( ) => {
4+ test ( '/package/strip-ansi shows a replacement suggestion with a link to e18e docs' , async ( {
5+ page,
6+ goto,
7+ } ) => {
8+ await goto ( '/package/strip-ansi' , { waitUntil : 'hydration' } )
9+
10+ // Wait for the package page to load
11+ await expect ( page . locator ( 'h1' ) ) . toContainText ( 'strip-ansi' , { timeout : 15_000 } )
12+
13+ // The replacement component renders a "Learn more" anchor driven by resolveReplacementUrl.
14+ // For strip-ansi the url.type is 'e18e', so the href resolves to:
15+ // https://e18e.dev/docs/replacements/strip-ansi
16+ //
17+ // useLazyFetch is used, so the suggestion arrives after hydration — use a generous timeout.
18+ const replacementLink = page . locator ( 'a[href="https://e18e.dev/docs/replacements/strip-ansi"]' )
19+ await expect ( replacementLink ) . toBeVisible ( { timeout : 15_000 } )
20+ } )
21+ } )
You can’t perform that action at this time.
0 commit comments