From 4ff98907d3db0cb18bb53e840bf8002dc9132199 Mon Sep 17 00:00:00 2001 From: Vectorized Date: Sun, 5 Jun 2022 12:58:06 +0000 Subject: [PATCH] Back to full coverage --- test/ERC721A.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/ERC721A.test.js b/test/ERC721A.test.js index a21344e66..406527131 100644 --- a/test/ERC721A.test.js +++ b/test/ERC721A.test.js @@ -263,6 +263,18 @@ const createTestSuite = ({ contract, constructorArgs }) => it('does not get approved for invalid tokens', async function () { await expect(this.erc721a.getApproved(10)).to.be.revertedWith('ApprovalQueryForNonexistentToken'); }); + + it('approval allows token transfer', async function () { + await expect(this.erc721a.connect(this.addr3) + .transferFrom(this.addr1.address, this.addr3.address, this.tokenId)) + .to.be.revertedWith('TransferCallerNotOwnerNorApproved'); + await this.erc721a.connect(this.addr1).approve(this.addr3.address, this.tokenId); + await this.erc721a.connect(this.addr3) + .transferFrom(this.addr1.address, this.addr3.address, this.tokenId); + await expect(this.erc721a.connect(this.addr1) + .transferFrom(this.addr3.address, this.addr1.address, this.tokenId)) + .to.be.revertedWith('TransferCallerNotOwnerNorApproved'); + }); }); describe('setApprovalForAll', async function () {