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