Fix Part 1 : added tests for getApproved (#1820)
* added tests for getApproved
* added tests for getApproved
* added to changelog
* Corrected some linting issues
* Removed unneccrary tests as pointed out here: b49c2de086 (r307927816)
* Correct Changelog character
* Update ERC721.behavior.js
This commit is contained in:
committed by
Nicolás Venturo
parent
4e527a20a5
commit
635a381460
@ -586,6 +586,35 @@ function shouldBehaveLikeERC721 (
|
||||
});
|
||||
});
|
||||
|
||||
describe('getApproved', async function () {
|
||||
context('when token is not minted', async function () {
|
||||
it('reverts', async function () {
|
||||
await expectRevert(
|
||||
this.token.getApproved(unknownTokenId, { from: minter }),
|
||||
'ERC721: approved query for nonexistent token'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
context('when token has been minted ', async function () {
|
||||
it('should return the zero address', async function () {
|
||||
expect(await this.token.getApproved(firstTokenId)).to.be.equal(
|
||||
ZERO_ADDRESS
|
||||
);
|
||||
});
|
||||
|
||||
context('when account has been approved', async function () {
|
||||
beforeEach(async function () {
|
||||
await this.token.approve(approved, firstTokenId, { from: owner });
|
||||
});
|
||||
|
||||
it('should return approved account', async function () {
|
||||
expect(await this.token.getApproved(firstTokenId)).to.be.equal(approved);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
shouldSupportInterfaces([
|
||||
'ERC165',
|
||||
'ERC721',
|
||||
|
||||
Reference in New Issue
Block a user