Skip to content

Commit

Permalink
add burn test of MintNFT
Browse files Browse the repository at this point in the history
  • Loading branch information
tayutaedomo committed Sep 20, 2023
1 parent 7e26a86 commit 97d7978
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions hardhat/test/MintNFT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,26 @@ describe("MintNFT", function () {
});
});

describe("burn", () => {
it("success to burn", async () => {
const { proofCalldata } = await generateProof();
const mintNftTxn = await mintNFT
.connect(participant2)
.mintParticipateNFT(createdGroupId, createdEventIds[0], proofCalldata);
await mintNftTxn.wait();

expect(await mintNFT.balanceOf(participant2.address)).equal(1);

const tokenId = await mintNFT.tokenOfOwnerByIndex(
participant2.address,
0
);

await mintNFT.connect(organizer).burn(tokenId);
expect(await mintNFT.balanceOf(participant2.address)).equal(0);
});
});

describe("get NFT holders of the event", () => {
let mintNFT: MintNFT;
let eventManager: EventManager;
Expand Down

0 comments on commit 97d7978

Please sign in to comment.