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

Commit

Permalink
Merge pull request #28 from AlizadeAlireza/patch-1
Browse files Browse the repository at this point in the history
cover the missing line in contract
  • Loading branch information
PatrickAlphaC authored Apr 25, 2023
2 parents 185892c + 4b8b7fb commit 120d45d
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 120d45d

Please sign in to comment.