このコミットが含まれているのは:
2026-10-29 21:38:38 +09:00
コミット 237331481f
11個のファイルの変更、56行の追加、26行の削除
+2 -1
ファイルの表示
@@ -336,7 +336,8 @@ test ('counts SSR uses query/definitions, noindex and the common site title', as
for (const locale of ['ja', 'ain-Kana']) {
for (const resource of ['posts', 'tags']) {
const column = resource === 'posts' ? 'title' : (locale === 'ja' ? 'name_ja' : 'name_ain')
const query = `definition=history&mode=details&columns=resource_id+${column}&user_id=4`
const query =
`definition=history&mode=details&columns=resource_id+${ column }&user_id=4&timezone=UTC`
const result = await renderPage (`/${locale}/counts/${resource}?${query}`, origin, apiURL)
assert.equal (result.status, 200)
assert.match (result.html, /SSR count/)
+2 -1
ファイルの表示
@@ -9,11 +9,12 @@ import { renderWithProviders } from '@/test/render'
import type { CountField } from '@/lib/counts'
const renderTable = () => renderWithProviders (<CountsTableLayout>
<CountsSelectableTable family="details" columns={['resource_id', 'version_no']}
identity="stable" name={{ text: 'Grid', language: 'en' }}>
<tbody>
<tr><td><span>first</span> <span>cell</span></td><td>second</td></tr>
<tr><td data-counts-copy="first cell"><span>first</span> <span>cell</span></td><td>second</td></tr>
<tr><td>third</td><td><input aria-label="editor" defaultValue="editable"/></td></tr>
</tbody>
</CountsSelectableTable>
+2 -2
ファイルの表示
@@ -28,7 +28,7 @@ describe ('locale URL generation', () => {
'/tos', '/gekanator', '/more']) ('localises and redirects %s', pathname => {
const location = { pathname, search: '?page=2&tag=a%23b', hash: '#section' }
expect (localiseTo (pathname, 'ain-Kana')).toBe (`/ain-Kana${ pathname }`)
expect (legacyLocalePath (location)).toBe (`/ja${ pathname }${ location.search }#section`)
expect (legacyLocalePath (location, () => true)).toBe (`/ja${ pathname }${ location.search }#section`)
expect (unlocalisedPath (`/ain-Kana${ pathname }`)).toBe (pathname)
})
@@ -50,6 +50,6 @@ describe ('locale URL generation', () => {
it.each (['/en/posts', '/ain/posts', '/unknown', '/api/tags', '/assets/image.png']) (
'does not redirect invalid or non-page paths: %s', pathname => {
expect (legacyLocalePath ({ pathname, search: '', hash: '' })).toBeNull ()
expect (legacyLocalePath ({ pathname, search: '', hash: '' }, () => false)).toBeNull ()
})
})
+4 -5
ファイルの表示
@@ -29,11 +29,10 @@ vi.mock ('@/components/PostEditForm', () => ({
default: () => <div>Post edit form</div>,
}))
vi.mock ('framer-motion', () => ({
motion: {
div: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
main: ({ children }: { children?: ReactNode }) => <main>{children}</main>,
},
}))
useReducedMotion: () => false,
motion: {
div: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
main: ({ children }: { children?: ReactNode }) => <main>{children}</main> } }))
const renderPage = (user = buildUser ({ role: 'member' })) =>
renderWithProviders (
+5 -4
ファイルの表示
@@ -15,10 +15,11 @@ const api = vi.hoisted (() => ({
vi.mock ('@/lib/api', () => api)
vi.mock ('framer-motion', () => ({
AnimatePresence: ({ children }: { children?: ReactNode }) => <>{children}</>,
motion: {
div: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
main: ({ children }: { children?: ReactNode }) => <main>{children}</main> } }))
AnimatePresence: ({ children }: { children?: ReactNode }) => <>{children}</>,
useReducedMotion: () => false,
motion: {
div: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
main: ({ children }: { children?: ReactNode }) => <main>{children}</main> } }))
const metadata = (url: string, title: string) => ({
url,
+5 -6
ファイルの表示
@@ -65,12 +65,11 @@ vi.mock ('@/components/PostEditForm', () => ({
default: () => <div>Post edit form</div>,
}))
vi.mock ('framer-motion', () => ({
motion: {
aside: ({ children }: { children?: ReactNode }) => <aside>{children}</aside>,
div: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
main: ({ children }: { children?: ReactNode }) => <main>{children}</main>,
},
}))
useReducedMotion: () => false,
motion: {
aside: ({ children }: { children?: ReactNode }) => <aside>{children}</aside>,
div: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
main: ({ children }: { children?: ReactNode }) => <main>{children}</main> } }))
const currentPost = buildPost ({
id: 10,