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

test fixes

This commit is contained in:
Matthias Kretschmann 2020-05-19 10:18:40 +02:00
parent fe37382833
commit 7d09350967
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -3,12 +3,14 @@ import { render } from '@testing-library/react'
import { DDO, MetaData } from '@oceanprotocol/squid' import { DDO, MetaData } from '@oceanprotocol/squid'
import { BrowserRouter as Router } from 'react-router-dom' import { BrowserRouter as Router } from 'react-router-dom'
import AssetDetails, { datafilesLine } from './AssetDetails' import AssetDetails, { datafilesLine } from './AssetDetails'
import oceanMock from '../../../__mocks__/ocean-mock'
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
describe('AssetDetails', () => { describe('AssetDetails', () => {
it('renders loading without crashing', () => { it('renders loading without crashing', () => {
const { container } = render( const { container } = render(
<AssetDetails <AssetDetails
ocean={oceanMock}
metadata={({ main: { name: '' } } as any) as MetaData} metadata={({ main: { name: '' } } as any) as MetaData}
ddo={({} as any) as DDO} ddo={({} as any) as DDO}
/> />
@ -20,6 +22,7 @@ describe('AssetDetails', () => {
const { container } = render( const { container } = render(
<Router> <Router>
<AssetDetails <AssetDetails
ocean={oceanMock}
metadata={ metadata={
({ ({
main: { main: {
@ -46,7 +49,8 @@ describe('AssetDetails', () => {
const files = [ const files = [
{ {
index: 0, index: 0,
url: 'https://hello.com' url: 'https://hello.com',
contentType: 'application/json'
} }
] ]
const { container } = render(datafilesLine(files)) const { container } = render(datafilesLine(files))
@ -57,11 +61,13 @@ describe('AssetDetails', () => {
const files = [ const files = [
{ {
index: 0, index: 0,
url: 'https://hello.com' url: 'https://hello.com',
contentType: 'application/json'
}, },
{ {
index: 1, index: 1,
url: 'https://hello2.com' url: 'https://hello2.com',
contentType: 'application/json'
} }
] ]
const { container } = render(datafilesLine(files)) const { container } = render(datafilesLine(files))