このコミットが含まれているのは:
@@ -35,15 +35,20 @@ describe ('Help prefetch integration', () => {
|
||||
})
|
||||
|
||||
it ('loads and reuses the same MDX module for repeated prefetch and display', async () => {
|
||||
const client = new QueryClient ()
|
||||
const loader = helpFixture.modules['../../help/guide/editions/ja/2026-10-02.mdx']
|
||||
const { queryClient } = renderWithProviders (
|
||||
<>
|
||||
<PrefetchLink to="/help/guide">Help</PrefetchLink>
|
||||
<Routes>
|
||||
<Route path="/" element={null}/>
|
||||
<Route path="/help/:identifier" element={<HelpDetailPage/>}/>
|
||||
</Routes>
|
||||
</>)
|
||||
const loader = helpFixture.moduleLoads['../../help/guide/editions/ja/2026-10-02.mdx']
|
||||
await Promise.all ([
|
||||
prefetchers.prefetchForURL (client, '/help/guide'),
|
||||
prefetchers.prefetchForURL (client, '/help/guide')])
|
||||
prefetchers.prefetchForURL (queryClient, '/help/guide'),
|
||||
prefetchers.prefetchForURL (queryClient, '/help/guide')])
|
||||
expect (loader).toHaveBeenCalledTimes (1)
|
||||
renderWithProviders (
|
||||
<Routes><Route path="/help/:identifier" element={<HelpDetailPage/>}/></Routes>,
|
||||
{ route: '/help/guide' })
|
||||
fireEvent.click (screen.getByRole ('link', { name: 'Help' }))
|
||||
await screen.findByRole ('heading', { name: 'ホーム' })
|
||||
expect (loader).toHaveBeenCalledTimes (1)
|
||||
})
|
||||
@@ -68,7 +73,7 @@ describe ('Help prefetch integration', () => {
|
||||
.toHaveBeenCalled ()
|
||||
})
|
||||
|
||||
it.each (['intent', 'click', 'off']) ('respects %s intent settings and still prefetches clicks',
|
||||
it.each (['intent', 'off', 'click']) ('respects %s intent settings and still prefetches clicks',
|
||||
async mode => {
|
||||
settings.linkPreload = mode
|
||||
const run = vi.spyOn (prefetchers, 'prefetchForURL').mockResolvedValue ()
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする