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

77 lines
2.1 KiB
TypeScript
Raw Normal View History

2019-05-31 12:56:13 +02:00
const oceanMock = {
ocean: {
accounts: {
list: () => ['xxx', 'xxx']
},
aquarius: {
queryMetadata: () => {
return {
results: [],
totalResults: 1,
totalPages: 1
}
}
},
2019-05-31 13:53:05 +02:00
assets: {
2019-12-07 13:55:08 +01:00
query: () => {
return {
results: [],
page: 1,
/* eslint-disable @typescript-eslint/camelcase */
total_pages: 1611,
total_results: 1611
/* eslint-enable @typescript-eslint/camelcase */
}
},
2019-05-31 13:53:05 +02:00
resolve: jest.fn(),
order: () => {
return {
next: jest.fn()
}
},
consume: jest.fn()
},
2019-05-31 12:56:13 +02:00
keeper: {
conditions: {
accessSecretStoreCondition: {
2019-05-31 13:53:05 +02:00
getGrantedDidByConsumer: () => {
return {
find: jest.fn()
}
}
2019-05-31 12:56:13 +02:00
}
}
},
versions: {
get: jest.fn(() =>
Promise.resolve({
squid: {
name: 'Squid-js',
status: 'Working'
},
aquarius: {
name: 'Aquarius',
status: 'Working'
},
brizo: {
name: 'Brizo',
network: 'Nile',
status: 'Working',
contracts: {
hello: 'hello',
hello2: 'hello2'
}
},
status: {
ok: true,
network: true,
contracts: true
}
})
)
2019-05-31 12:56:13 +02:00
}
}
}
export default oceanMock