このコミットが含まれているのは:
@@ -1,10 +1,10 @@
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import { act, render, screen, 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 App from '@/App'
|
||||
import App, { pageRoutes } from '@/App'
|
||||
import { helpFixture } from '@/test/helpFixtures'
|
||||
|
||||
vi.hoisted (() => {
|
||||
@@ -28,12 +28,17 @@ describe ('Help global edition history', () => {
|
||||
})
|
||||
|
||||
it ('routes /help/changes to published editions in date and numeric order', async () => {
|
||||
// Resolve the real lazy route before waiting for its asynchronously loaded data.
|
||||
const route = pageRoutes (null, () => {}).find (route => route.path === 'help/changes')!
|
||||
expect (route.handle?.preload).toBeTypeOf ('function')
|
||||
await act (async () => { await route.handle!.preload! ('ja') })
|
||||
const client = new QueryClient ({ defaultOptions: { queries: { retry: false } } })
|
||||
const { container } = render (
|
||||
<QueryClientProvider client={client}>
|
||||
<HelmetProvider><App/></HelmetProvider>
|
||||
</QueryClientProvider>)
|
||||
const links = await screen.findAllByRole ('link')
|
||||
const table = await screen.findByRole ('table')
|
||||
const links = within (table).getAllByRole ('link')
|
||||
const editions = links.map (link => link.getAttribute ('href'))
|
||||
.filter (href => href?.startsWith ('/ja/help/') && href.includes ('edition='))
|
||||
expect (editions).toEqual ([
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする