Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

cover the missing line in contract #28

Merged
merged 1 commit into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/unit/NftMarketplace.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ const { developmentChains } = require("../../helper-hardhat-config")
assert(listing.price.toString() == PRICE.toString())
assert(listing.seller.toString() == deployer.address)
})
it("reverts if the price be 0", async () => {
const ZERO_PRICE = ethers.utils.parseEther("0")
await expect(
nftMarketplace.listItem(basicNft.address, TOKEN_ID, ZERO_PRICE)
).revertedWithCustomError(nftMarketplace, "NftMarketplace__PriceMustBeAboveZero")
})
})
describe("cancelListing", function () {
it("reverts if there is no listing", async function () {
Expand Down