From a57d6610e253a3bc503285a9bea28d901d201122 Mon Sep 17 00:00:00 2001 From: Ahmed Ali Date: Fri, 3 Jul 2020 14:03:49 +0200 Subject: [PATCH] add test --- src/metadatastore/MetadataStore.ts | 8 ++++---- test/integration/Marketplaceflow.test.ts | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/metadatastore/MetadataStore.ts b/src/metadatastore/MetadataStore.ts index 39c754f1..e1a3182f 100644 --- a/src/metadatastore/MetadataStore.ts +++ b/src/metadatastore/MetadataStore.ts @@ -316,17 +316,17 @@ export class MetadataStore { } public async getOwnerAssets(owner: string): Promise { - const query = { + let q = { offset: 100, page: 1, query: { - 'publickey.id.owner': owner + 'publicKey.owner': [owner] }, sort: { value: 1 } - } - return (await this.queryMetadata(query)).results + } as SearchQuery + return (await this.queryMetadata(q)).results } /** diff --git a/test/integration/Marketplaceflow.test.ts b/test/integration/Marketplaceflow.test.ts index a1aff244..2cd6e44b 100644 --- a/test/integration/Marketplaceflow.test.ts +++ b/test/integration/Marketplaceflow.test.ts @@ -181,5 +181,11 @@ describe('Marketplace flow', () => { ) }) }) + it ('owner can list there assets', async () => { + const assets = await ocean.assets.ownerAssets( + alice.getId() + ) + assert(assets.length > 0) + }) }) })