2020-05-07 08:03:30 +02:00
|
|
|
import AssetModel from '../../src/models/Asset'
|
2020-10-01 17:13:19 +02:00
|
|
|
import { MetadataMarket } from '../../src/@types/MetaData'
|
2020-05-07 08:03:30 +02:00
|
|
|
|
|
|
|
describe('AssetModel', () => {
|
|
|
|
it('values can be reassigned', () => {
|
2020-07-16 13:39:02 +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, {
|
2020-07-09 15:31:47 +02:00
|
|
|
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')
|
2020-07-09 15:31:47 +02:00
|
|
|
expect(newMeta.additionalInformation.description).toBe('Jelly McJellyfish')
|
2020-05-07 08:03:30 +02:00
|
|
|
})
|
|
|
|
})
|