You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
7 years ago
|
const { shouldBehaveLikeERC721PausedToken } = require('./ERC721PausedToken.behavior');
|
||
7 years ago
|
const { shouldBehaveLikeERC721Basic } = require('./ERC721Basic.behavior');
|
||
7 years ago
|
|
||
|
const BigNumber = web3.BigNumber;
|
||
7 years ago
|
const ERC721Pausable = artifacts.require('ERC721PausableMock.sol');
|
||
7 years ago
|
|
||
|
require('chai')
|
||
|
.use(require('chai-bignumber')(BigNumber))
|
||
|
.should();
|
||
|
|
||
7 years ago
|
contract('ERC721Pausable', function ([_, owner, recipient, operator, ...otherAccounts]) {
|
||
7 years ago
|
beforeEach(async function () {
|
||
7 years ago
|
this.token = await ERC721Pausable.new({ from: owner });
|
||
7 years ago
|
});
|
||
|
|
||
|
context('when token is paused', function () {
|
||
|
beforeEach(async function () {
|
||
|
await this.token.pause({ from: owner });
|
||
|
});
|
||
|
|
||
|
shouldBehaveLikeERC721PausedToken(owner, [...otherAccounts]);
|
||
|
});
|
||
|
|
||
|
context('when token is not paused yet', function () {
|
||
7 years ago
|
shouldBehaveLikeERC721Basic([owner, ...otherAccounts]);
|
||
7 years ago
|
});
|
||
|
|
||
|
context('when token is paused and then unpaused', function () {
|
||
|
beforeEach(async function () {
|
||
|
await this.token.pause({ from: owner });
|
||
|
await this.token.unpause({ from: owner });
|
||
|
});
|
||
|
|
||
7 years ago
|
shouldBehaveLikeERC721Basic([owner, ...otherAccounts]);
|
||
7 years ago
|
});
|
||
|
});
|