1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00
market/tests/unit/AssetModel.test.ts

24 lines
713 B
TypeScript

import AssetModel from '../../src/models/Asset'
import { MetadataMarket } from '../../src/@types/Metadata'
describe('AssetModel', () => {
it('values can be reassigned', () => {
const newMeta: MetadataMarket = {
main: Object.assign(AssetModel.main, {
name: 'Hello'
}),
additionalInformation: Object.assign(AssetModel.additionalInformation, {
description: 'Jelly McJellyfish'
}),
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')
})
})