mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
add test
This commit is contained in:
parent
2756f5a019
commit
a57d6610e2
@ -316,17 +316,17 @@ export class MetadataStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async getOwnerAssets(owner: string): Promise<DDO[]> {
|
public async getOwnerAssets(owner: string): Promise<DDO[]> {
|
||||||
const query = {
|
let q = {
|
||||||
offset: 100,
|
offset: 100,
|
||||||
page: 1,
|
page: 1,
|
||||||
query: {
|
query: {
|
||||||
'publickey.id.owner': owner
|
'publicKey.owner': [owner]
|
||||||
},
|
},
|
||||||
sort: {
|
sort: {
|
||||||
value: 1
|
value: 1
|
||||||
}
|
}
|
||||||
}
|
} as SearchQuery
|
||||||
return (await this.queryMetadata(query)).results
|
return (await this.queryMetadata(q)).results
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user