1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 09:44:53 +01:00
market/tests/unit/pages/explore.test.tsx

29 lines
751 B
TypeScript
Raw Normal View History

2020-05-07 08:03:30 +02:00
import React from 'react'
import { render } from '@testing-library/react'
import Explore, { getServerSideProps } from '../../../src/pages/explore'
import ddo from '../__fixtures__/ddo'
import { DDO } from '@oceanprotocol/squid'
const asset = new DDO(ddo)
const queryResult = {
results: [asset, asset, asset, asset, asset, asset].map(
asset => new DDO(asset)
),
page: 1,
totalPages: 100,
totalResults: 1000
}
describe('Explore', () => {
it('renders without crashing', () => {
const { container } = render(
<Explore queryResult={JSON.stringify(queryResult)} />
)
expect(container.firstChild).toBeInTheDocument()
})
it('getServerSideProps', () => {
getServerSideProps({ query: { page: '1' } } as any)
})
})