このコミットが含まれているのは:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { creatableImportRows,
|
||||
buildNextEditedRow,
|
||||
canEditResultRow,
|
||||
canEditReviewRow,
|
||||
canRetryResultRow,
|
||||
@@ -250,4 +251,38 @@ describe ('post import row state', () => {
|
||||
expect (initialised.resetSnapshot.attributes.title).toBe ('')
|
||||
expect (initialised.resetSnapshot.fieldWarnings.title).toEqual (['warning'])
|
||||
})
|
||||
|
||||
it ('builds the next edited row with shared repair semantics', () => {
|
||||
const row = buildPostImportRow ({
|
||||
url: 'https://example.com/original',
|
||||
importStatus: 'failed',
|
||||
recoverable: true,
|
||||
importErrors: { base: ['failed'] },
|
||||
attributes: { title: 'old title', tags: 'old-tag', duration: '2' },
|
||||
provenance: { title: 'automatic', tags: 'automatic', url: 'manual' },
|
||||
tagSources: { automatic: 'old-tag', manual: '' } })
|
||||
|
||||
const nextRow = buildNextEditedRow (
|
||||
row,
|
||||
{
|
||||
url: 'https://example.com/edited',
|
||||
title: 'edited title',
|
||||
thumbnailBase: '',
|
||||
originalCreatedFrom: '',
|
||||
originalCreatedBefore: '',
|
||||
duration: '2.5',
|
||||
tags: 'edited-tag',
|
||||
parentPostIds: '' },
|
||||
true)
|
||||
|
||||
expect (nextRow.importStatus).toBe ('pending')
|
||||
expect (nextRow.importErrors).toBeUndefined ()
|
||||
expect (nextRow.url).toBe ('https://example.com/edited')
|
||||
expect (nextRow.attributes.title).toBe ('edited title')
|
||||
expect (nextRow.attributes.duration).toBe ('2.5')
|
||||
expect (nextRow.attributes.tags).toBe ('edited-tag')
|
||||
expect (nextRow.provenance.title).toBe ('manual')
|
||||
expect (nextRow.provenance.url).toBe ('manual')
|
||||
expect (nextRow.tagSources?.manual).toBe ('edited-tag')
|
||||
})
|
||||
})
|
||||
|
||||
新しい課題から参照
ユーザをブロックする