このコミットが含まれているのは:
2026-10-31 23:30:45 +09:00
コミット 6afbab8eee
8個のファイルの変更、137行の追加、79行の削除
+8 -3
ファイルの表示
@@ -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 ([