Last active
August 24, 2021 18:45
-
-
Save polluterofminds/1f83cc9a4366749eb2ec5861638a5f54 to your computer and use it in GitHub Desktop.
PFPinata Contract test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { expect } = require("chai"); | |
const { ethers } = require("hardhat"); | |
const BASE_URI = "ipfs://FAKE_IPFS_CID/"; | |
const TEST_WALLET = "0x243dc2F47EC5A0693C5c7bD39b31561cCd4B0e97"; | |
describe("PFPinatas", function () { | |
it("Should mint a new token", async function () { | |
const PFPinata = await ethers.getContractFactory("PFPinatas"); | |
const pfpPinata = await PFPinata.deploy(BASE_URI); | |
await pfpPinata.deployed(); | |
await pfpPinata.mintTo(TEST_WALLET); | |
expect(await pfpPinata.ownerOf(1)).to.equal(TEST_WALLET); | |
}); | |
it("Should return a valid token URI", async function () { | |
const PFPinata = await ethers.getContractFactory("PFPinatas"); | |
const pfpPinata = await PFPinata.deploy(BASE_URI); | |
await pfpPinata.deployed(BASE_URI); | |
await pfpPinata.mintTo(TEST_WALLET); | |
expect(await pfpPinata.ownerOf(1)).to.equal(TEST_WALLET); | |
expect(await pfpPinata.tokenURI(1)).to.equal(`${BASE_URI}1`); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment