Skip to content

Commit

Permalink
test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kremalicious committed Sep 22, 2020
1 parent 324f021 commit ebfe0c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 35 deletions.
6 changes: 3 additions & 3 deletions test/unit/ddo/DDO.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { assert, expect, spy, use } from 'chai'

import { DDO } from '../../../src/ddo/DDO'
import { Service } from '../../../src/ddo/interfaces/Service'
import { Ocean } from '../../../src/ocean/Ocean'
import Config from '../config'
import { TestContractHandler } from '../../TestContractHandler'
// import { Ocean } from '../../../src/ocean/Ocean'
// import Config from '../config'
// import { TestContractHandler } from '../../TestContractHandler'

import * as jsonDDO from '../__fixtures__/ddo.json'

Expand Down
14 changes: 8 additions & 6 deletions test/unit/metadatastore/MetadataStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { responsify, getSearchResults } from '../helpers'

use(spies)

const dataTokenMock = '0x0000000000000000000000000000000000000000'

describe('MetadataStore', () => {
let ocean: Ocean
let metadataStore: MetadataStore
Expand Down Expand Up @@ -73,9 +75,9 @@ describe('MetadataStore', () => {

describe('#storeDDO()', () => {
it('should store a ddo', async () => {
const did: DID = DID.generate()
const did: DID = DID.generate(dataTokenMock)
const ddo: DDO = new DDO({
id: did.getId()
id: did.getDid()
})

spy.on(metadataStore.fetch, 'post', () => responsify(ddo))
Expand All @@ -88,9 +90,9 @@ describe('MetadataStore', () => {

describe('#retrieveDDO()', () => {
it('should store a ddo', async () => {
const did: DID = DID.generate()
const did: DID = DID.generate(dataTokenMock)
const ddo: DDO = new DDO({
id: did.getId()
id: did.getDid()
})

spy.on(metadataStore.fetch, 'post', () => responsify(ddo))
Expand All @@ -99,12 +101,12 @@ describe('MetadataStore', () => {
const storageResult: DDO = await metadataStore.storeDDO(ddo)
assert(storageResult)

assert(storageResult.id === did.getId())
assert(storageResult.id === did.getDid())

const restrieveResult: DDO = await metadataStore.retrieveDDO(did)
assert(restrieveResult)

assert(restrieveResult.id === did.getId())
assert(restrieveResult.id === did.getDid())
assert(restrieveResult.id === storageResult.id)
})
})
Expand Down
26 changes: 0 additions & 26 deletions test/unit/utils/GeneratorHelpers.test.ts

This file was deleted.

0 comments on commit ebfe0c4

Please sign in to comment.