1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-15 09:44:53 +01:00
market/tests/unit/AssetModel.test.ts

24 lines
713 B
TypeScript
Raw Normal View History

2020-05-07 08:03:30 +02:00
import AssetModel from '../../src/models/Asset'
2020-06-02 11:15:21 +02:00
import { MetaDataMarket } from '../../src/@types/MetaData'
2020-05-07 08:03:30 +02:00
describe('AssetModel', () => {
it('values can be reassigned', () => {
2020-06-02 11:15:21 +02:00
const newMeta: MetaDataMarket = {
2020-05-07 08:03:30 +02:00
main: Object.assign(AssetModel.main, {
name: 'Hello'
}),
additionalInformation: Object.assign(AssetModel.additionalInformation, {
description: 'Jelly McJellyfish'
2020-05-07 08:03:30 +02:00
}),
curation: Object.assign(AssetModel.curation, {
numVotes: 100,
rating: 5
})
}
expect(newMeta).toMatchObject(AssetModel)
expect(newMeta.main.name).toBe('Hello')
expect(newMeta.additionalInformation.description).toBe('Jelly McJellyfish')
2020-05-07 08:03:30 +02:00
})
})