Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 52 additions & 17 deletions schemas/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@
"supply",
"image"
],
"additionalProperties": false,
"properties": {
"price": {
"type": "string"
Expand Down Expand Up @@ -934,25 +935,59 @@
"attributes": {
"type": "array",
"items": {
"type": "object",
"required": [
"title",
"type"
],
"properties": {
"title": {
"type": "string"
},
"type": {
"type": "string"
},
"url": {
"type": "string"
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"title",
"type",
"id",
"owner"
],
"properties": {
"type": {
"type": "string",
"const": "model"
},
"title": {
"type": "string"
},
"id": {
"type": "string",
"format": "uuid"
},
"owner": {
"type": "string"
}
}
},
"id": {
"type": "string"
{
"type": "object",
"additionalProperties": false,
"required": [
"title",
"type",
"imageUrl",
"originalImageUrl"
],
"properties": {
"type": {
"type": "string",
"const": "image"
},
"title": {
"type": "string"
},
"imageUrl": {
"type": "string"
},
"originalImageUrl": {
"type": "string"
}
}
}
}
]
}
}
}
Expand Down
10 changes: 8 additions & 2 deletions test/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,15 @@ const nftMeta = {
supply: 1,
image: 'http://website.com/image.jpeg',
attributes: [{
title: 'test',
title: 'test_image',
type: 'image',
url: 'http://test.com',
imageUrl: 'f47bfb7e0c6ad240046c0c9839e17186/af378b9c-83fb-4be9-a204-e7e690334702/b7b91787-61bc-4e15-a18a-924198dc959f.jpeg',
originalImageUrl: 'f47bfb7e0c6ad240046c0c9839e17186/af378b9c-83fb-4be9-a204-e7e690334702/b7b91787-61bc-4e15-a18a-924198dc959f.jpeg',
}, {
title: 'test_model',
type: 'model',
id: 'eda9b976-b467-4361-b9fc-b9162a14ee76',
owner: 'test_owner',
}],
},
};
Expand Down
45 changes: 39 additions & 6 deletions test/suites/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,15 @@ describe('update suite', function suite() {
supply: 1,
image: 'http://website.com/image.jpeg',
attributes: [{
title: 'test',
title: 'test_image',
type: 'image',
url: 'http://test.com',
imageUrl: 'f47bfb7e0c6ad240046c0c9839e17186/af378b9c-83fb-4be9-a204-e7e690334702/b7b91787-61bc-4e15-a18a-924198dc959f.jpeg',
originalImageUrl: 'f47bfb7e0c6ad240046c0c9839e17186/af378b9c-83fb-4be9-a204-e7e690334702/b7b91787-61bc-4e15-a18a-924198dc959f.jpeg',
}, {
title: 'test_model',
type: 'model',
id: 'eda9b976-b467-4361-b9fc-b9162a14ee76',
owner: 'test_owner',
}],
};

Expand All @@ -486,9 +492,30 @@ describe('update suite', function suite() {
assert.equal(fileInfo.file.nft.currency, 'usd');
assert.equal(fileInfo.file.nft.supply, 1);
assert.equal(fileInfo.file.nft.image, 'http://website.com/image.jpeg');
assert.equal(fileInfo.file.nft.attributes[0].title, 'test');

// Assertions for the first attribute
assert.equal(fileInfo.file.nft.attributes[0].title, 'test_image');
assert.equal(fileInfo.file.nft.attributes[0].type, 'image');
assert.equal(fileInfo.file.nft.attributes[0].url, 'http://test.com');
assert.equal(
fileInfo.file.nft.attributes[0].imageUrl,
'f47bfb7e0c6ad240046c0c9839e17186/af378b9c-83fb-4be9-a204-e7e690334702/b7b91787-61bc-4e15-a18a-924198dc959f.jpeg'
);
assert.equal(
fileInfo.file.nft.attributes[0].originalImageUrl,
'f47bfb7e0c6ad240046c0c9839e17186/af378b9c-83fb-4be9-a204-e7e690334702/b7b91787-61bc-4e15-a18a-924198dc959f.jpeg'
);

// Assertions for the second attribute
assert.equal(fileInfo.file.nft.attributes[1].title, 'test_model');
assert.equal(fileInfo.file.nft.attributes[1].type, 'model');
assert.equal(
fileInfo.file.nft.attributes[1].id,
'eda9b976-b467-4361-b9fc-b9162a14ee76'
);
assert.equal(
fileInfo.file.nft.attributes[1].owner,
'test_owner'
);
});
});

Expand Down Expand Up @@ -670,9 +697,15 @@ describe('update suite', function suite() {
supply: 1,
image: 'http://website.com/image.jpeg',
attributes: [{
title: 'test',
title: 'test_image',
type: 'image',
url: 'http://test.com',
imageUrl: 'f47bfb7e0c6ad240046c0c9839e17186/af378b9c-83fb-4be9-a204-e7e690334702/b7b91787-61bc-4e15-a18a-924198dc959f.jpeg',
originalImageUrl: 'f47bfb7e0c6ad240046c0c9839e17186/af378b9c-83fb-4be9-a204-e7e690334702/b7b91787-61bc-4e15-a18a-924198dc959f.jpeg',
}, {
title: 'test_model',
type: 'model',
id: 'eda9b976-b467-4361-b9fc-b9162a14ee76',
owner: 'test_owner',
}],
},
},
Expand Down