Skip to content

Commit

Permalink
Set of small improvements to L2TBTC unit tests
Browse files Browse the repository at this point in the history
Renames of some test scenarios plus additional assertions for empty
guardian and minter lists.
  • Loading branch information
pdyraga committed Feb 27, 2023
1 parent c12c042 commit 205c26e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions solidity/test/l2/L2TBTC.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe("L2TBTC", () => {
})

context("when called by the owner", () => {
context("when address is not a minter", () => {
context("when address is a new minter", () => {
let tx: ContractTransaction

before(async () => {
Expand All @@ -106,7 +106,7 @@ describe("L2TBTC", () => {
})
})

context("when address is a minter", () => {
context("when address is already a minter", () => {
before(async () => {
await createSnapshot()

Expand Down Expand Up @@ -168,7 +168,7 @@ describe("L2TBTC", () => {
})
})

context("when address is a minter", () => {
context("when a minter address is removed", () => {
let tx: ContractTransaction

before(async () => {
Expand All @@ -185,6 +185,7 @@ describe("L2TBTC", () => {
it("should take minter role from the address", async () => {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
expect(await token.isMinter(minter.address)).to.be.false
expect(await token.getMinters()).is.empty
})

it("should emit an event", async () => {
Expand Down Expand Up @@ -285,7 +286,7 @@ describe("L2TBTC", () => {
})

context("when called by the owner", () => {
context("when address is not a guardian", () => {
context("when address is a new guardian", () => {
let tx: ContractTransaction

before(async () => {
Expand All @@ -310,7 +311,7 @@ describe("L2TBTC", () => {
})
})

context("when address is a guardian", () => {
context("when address is already a guardian", () => {
before(async () => {
await createSnapshot()

Expand Down Expand Up @@ -372,7 +373,7 @@ describe("L2TBTC", () => {
})
})

context("when address is a guardian", () => {
context("when a guardian address is removed", () => {
let tx: ContractTransaction

before(async () => {
Expand All @@ -389,6 +390,7 @@ describe("L2TBTC", () => {
it("should take guardian role from the address", async () => {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
expect(await token.isGuardian(guardian.address)).to.be.false
expect(await token.getGuardians()).to.be.empty
})

it("should emit an event", async () => {
Expand Down

0 comments on commit 205c26e

Please sign in to comment.