このコミットが含まれているのは:
2026-11-01 01:12:29 +09:00
コミット 8a4c1d1220
5個のファイルの変更、43行の追加、10行の削除
+9 -1
ファイルの表示
@@ -1,9 +1,10 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { act, render, screen, within } from '@testing-library/react'
import { act, render, screen, waitFor, within } from '@testing-library/react'
import { HelmetProvider } from 'react-helmet-async'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { apiGet } from '@/lib/api'
import { helpKeys } from '@/lib/queryKeys'
import App, { pageRoutes } from '@/App'
import { helpFixture } from '@/test/helpFixtures'
@@ -37,6 +38,13 @@ describe ('Help global edition history', () => {
<QueryClientProvider client={client}>
<HelmetProvider><App/></HelmetProvider>
</QueryClientProvider>)
// Wait for the query started by the actual route, separately from DOM discovery.
await waitFor (() => expect (client.getQueryCache ().find ({
queryKey: helpKeys.changes ('ja') })).toBeDefined ())
const changes = client.getQueryCache ().find ({ queryKey: helpKeys.changes ('ja') })
await act (async () => { await changes!.promise })
expect (changes!.state.status).toBe ('success')
expect (changes!.state.data).toHaveLength (6)
const table = await screen.findByRole ('table')
const links = within (table).getAllByRole ('link')
const editions = links.map (link => link.getAttribute ('href'))