Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Oct 25, 2023
1 parent 31b325b commit 0d73de1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/access/AccessControl.behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@ function shouldBehaveLikeAccessControl() {
});

it('do not revert if sender has role', async function () {
await this.mock.connect(this.authorized)['$_checkRole(bytes32)'](ROLE);
await this.mock.connect(this.authorized).$_checkRole(ROLE);
});

it("revert if sender doesn't have role #1", async function () {
await expect(this.mock.connect(this.other)['$_checkRole(bytes32)'](ROLE))
await expect(this.mock.connect(this.other).$_checkRole(ROLE))
.to.be.revertedWithCustomError(this.mock, 'AccessControlUnauthorizedAccount')
.withArgs(this.other.address, ROLE);
});

it("revert if sender doesn't have role #2", async function () {
await expect(this.mock.connect(this.authorized)['$_checkRole(bytes32)'](OTHER_ROLE))
await expect(this.mock.connect(this.authorized).$_checkRole(OTHER_ROLE))
.to.be.revertedWithCustomError(this.mock, 'AccessControlUnauthorizedAccount')
.withArgs(this.authorized.address, OTHER_ROLE);
});
Expand Down

0 comments on commit 0d73de1

Please sign in to comment.