PatrickAlphaC / hardhat-nft-fcc

100 stars 139 forks source link

Is there a typo for basicNft.test.js? #74

Closed UnknownedPhyrexia closed 1 year ago

UnknownedPhyrexia commented 1 year ago

Hi @PatrickAlphaC!

Hope all is well for you.

I was just running this basicNft.test.js, and for some reason I can only get "Show the correct balance and owner of an NFT" to pass is if I changed:

const owner = await basicNft.ownerOf("1") to

const owner = await basicNft.ownerOf("0")

Which makes sense to me because the first NFT minted would have tokenId of 0, not 1.

I get "invalid token ID" error if I used 1.

Just like to check if my assessment is correct? Thank you.

it("Show the correct balance and owner of an NFT", async function () {
              const deployerAddress = deployer.address;
              const deployerBalance = await basicNft.balanceOf(deployerAddress)
              const owner = await basicNft.ownerOf("1")

              assert.equal(deployerBalance.toString(), "1")
              assert.equal(owner, deployerAddress)
PatrickAlphaC commented 1 year ago

Oops. I just updated the repo. Had to move where we updated the token counter. Thank yoU!