このコミットが含まれているのは:
@@ -38,12 +38,18 @@ describe ('PostImportThumbnailPreview', () => {
|
||||
it ('does not render the unsafe URL directly when preview fetching fails', async () => {
|
||||
api.apiGet.mockRejectedValueOnce (new Error ('unsafe'))
|
||||
|
||||
render (
|
||||
const { container } = render (
|
||||
<PostImportThumbnailPreview
|
||||
url="http://127.0.0.1/private.png"
|
||||
className="h-10 w-10"/>)
|
||||
|
||||
expect (await screen.findByText ('サムネールを表示できません')).toBeInTheDocument ()
|
||||
await waitFor (() => {
|
||||
expect (screen.queryByRole ('img')).toBeNull ()
|
||||
})
|
||||
expect (screen.queryByText ('サムネールを表示できません')).toBeNull ()
|
||||
expect (screen.queryByText ('なし')).toBeNull ()
|
||||
expect (container.querySelector ('div.rounded.border.bg-muted')).not.toBeNull ()
|
||||
expect (container.textContent).toBe ('')
|
||||
expect (screen.queryByRole ('img')).toBeNull ()
|
||||
})
|
||||
|
||||
|
||||
新しい課題から参照
ユーザをブロックする