1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-14 09:14:52 +01:00
This commit is contained in:
mihaisc 2020-05-19 12:20:18 +03:00
parent 5703cbecac
commit 6529636caf
3 changed files with 12 additions and 24 deletions

View File

@ -37,22 +37,26 @@ const ddo: Partial<DDO> = {
{ {
index: 0, index: 0,
contentType: 'csv', contentType: 'csv',
contentLength: '114000' contentLength: '114000',
url: ''
}, },
{ {
index: 1, index: 1,
contentType: 'excel', contentType: 'excel',
contentLength: '219000' contentLength: '219000',
url: ''
}, },
{ {
index: 2, index: 2,
contentType: 'csv', contentType: 'csv',
contentLength: '1300000' contentLength: '1300000',
url: ''
}, },
{ {
index: 3, index: 3,
contentType: 'csv', contentType: 'csv',
contentLength: '36300' contentLength: '36300',
url: ''
} }
] ]
}, },
@ -60,7 +64,6 @@ const ddo: Partial<DDO> = {
description: description:
'What a Waste is a global project to aggregate data on solid waste management from around the world. This database features the statistics collected through the effort, covering nearly all countries and over 330 cities. The metrics included cover all steps from the waste management value chain, including waste generation, composition, collection, and disposal, as well as information on user fees and financing, the informal sector, administrative structures, public communication, and legal information. The information presented is the best available based on a study of current literature and limited conversations with waste agencies and authorities. While there may be variations in the definitions and quality of reporting for individual data points, general trends should reflect the global reality. All sources and any estimations are noted.', 'What a Waste is a global project to aggregate data on solid waste management from around the world. This database features the statistics collected through the effort, covering nearly all countries and over 330 cities. The metrics included cover all steps from the waste management value chain, including waste generation, composition, collection, and disposal, as well as information on user fees and financing, the informal sector, administrative structures, public communication, and legal information. The information presented is the best available based on a study of current literature and limited conversations with waste agencies and authorities. While there may be variations in the definitions and quality of reporting for individual data points, general trends should reflect the global reality. All sources and any estimations are noted.',
copyrightHolder: 'World Bank Group', copyrightHolder: 'World Bank Group',
categories: ['Earth & Climate'],
tags: ['Sustainability', ' Climate', ' Energy', ' ai-for-good'], tags: ['Sustainability', ' Climate', ' Energy', ' ai-for-good'],
links: [ links: [
{ {
@ -71,9 +74,9 @@ const ddo: Partial<DDO> = {
deliveryType: 'files', deliveryType: 'files',
termsAndConditions: true, termsAndConditions: true,
dateRange: ['2018-09-20T08:38:58', '2019-12-11T05:19:42'], dateRange: ['2018-09-20T08:38:58', '2019-12-11T05:19:42'],
granularity: 'hourly',
supportName: 'Jelly McJellyfish', supportName: 'Jelly McJellyfish',
supportEmail: 'jelly@oceanprotocol.com' supportEmail: 'jelly@oceanprotocol.com',
access: 'Download'
}, },
curation: { curation: {
numVotes: 100, numVotes: 100,

View File

@ -6,8 +6,6 @@ const testFormData: PublishFormDataInterface = {
license: '', license: '',
price: 0, price: 0,
title: '', title: '',
granularity: 'hourly',
category: 'test',
summary: 'summary', summary: 'summary',
termsAndConditions: true termsAndConditions: true
} }

View File

@ -15,12 +15,7 @@ describe('Search', () => {
totalResults: 200 totalResults: 200
} }
const { container } = render( const { container } = render(
<Search <Search text="Hello" tag="Hello" queryResult={queryResult} />
text="Hello"
categories={['Hello']}
tag="Hello"
queryResult={queryResult}
/>
) )
expect(container.firstChild).toBeInTheDocument() expect(container.firstChild).toBeInTheDocument()
@ -55,12 +50,7 @@ describe('Search', () => {
totalResults: 0 totalResults: 0
} }
const { container } = render( const { container } = render(
<Search <Search text="Hello" tag="Hello" queryResult={queryResult} />
text="Hello"
categories={['Hello']}
tag="Hello"
queryResult={queryResult}
/>
) )
expect(container.querySelector('.empty')).toBeInTheDocument() expect(container.querySelector('.empty')).toBeInTheDocument()
}) })
@ -72,14 +62,12 @@ describe('Search.getInitialProps', () => {
context: Partial<NextPageContext> context: Partial<NextPageContext>
) => { ) => {
text: string text: string
categories: string[]
tag: string tag: string
queryResult: QueryResult queryResult: QueryResult
} }
const context = { const context = {
query: { query: {
text: 'text', text: 'text',
categories: '["category"]',
tag: 'tag', tag: 'tag',
page: '1', page: '1',
offset: '1' offset: '1'
@ -87,7 +75,6 @@ describe('Search.getInitialProps', () => {
} }
const props = await getInitialProps(context) const props = await getInitialProps(context)
expect(props.text).toEqual('text') expect(props.text).toEqual('text')
expect(props.categories).toEqual(['category'])
expect(props.tag).toEqual('tag') expect(props.tag).toEqual('tag')
}) })
}) })