mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
adapt unit tests
This commit is contained in:
parent
2201ebb997
commit
12bd56e5f9
@ -127,20 +127,24 @@ describe("Ocean", () => {
|
||||
const publisher = accounts[0]
|
||||
const consumer = accounts[1]
|
||||
|
||||
const ddo: DDO = await ocean.registerAsset(new MetaData(), publisher)
|
||||
const metaData = new MetaData()
|
||||
const ddo: DDO = await ocean.registerAsset(metaData, publisher)
|
||||
|
||||
const service: Service = ddo.findServiceByType("Access")
|
||||
|
||||
// @ts-ignore
|
||||
WebServiceConnectorProvider.setConnector(new WebServiceConnectorMock(ddo))
|
||||
|
||||
const serviceAgreementSignature: any = await ocean.signServiceAgreement(ddo.id,
|
||||
await consumer.requestTokens(metaData.base.price)
|
||||
|
||||
const signServiceAgreementResult: any = await ocean.signServiceAgreement(ddo.id,
|
||||
service.serviceDefinitionId, consumer)
|
||||
|
||||
assert(serviceAgreementSignature)
|
||||
assert(serviceAgreementSignature.serviceAgreementId)
|
||||
assert(serviceAgreementSignature.serviceAgreementSignature)
|
||||
assert(serviceAgreementSignature.serviceAgreementSignature.startsWith("0x"))
|
||||
assert(signServiceAgreementResult)
|
||||
assert(signServiceAgreementResult.serviceAgreementId, "no serviceAgreementId")
|
||||
assert(signServiceAgreementResult.serviceAgreementSignature, "no serviceAgreementSignature")
|
||||
assert(signServiceAgreementResult.serviceAgreementSignature.startsWith("0x"))
|
||||
assert(signServiceAgreementResult.serviceAgreementSignature.length === 132)
|
||||
})
|
||||
|
||||
})
|
||||
|
@ -71,6 +71,7 @@ describe("ServiceAgreement", () => {
|
||||
|
||||
assert(serviceAgreementSignature)
|
||||
assert(serviceAgreementSignature.startsWith("0x"))
|
||||
assert(serviceAgreementSignature.length === 132)
|
||||
})
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user