Files
openzeppelin-contracts/test/token/ERC721/ERC721Pausable.test.js
Nicolás Venturo 3e82db2f6f Migration to truffle 5 (and web3 1.0 (and BN)) (#1601)
* Now compiling using truffle 5.

* Migrated some test files, missing BN scientific notation usage.

* Now using BN time values.

* Migrate ERC20 tests.

* Migrate all ERC20 tests.

* Migrate utils, payment and ownership tests.

* All tests save ERC721 migrated.

* Migrated ERC721 tests.

* Fix lint errors.

* Delete old test helpers.

* Fix remaining crowdsale tests.

* Fix signature bouncer tests.

* Update how constants is used.

* Compile script pre-removes the build dir.

* Fix SafeMath tests.

* Revert "Compile script pre-removes the build dir."

This reverts commit 247e745113.

* Fix linter errors.

* Upgrade openzeppelin-test-helpers dependency.

* Update openzeppelin-test-helpers dependency.

* Define math constants globally.

* Remove unnecessary ether unit.

* Roll back reduced ether amounts in tests.

* Remove unnecessary toNumber conversions.

* Delete compile script.

* Fixed failing test.
2019-01-14 19:11:55 -03:00

50 lines
1.4 KiB
JavaScript

require('openzeppelin-test-helpers');
const { shouldBehaveLikeERC721PausedToken } = require('./ERC721PausedToken.behavior');
const { shouldBehaveLikeERC721 } = require('./ERC721.behavior');
const { shouldBehaveLikePublicRole } = require('../../access/roles/PublicRole.behavior');
const ERC721PausableMock = artifacts.require('ERC721PausableMock.sol');
contract('ERC721Pausable', function ([
_,
creator,
owner,
operator,
otherPauser,
...accounts
]) {
beforeEach(async function () {
this.token = await ERC721PausableMock.new({ from: creator });
});
describe('pauser role', function () {
beforeEach(async function () {
this.contract = this.token;
await this.contract.addPauser(otherPauser, { from: creator });
});
shouldBehaveLikePublicRole(creator, otherPauser, accounts, 'pauser');
});
context('when token is paused', function () {
beforeEach(async function () {
await this.token.pause({ from: creator });
});
shouldBehaveLikeERC721PausedToken(creator, accounts);
});
context('when token is not paused yet', function () {
shouldBehaveLikeERC721(creator, creator, accounts);
});
context('when token is paused and then unpaused', function () {
beforeEach(async function () {
await this.token.pause({ from: creator });
await this.token.unpause({ from: creator });
});
shouldBehaveLikeERC721(creator, creator, accounts);
});
});