1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

categories search link on asset details, test fix

This commit is contained in:
Matthias Kretschmann 2019-05-15 17:25:53 +02:00
parent 7fc99699c7
commit 92721702a0
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 12 additions and 3 deletions

View File

@ -46,8 +46,9 @@ export default class AssetDetails extends PureComponent<AssetDetailsProps> {
</span>
{base.categories && (
// TODO: Make this link to search for respective category
<Link to={`/search?text=${base.categories[0]}`}>
<Link
to={`/search?categories=${base.categories[0]}`}
>
{base.categories[0]}
</Link>
)}

View File

@ -1,10 +1,18 @@
import React from 'react'
import { Router } from 'react-router'
import { createBrowserHistory } from 'history'
import { render } from 'react-testing-library'
import Home from './Home'
const history = createBrowserHistory()
describe('Home', () => {
it('renders without crashing', () => {
const { container } = render(<Home history={''} />)
const { container } = render(
<Router history={history}>
<Home history={history} />
</Router>
)
expect(container.firstChild).toBeInTheDocument()
})
})