Skip to content

Commit

Permalink
fix: coverage 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
EDUARDO MELO DE SIQUEIRA authored and EDUARDO MELO DE SIQUEIRA committed Jun 18, 2024
1 parent d18de09 commit 79730b0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/NftRentalMarketplace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,26 @@ describe('NftRentalMarketplace', () => {
'RentalStarted',
)
})
it('Should DEADLINE UPDATED', async () => {
await time.increase(ONE_DAY)
rentalOffer.minDuration = duration / 2
rentalOffer.nonce = `0x${randomBytes(32).toString('hex')}`
rentalOffer.deadline = Number(await time.latest()) + ONE_HOUR + TEN_MINUTES
const blockTimestamp = Number(await time.latest())
console.log('blockTimestamp:', blockTimestamp.toString())
const newExpirationDate = blockTimestamp + duration - 1
console.log('newExpirationDate', newExpirationDate.toString())
await marketplace.connect(lender).createRentalOffer(rentalOffer)
const updatedRoleDeadline = await marketplace.roleDeadline(
USER_ROLE,
await mockERC721.getAddress(),
tokenId,
)
console.log('Updated Role Deadline:', updatedRoleDeadline.toString())
await marketplace.connect(borrower).acceptRentalOffer(rentalOffer, duration)

expect(newExpirationDate).to.be.greaterThan(updatedRoleDeadline)
})
it('Should accept rental offer if marketplace fee is zero', async () => {
await marketplaceRoyalties
.connect(operator)
Expand Down

0 comments on commit 79730b0

Please sign in to comment.