このコミットが含まれているのは:
@@ -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'))
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする