Skip to content

Commit

Permalink
Minor optimization tests (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized authored Jun 5, 2022
1 parent 1d868d8 commit e96b690
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/ERC721A.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit e96b690

Please sign in to comment.