このコミットが含まれているのは:
@@ -16,6 +16,7 @@ import type { PostImportRow } from '@/lib/postImportSession'
|
||||
import type { DialogueFormAction, DialogueFormControls } from '@/lib/dialogues/useDialogue'
|
||||
|
||||
const api = vi.hoisted (() => ({
|
||||
apiGet: vi.fn (),
|
||||
apiPost: vi.fn (),
|
||||
}))
|
||||
|
||||
@@ -37,6 +38,9 @@ describe ('PostImportResultPage', () => {
|
||||
beforeEach (() => {
|
||||
sessionStorage.clear ()
|
||||
vi.clearAllMocks ()
|
||||
globalThis.URL.createObjectURL = vi.fn (() => 'blob:preview')
|
||||
globalThis.URL.revokeObjectURL = vi.fn ()
|
||||
api.apiGet.mockResolvedValue (new Blob (['img'], { type: 'image/png' }))
|
||||
})
|
||||
|
||||
it ('shows edit and retry only for recoverable failures and shows warnings', () => {
|
||||
@@ -86,6 +90,35 @@ describe ('PostImportResultPage', () => {
|
||||
)).toBeInTheDocument ()
|
||||
})
|
||||
|
||||
it ('shows hour-precision original-created ranges with the shared utility output', () => {
|
||||
const from = '2024-01-01T12:00:00Z'
|
||||
const before = '2024-01-01T13:00:00Z'
|
||||
savePostImportSession ('result-hour-range', {
|
||||
source: '',
|
||||
repairMode: 'all',
|
||||
rows: [buildPostImportRow ({
|
||||
sourceRow: 1,
|
||||
importStatus: 'created',
|
||||
createdPostId: 1,
|
||||
attributes: {
|
||||
title: 'created row',
|
||||
originalCreatedFrom: from,
|
||||
originalCreatedBefore: before } })] })
|
||||
|
||||
render (
|
||||
<HelmetProvider>
|
||||
<MemoryRouter initialEntries={['/posts/import/result-hour-range/result']}>
|
||||
<Routes>
|
||||
<Route
|
||||
path="/posts/import/:sessionId/result"
|
||||
element={<PostImportResultPage user={buildUser ()}/>}/>
|
||||
</Routes>
|
||||
</MemoryRouter>
|
||||
</HelmetProvider>)
|
||||
|
||||
expect (screen.getByText (originalCreatedAtString (from, before))).toBeInTheDocument ()
|
||||
})
|
||||
|
||||
it ('keeps recoverable pending rows actionable and hides actions for hard failures', () => {
|
||||
savePostImportSession ('result-pending', {
|
||||
source: '',
|
||||
|
||||
新しい課題から参照
ユーザをブロックする