Skip to content

Commit

Permalink
fixes + fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
cfaur09 committed Dec 16, 2024
1 parent 7d84e9f commit 58fae71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 52 deletions.
54 changes: 4 additions & 50 deletions src/test/chain-simulator/accounts.cs-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ describe('Accounts e2e tests with chain simulator', () => {
expect(nft.uris.length).toBeGreaterThan(0);
expect(nft.uris).toEqual([
"aHR0cHM6Ly9leGFtcGxlLmNvbS9uZnQucG5n",
"aHR0cHM6Ly9leGFtcGxlLmNvbS9uZnQuanNvbg=="
"aHR0cHM6Ly9leGFtcGxlLmNvbS9uZnQuanNvbg==",
]);
}
});
Expand Down Expand Up @@ -1756,7 +1756,7 @@ describe('Accounts e2e tests with chain simulator', () => {
});

it('should return the total number of nfts for a given address filtered by search parameter', async () => {
const accountNfts = await axios.get(`${config.apiServiceUrl}/accounts/${config.aliceAddress}/nfts?size=1`);
const accountNfts = await axios.get(`${config.apiServiceUrl}/accounts/${config.aliceAddress}/nfts?size=1&type=${NftType.NonFungibleESDT}`);
const nft = accountNfts.data[0];

const response = await axios.get(`${config.apiServiceUrl}/accounts/${config.aliceAddress}/nfts/count?search=${nft.identifier}`);
Expand Down Expand Up @@ -1848,7 +1848,7 @@ describe('Accounts e2e tests with chain simulator', () => {
});

it('should return the total number of nfts for a given address filtered by search parameter', async () => {
const accountNfts = await axios.get(`${config.apiServiceUrl}/accounts/${config.aliceAddress}/nfts?size=2`);
const accountNfts = await axios.get(`${config.apiServiceUrl}/accounts/${config.aliceAddress}/nfts?size=2&type=${NftType.NonFungibleESDT}`);
const nft = accountNfts.data[0];

const response = await axios.get(`${config.apiServiceUrl}/accounts/${config.aliceAddress}/nfts/c?search=${nft.identifier}`);
Expand Down Expand Up @@ -1944,55 +1944,17 @@ describe('Accounts e2e tests with chain simulator', () => {
const accountNfts = await axios.get(`${config.apiServiceUrl}/accounts/${config.aliceAddress}/nfts?size=1&type=${NftType.MetaESDT}`);
const nft = accountNfts.data[0];

const response = await axios.get(`${config.apiServiceUrl}/accounts/${config.aliceAddress}/nfts/${nft.identifier}?fields=identifier,name,type,subType,creator,collection,tags,uris,supply`);
expect(response.status).toBe(200);

const expectedFields = [
'identifier',
'collection',
'attributes',
'nonce',
'type',
'subType',
'name',
'creator',
'url',
'isWhitelistedStorage',
'tags',
'balance',
'decimals',
'ticker'
];

for (const field of expectedFields) {
expect(response.data).toHaveProperty(field);
}
});

it('should return the NonFungibleESDT details with the proper fields', async () => {
const accountNfts = await axios.get(`${config.apiServiceUrl}/accounts/${config.aliceAddress}/nfts?size=1&type=${NftType.NonFungibleESDT}`);
const nft = accountNfts.data[0];

const response = await axios.get(`${config.apiServiceUrl}/accounts/${config.aliceAddress}/nfts/${nft.identifier}?fields=identifier,name,type,subType,creator,collection,tags,uris,supply`);
const response = await axios.get(`${config.apiServiceUrl}/accounts/${config.aliceAddress}/nfts/${nft.identifier}`);
expect(response.status).toBe(200);

const expectedFields = [
'identifier',
'collection',
'attributes',
'nonce',
'type',
'subType',
'name',
'creator',
'royalties',
'uris',
'url',
'media',
'isWhitelistedStorage',
'tags',
'balance',
'ticker'
];

for (const field of expectedFields) {
Expand All @@ -2010,20 +1972,12 @@ describe('Accounts e2e tests with chain simulator', () => {
const expectedFields = [
'identifier',
'collection',
'attributes',
'nonce',
'type',
'subType',
'name',
'creator',
'royalties',
'uris',
'url',
'media',
'isWhitelistedStorage',
'tags',
'balance',
'ticker'
];

for (const field of expectedFields) {
Expand Down
4 changes: 2 additions & 2 deletions src/test/chain-simulator/collections.cs-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ describe('Collections e2e tests with chain simulator', () => {
}
});

it('should return transactions for a collection of type NFT with a specific hashes', async () => {
it('should return transactions for a collection of type NFT with specific hashes', async () => {
const collectionNFT = await axios.get(`${config.apiServiceUrl}/collections?size=1&type=NonFungibleESDT`);
const collectionNFTDetails = collectionNFT.data.map((collection: any) => collection.collection);

Expand Down Expand Up @@ -1035,7 +1035,7 @@ describe('Collections e2e tests with chain simulator', () => {
}
});

it('should return transfers for a collection of type NFT with a specific hashes', async () => {
it('should return transfers for a collection of type NFT with specific hashes', async () => {
const collectionNFT = await axios.get(`${config.apiServiceUrl}/collections?size=1&type=NonFungibleESDT`);
const collectionNFTDetails = collectionNFT.data.map((collection: any) => collection.collection);

Expand Down

0 comments on commit 58fae71

Please sign in to comment.