このコミットが含まれているのは:
@@ -66,4 +66,27 @@ describe ('PostEditForm', () => {
|
||||
expect (onSave).toHaveBeenCalledWith (expect.objectContaining ({ versionNo: 5 }))
|
||||
expect (toastApi.toast).toHaveBeenCalledWith ({ description: '更新しました.' })
|
||||
})
|
||||
|
||||
it ('preserves duration while the video tag is temporarily removed', () => {
|
||||
const post = buildPost ({
|
||||
videoMs: 180_500,
|
||||
tags: [
|
||||
buildTag ({ id: 1, name: '動画', category: 'general' }),
|
||||
buildTag ({ id: 2, name: 'general-tag', category: 'general' }),
|
||||
],
|
||||
})
|
||||
|
||||
render (<PostEditForm post={post} onSave={vi.fn ()}/>)
|
||||
|
||||
expect (screen.getByRole ('spinbutton')).toHaveValue (180.5)
|
||||
|
||||
const tags = screen.getAllByRole ('textbox')[2]
|
||||
fireEvent.change (tags, { target: { value: 'general-tag' } })
|
||||
expect (screen.queryByRole ('spinbutton')).not.toBeInTheDocument ()
|
||||
|
||||
fireEvent.change (tags, {
|
||||
target: { value: '動画 general-tag' },
|
||||
})
|
||||
expect (screen.getByRole ('spinbutton')).toHaveValue (180.5)
|
||||
})
|
||||
})
|
||||
|
||||
新しい課題から参照
ユーザをブロックする