Skip to content

Commit

Permalink
migrate NFT Details
Browse files Browse the repository at this point in the history
  • Loading branch information
mvadari committed Nov 1, 2024
1 parent 9452083 commit 9a88aba
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/containers/NFT/NFTHeader/test/Details.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mount } from 'enzyme'
import { render, screen, cleanup } from '@testing-library/react'
import { I18nextProvider } from 'react-i18next'
import { BrowserRouter } from 'react-router-dom'
import { Details } from '../Details'
Expand All @@ -25,8 +25,8 @@ describe('NFT Details container', () => {
domain: '123456',
}

const createWrapper = (data = dataDefault) =>
mount(
const renderComponent = (data = dataDefault) =>
render(
<I18nextProvider i18n={i18n}>
<BrowserRouter>
<Details data={data} />
Expand All @@ -35,21 +35,15 @@ describe('NFT Details container', () => {
)

it('renders without crashing', () => {
const wrapper = createWrapper()
wrapper.unmount()
renderComponent()
})

it('renders defined fields', () => {
const wrapper = createWrapper()
expect(wrapper.find('.row').length).toEqual(7)
expect(wrapper.text()).toEqual(
expect.stringContaining(
'ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi',
),
const { container } = renderComponent()
expect(screen.queryAllByRole('row')).toHaveLength(7)
expect(container).toHaveTextContent(
'ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi',
)
expect(wrapper.text()).toEqual(
expect.stringContaining('rhSigFwZ9UnbiKbpaco8aSQUsNFXJVz51W'),
)
wrapper.unmount()
expect(container).toHaveTextContent('rhSigFwZ9UnbiKbpaco8aSQUsNFXJVz51W')
})
})

0 comments on commit 9a88aba

Please sign in to comment.