1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 01:34:57 +01:00
market/tests/unit/pages/publish.test.tsx

43 lines
976 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 Publish from '../../../src/pages/publish'
import web3ProviderMock from '../__mocks__/web3provider'
2020-06-05 15:39:17 +02:00
import oceanMock from '../__mocks__/ocean-mock'
// eslint-disable-next-line
jest.mock('@oceanprotocol/react', () => ({
useOcean: () => {
return {
ocean: oceanMock
}
},
useWeb3: () => {
return {
web3: web3ProviderMock,
account: '0x0000000011111111aaaaaaaabbbbbbbb22222222',
ethProviderStatus: 1
}
},
useConsume: () => {
return {
consume: () => null as any,
consumeStepText: '',
isLoading: false
}
},
useMetadata: () => {
return {
getCuration: () => {
return Promise.resolve({ rating: 0, numVotes: 0 })
}
}
}
}))
2020-05-07 08:03:30 +02:00
describe('Home', () => {
it('renders without crashing', () => {
2020-06-05 15:39:17 +02:00
const { container } = render(<Publish />)
2020-05-07 08:03:30 +02:00
expect(container.firstChild).toBeInTheDocument()
})
})