mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
test tweaks
This commit is contained in:
parent
645f3c0e13
commit
d8dd744ed9
21
client/__fixtures__/brizo.json
Normal file
21
client/__fixtures__/brizo.json
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"contracts": {
|
||||||
|
"AccessSecretStoreCondition": "0x7FC6520Af3F0800d76A3e2FfE7b838c945ADBFE4",
|
||||||
|
"AgreementStoreManager": "0x44665ee68779eC83202702C091279661336F5F8a",
|
||||||
|
"ConditionStoreManager": "0xbD1dEd7ef05c31F81C54e913a23Da69E77d3e0EE",
|
||||||
|
"DIDRegistry": "0x1f0E059a50356D8617980F8fa21a53F723072712",
|
||||||
|
"EscrowAccessSecretStoreTemplate": "0x9BF43606d833489fbD568ace13f535fC41130c28",
|
||||||
|
"EscrowReward": "0x656Aa3D9b37A6eA770701ae2c612f760d9254A66",
|
||||||
|
"HashLockCondition": "0x5Eef92d570996ED20Cb60fE41475f594299Ec21C",
|
||||||
|
"LockRewardCondition": "0x7bf64DaCc7929A1e5466f7d9E575128abf1875f8",
|
||||||
|
"OceanToken": "0x012578f9381e876A9E2a9111Dfd436FF91A451ae",
|
||||||
|
"SignCondition": "0xB74172078ABb029FaD809335d82241371b998708",
|
||||||
|
"TemplateStoreManager": "0xF2Cf3761c166c6D85d07299427821D18A4329cd1"
|
||||||
|
},
|
||||||
|
"keeper-url": "http://keeper-node.pacific-ocean:8545",
|
||||||
|
"keeper-version": "v0.12.7",
|
||||||
|
"network": "pacific",
|
||||||
|
"provider-address": "0x008C25ED3594E094db4592F4115D5FA74C4f41eA",
|
||||||
|
"software": "Brizo",
|
||||||
|
"version": "0.7.2"
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
import searchMock from '../__fixtures__/search.json'
|
import searchMock from '../__fixtures__/search.json'
|
||||||
|
import brizoMock from '../__fixtures__/brizo.json'
|
||||||
|
|
||||||
const oceanMock = {
|
const oceanMock = {
|
||||||
ocean: {
|
ocean: {
|
||||||
@ -8,17 +9,11 @@ const oceanMock = {
|
|||||||
aquarius: {
|
aquarius: {
|
||||||
queryMetadata: () => searchMock
|
queryMetadata: () => searchMock
|
||||||
},
|
},
|
||||||
|
brizo: {
|
||||||
|
getVersionInfo: () => brizoMock
|
||||||
|
},
|
||||||
assets: {
|
assets: {
|
||||||
query: () => {
|
query: () => searchMock,
|
||||||
return {
|
|
||||||
results: [],
|
|
||||||
page: 1,
|
|
||||||
/* eslint-disable @typescript-eslint/camelcase */
|
|
||||||
total_pages: 1611,
|
|
||||||
total_results: 1611
|
|
||||||
/* eslint-enable @typescript-eslint/camelcase */
|
|
||||||
}
|
|
||||||
},
|
|
||||||
resolve: jest.fn(),
|
resolve: jest.fn(),
|
||||||
order: () => {
|
order: () => {
|
||||||
return {
|
return {
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import { render } from '@testing-library/react'
|
|
||||||
import MarketProvider from './MarketProvider'
|
|
||||||
import { User, Market } from '../context'
|
|
||||||
import { userMockConnected } from '../../__mocks__/user-mock'
|
|
||||||
|
|
||||||
describe('MarketProvider', () => {
|
|
||||||
it('renders without crashing', () => {
|
|
||||||
const { getByTestId } = render(
|
|
||||||
<User.Provider value={userMockConnected}>
|
|
||||||
<MarketProvider ocean={userMockConnected.ocean as any}>
|
|
||||||
<Market.Consumer>
|
|
||||||
{market => (
|
|
||||||
<div data-testid="hello">{market.network}</div>
|
|
||||||
)}
|
|
||||||
</Market.Consumer>
|
|
||||||
</MarketProvider>
|
|
||||||
</User.Provider>
|
|
||||||
)
|
|
||||||
expect(getByTestId('hello')).toBeInTheDocument()
|
|
||||||
})
|
|
||||||
})
|
|
17
client/src/context/UserProvider.test.tsx
Normal file
17
client/src/context/UserProvider.test.tsx
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { render } from '@testing-library/react'
|
||||||
|
import { User } from '../context'
|
||||||
|
import UserProvider from './UserProvider'
|
||||||
|
|
||||||
|
describe('UserProvider', () => {
|
||||||
|
it('renders without crashing', () => {
|
||||||
|
const { getByTestId } = render(
|
||||||
|
<UserProvider>
|
||||||
|
<User.Consumer>
|
||||||
|
{user => <div data-testid="hello">{user.account}</div>}
|
||||||
|
</User.Consumer>
|
||||||
|
</UserProvider>
|
||||||
|
)
|
||||||
|
expect(getByTestId('hello')).toBeInTheDocument()
|
||||||
|
})
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user