Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating .tree file in adminable_unit_test #634

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ contract TransferAdmin_Unit_Concrete_Test is Adminable_Unit_Shared_Test {
adminableMock.transferAdmin(users.eve);
}

modifier whenCallerAdmin() {
modifier GivenCallerIsAdmin() {
_;
}

function test_TransferAdmin_SameAdmin() external whenCallerAdmin {
function test_TransferAdmin_SameAdmin() external GivenCallerIsAdmin {
// Expect the relevant event to be emitted.
vm.expectEmit({ emitter: address(adminableMock) });
emit TransferAdmin({ oldAdmin: users.admin, newAdmin: users.admin });
Expand All @@ -33,7 +33,7 @@ contract TransferAdmin_Unit_Concrete_Test is Adminable_Unit_Shared_Test {
assertEq(actualAdmin, expectedAdmin, "admin");
}

function test_TransferAdmin_ZeroAddress() external whenCallerAdmin {
function test_TransferAdmin_ZeroAddress() external GivenCallerIsAdmin {
// Expect the relevant event to be emitted.
vm.expectEmit({ emitter: address(adminableMock) });
emit TransferAdmin({ oldAdmin: users.admin, newAdmin: address(0) });
Expand All @@ -51,7 +51,7 @@ contract TransferAdmin_Unit_Concrete_Test is Adminable_Unit_Shared_Test {
_;
}

function test_TransferAdmin_NewAdmin() external whenCallerAdmin whenNotZeroAddress {
function test_TransferAdmin_NewAdmin() external GivenCallerIsAdmin whenNotZeroAddress {
// Expect the relevant event to be emitted.
vm.expectEmit({ emitter: address(adminableMock) });
emit TransferAdmin({ oldAdmin: users.admin, newAdmin: users.alice });
Expand Down
26 changes: 13 additions & 13 deletions test/unit/concrete/adminable/transfer-admin/transferAdmin.tree
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
transferAdmin.t.sol
├── when the caller is not the admin
│ └── it should revert
└── when the caller is the admin
├── when the admin is the same as the current admin
│ ├── it should re-set the admin
│ └── it should emit a {TransferAdmin} event
└── when the admin is not the same as the current admin
├── when the admin is the zero address
│ ├── it should set the admin to the zero address
│ └── it should emit a {TransferAdmin}
└── when the admin is not the zero address
├── it should set the new admin
└── it should emit a {TransferAdmin} event and set the new admin
├── Given the caller is not the admin
│ └── Then it should revert
└── Given the caller is the admin
├── When the new admin is the same as the current admin
├── Then it should re-set the admin
└── And it should emit a {TransferAdmin} event
└── When the new admin is not the same as the current admin
├── When the new admin is the zero address
│ ├── Then it should set the admin to the zero address
│ └── And it should emit a {TransferAdmin} event
└── When the new admin is not the zero address
├── Then it should set the new admin
└── And it should emit a {TransferAdmin} event