Make tests style more uniform (#4812)

This commit is contained in:
Renan Souza
2024-01-02 13:31:33 -03:00
committed by GitHub
parent a72c9561b9
commit 04cb014144
18 changed files with 118 additions and 118 deletions

View File

@ -18,7 +18,7 @@ describe('ERC1155Pausable', function () {
Object.assign(this, await loadFixture(fixture));
});
context('when token is paused', function () {
describe('when token is paused', function () {
beforeEach(async function () {
await this.token.connect(this.holder).setApprovalForAll(this.operator, true);
await this.token.$_mint(this.holder, firstTokenId, firstTokenValue, '0x');

View File

@ -26,7 +26,7 @@ describe('ERC20Wrapper', function () {
});
afterEach('Underlying balance', async function () {
expect(await this.underlying.balanceOf(this.token)).to.be.equal(await this.token.totalSupply());
expect(await this.underlying.balanceOf(this.token)).to.equal(await this.token.totalSupply());
});
it('has a name', async function () {
@ -38,17 +38,17 @@ describe('ERC20Wrapper', function () {
});
it('has the same decimals as the underlying token', async function () {
expect(await this.token.decimals()).to.be.equal(decimals);
expect(await this.token.decimals()).to.equal(decimals);
});
it('decimals default back to 18 if token has no metadata', async function () {
const noDecimals = await ethers.deployContract('CallReceiverMock');
const token = await ethers.deployContract('$ERC20Wrapper', [`Wrapped ${name}`, `W${symbol}`, noDecimals]);
expect(await token.decimals()).to.be.equal(18n);
expect(await token.decimals()).to.equal(18n);
});
it('has underlying', async function () {
expect(await this.token.underlying()).to.be.equal(this.underlying);
expect(await this.token.underlying()).to.equal(this.underlying);
});
describe('deposit', function () {

View File

@ -168,7 +168,7 @@ function shouldOnlyRevertOnErrors() {
});
describe('approvals', function () {
context('with zero allowance', function () {
describe('with zero allowance', function () {
beforeEach(async function () {
await this.token.$_approve(this.mock, this.spender, 0n);
});
@ -195,7 +195,7 @@ function shouldOnlyRevertOnErrors() {
});
});
context('with non-zero allowance', function () {
describe('with non-zero allowance', function () {
beforeEach(async function () {
await this.token.$_approve(this.mock, this.spender, 100n);
});

View File

@ -48,7 +48,7 @@ describe('ERC721Burnable', function () {
await this.token.connect(this.owner).burn(tokenId);
});
context('getApproved', function () {
describe('getApproved', function () {
it('reverts', async function () {
await expect(this.token.getApproved(tokenId))
.to.be.revertedWithCustomError(this.token, 'ERC721NonexistentToken')

View File

@ -19,7 +19,7 @@ describe('ERC721Pausable', function () {
Object.assign(this, await loadFixture(fixture));
});
context('when token is paused', function () {
describe('when token is paused', function () {
beforeEach(async function () {
await this.token.$_mint(this.owner, tokenId);
await this.token.$_pause();