From 768913dba90a84a9e629796a34d5be5721eb5080 Mon Sep 17 00:00:00 2001 From: Mariusz Jasuwienas Date: Thu, 23 Jan 2025 10:50:06 +0100 Subject: [PATCH] fix: applying mr suggestions comparing to equals rather than not equals (#191) Signed-off-by: Mariusz Jasuwienas --- examples/hardhat-hts/test/nft-ownerof.test.js | 7 ++++--- examples/hardhat-hts/test/nft.test.js | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/hardhat-hts/test/nft-ownerof.test.js b/examples/hardhat-hts/test/nft-ownerof.test.js index fb28864..72cbba3 100644 --- a/examples/hardhat-hts/test/nft-ownerof.test.js +++ b/examples/hardhat-hts/test/nft-ownerof.test.js @@ -24,8 +24,9 @@ describe('NFT example -- ownerOf', function () { it('should get `ownerOf` account holder', async function () { // https://hashscan.io/mainnet/token/0.0.4970613 const nft = await getContractAt('IERC721', '0x00000000000000000000000000000000004bd875'); - expect(await nft['ownerOf'](1)).to.not.be.equal( - '0x0000000000000000000000000000000000000000' - ); + + // The assertion below cannot be guaranteed, since we can only query the current owner of the NFT, + // Note that the ownership of the NFT may change over time. + expect(await nft['ownerOf'](1)).to.be.equal('0x0000000000000000000000000000000000161927'); }); }); diff --git a/examples/hardhat-hts/test/nft.test.js b/examples/hardhat-hts/test/nft.test.js index 68e603d..aa35e4e 100644 --- a/examples/hardhat-hts/test/nft.test.js +++ b/examples/hardhat-hts/test/nft.test.js @@ -99,7 +99,9 @@ describe('NFT example', function () { await connectAs(nft, holder)['approve'](spender, serialId); expect(await nft['getApproved'](serialId)).to.be.equal(spender.address); await connectAs(nft, spender)['transferFrom'](holder, receiver, serialId); - expect(await nft['getApproved'](serialId)).to.not.be.equal(spender.address); + expect(await nft['getApproved'](serialId)).to.be.equal( + '0x0000000000000000000000000000000000000000' + ); expect(await nft['ownerOf'](serialId)).to.be.equal(receiver); });