mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-15 09:44:53 +01:00
29 lines
751 B
TypeScript
29 lines
751 B
TypeScript
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)
|
|
})
|
|
})
|