Skip to content

Commit 7c78669

Browse files
committed
fix some tests
1 parent aa01961 commit 7c78669

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/containers/Header/test/Search.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { render, screen, cleanup, fireEvent } from '@testing-library/react'
22
import { I18nextProvider } from 'react-i18next'
33
import { BrowserRouter as Router } from 'react-router-dom'
4+
import { QueryClientProvider } from 'react-query'
45
import i18n from '../../../i18n/testConfig'
56
import { Search } from '../Search'
67
import * as rippled from '../../../rippled/lib/rippled'

src/containers/shared/components/test/DomainLink.test.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ describe('DomainLink', () => {
6767

6868
it('handles domain link with protocol removal', () => {
6969
const url = 'https://example.com/'
70-
const wrapper = mount(<DomainLink domain={url} keepProtocol={false} />)
71-
expect(wrapper.find('a').props().className).toEqual('domain')
72-
expect(wrapper.find('a').text()).toEqual('example.com')
73-
expect(wrapper.find('a').props().href).toEqual('https://example.com/')
70+
const { container } = render(
71+
<DomainLink domain={url} keepProtocol={false} />,
72+
)
73+
expect(container).toHaveTextContent('example.com')
74+
expect(screen.getByText('example.com')).toHaveAttribute('href', url)
75+
expect(screen.getByText('example.com')).toHaveClass('domain')
7476
})
7577
})

0 commit comments

Comments
 (0)