exo-digital-labs / ERC721R

https://erc721r.super.site/
MIT License
240 stars 60 forks source link

test: move test into describe blocks to make it clear! #21

Closed madeinfree closed 2 years ago

madeinfree commented 2 years ago

Here is the test result.

> erc721r@0.0.2 test
> npx hardhat test

  Aggregation
    ✔ Should be able to mint and request a refund (123ms)

  Check ERC721RExample Constant & Variables
    ✔ Should maxMintSupply = 8000
    ✔ Should mintPrice = 0.1
    ✔ Should refundPeriod 3888000
    ✔ Should maxUserMintAmount 5
    ✔ Should refundEndTime is same with block timestamp in first deploy
    ✔ Should refundGuaranteeActive = true

  Owner
    ✔ Should be able to mint
    ✔ Should not be able to mint when `Max mint supply reached` (47ms)
    ✔ Should not be withdraw when `Refund period not over`
    ✔ Should be withdraw after refundEndTime (44ms)

  PublicMint
    ✔ Should not be able to mint when `Public sale is not active`
    ✔ Should not be able to mint when `Not enough eth sent`
    ✔ Should not be able to mint when `Max mint supply reached`
    ✔ Should not be able to mint when `Over mint limit`

  PreSaleMint
    ✔ Should presale mint merkle tree with valid leaf (39ms)
    ✔ Should not presale mint when `Not on allow list`
    ✔ Should not be mint when `Presale is not active`
    ✔ Should not be mint when `Value` not enough
    ✔ Should not be mint when `Max amount` (48ms)
    ✔ Should not be mint when `Max mint supply`

  Refund
    ✔ Should be store correct tokenId in refund (51ms)
    ✔ Should be revert `Freely minted NFTs cannot be refunded`
    ✔ Should be refund NFT in 45 days (45ms)
    ✔ Should not be refunded when `Not token owner`
    ✔ Should not be refunded NFT twice `Already refunded` (80ms)
    ✔ Should not be refund NFT expired after 45 days `Refund expired`

  Toogle
    ✔ Should be call toggleRefundCountdown and refundEndTime add `refundPeriod` days.
    ✔ Should be call togglePresaleStatus
    ✔ Should be call togglePublicSaleStatus

  Setter
    ✔ Should be call setRefundAddress
    ✔ Should be call setMerkleRoot

  32 passing (4s)
elie222 commented 2 years ago

great! thanks!