Skip to content

Commit 578f5d6

Browse files
committed
test(contracts): update hh tests to reflect contracts changes
1 parent b5fe47c commit 578f5d6

File tree

3 files changed

+1975
-2133
lines changed

3 files changed

+1975
-2133
lines changed

packages/contracts/contracts/src/test/Advanced.t.sol

+23-25
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {BaseERC721CheckerFactory} from "./base/BaseERC721CheckerFactory.sol";
99
import {AdvancedERC721CheckerFactory} from "./advanced/AdvancedERC721CheckerFactory.sol";
1010
import {AdvancedERC721Policy} from "./advanced/AdvancedERC721Policy.sol";
1111
import {AdvancedERC721PolicyFactory} from "./advanced/AdvancedERC721PolicyFactory.sol";
12-
import {BaseERC721Policy} from "./base/BaseERC721Policy.sol";
13-
import {BaseVoting} from "./base/BaseVoting.sol";
1412
import {AdvancedVoting} from "./advanced/AdvancedVoting.sol";
1513
import {IPolicy} from "../core/interfaces/IPolicy.sol";
1614
import {IERC721Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol";
@@ -235,11 +233,11 @@ contract AdvancedPolicy is Test {
235233
);
236234
}
237235

238-
function test_trait_returnsCorrectValue() public view {
236+
function test_policy_trait_returnsCorrectValue() public view {
239237
assertEq(policy.trait(), "AdvancedERC721");
240238
}
241239

242-
function test_setTarget_whenCallerNotOwner_reverts() public {
240+
function test_policy_setTarget_whenCallerNotOwner_reverts() public {
243241
vm.startPrank(notOwner);
244242

245243
vm.expectRevert(abi.encodeWithSelector(Ownable.OwnableUnauthorizedAccount.selector, notOwner));
@@ -248,7 +246,7 @@ contract AdvancedPolicy is Test {
248246
vm.stopPrank();
249247
}
250248

251-
function test_setTarget_whenZeroAddress_reverts() public {
249+
function test_policy_setTarget_whenZeroAddress_reverts() public {
252250
vm.startPrank(deployer);
253251

254252
vm.expectRevert(abi.encodeWithSelector(IPolicy.ZeroAddress.selector));
@@ -257,7 +255,7 @@ contract AdvancedPolicy is Test {
257255
vm.stopPrank();
258256
}
259257

260-
function test_setTarget_whenValid_succeeds() public {
258+
function test_policy_setTarget_whenValid_succeeds() public {
261259
vm.startPrank(deployer);
262260

263261
vm.expectEmit(true, true, true, true);
@@ -268,7 +266,7 @@ contract AdvancedPolicy is Test {
268266
vm.stopPrank();
269267
}
270268

271-
function test_setTarget_whenAlreadySet_reverts() public {
269+
function test_policy_setTarget_whenAlreadySet_reverts() public {
272270
vm.startPrank(deployer);
273271

274272
policy.setTarget(target);
@@ -279,7 +277,7 @@ contract AdvancedPolicy is Test {
279277
vm.stopPrank();
280278
}
281279

282-
function test_enforcePre_whenCallerNotTarget_reverts() public {
280+
function test_policy_enforcePre_whenCallerNotTarget_reverts() public {
283281
vm.startPrank(deployer);
284282

285283
policy.setTarget(target);
@@ -294,7 +292,7 @@ contract AdvancedPolicy is Test {
294292
vm.stopPrank();
295293
}
296294

297-
function test_enforcePre_whenTokenDoesNotExist_reverts() public {
295+
function test_policy_enforcePre_whenTokenDoesNotExist_reverts() public {
298296
vm.startPrank(deployer);
299297

300298
policy.setTarget(target);
@@ -309,7 +307,7 @@ contract AdvancedPolicy is Test {
309307
vm.stopPrank();
310308
}
311309

312-
function test_enforcePre_whenChecksSkipped_reverts() public {
310+
function test_policy_enforcePre_whenChecksSkipped_reverts() public {
313311
vm.startPrank(deployer);
314312

315313
policySkipped.setTarget(target);
@@ -325,7 +323,7 @@ contract AdvancedPolicy is Test {
325323
vm.stopPrank();
326324
}
327325

328-
function test_enforcePre_whenCheckFails_reverts() public {
326+
function test_policy_enforcePre_whenCheckFails_reverts() public {
329327
vm.startPrank(deployer);
330328

331329
policy.setTarget(target);
@@ -341,7 +339,7 @@ contract AdvancedPolicy is Test {
341339
vm.stopPrank();
342340
}
343341

344-
function test_enforcePre_whenValid_succeeds() public {
342+
function test_policy_enforcePre_whenValid_succeeds() public {
345343
vm.startPrank(deployer);
346344

347345
policy.setTarget(target);
@@ -359,7 +357,7 @@ contract AdvancedPolicy is Test {
359357
vm.stopPrank();
360358
}
361359

362-
function test_enforcePre_whenAlreadyEnforced_reverts() public {
360+
function test_policy_enforcePre_whenAlreadyEnforced_reverts() public {
363361
vm.startPrank(deployer);
364362

365363
policy.setTarget(target);
@@ -377,7 +375,7 @@ contract AdvancedPolicy is Test {
377375
vm.stopPrank();
378376
}
379377

380-
function test_enforceMain_whenCallerNotTarget_reverts() public {
378+
function test_policy_enforceMain_whenCallerNotTarget_reverts() public {
381379
vm.startPrank(deployer);
382380

383381
policy.setTarget(target);
@@ -392,7 +390,7 @@ contract AdvancedPolicy is Test {
392390
vm.stopPrank();
393391
}
394392

395-
function test_enforceMain_whenCheckFails_reverts() public {
393+
function test_policy_enforceMain_whenCheckFails_reverts() public {
396394
vm.startPrank(deployer);
397395

398396
policy.setTarget(target);
@@ -420,7 +418,7 @@ contract AdvancedPolicy is Test {
420418
vm.stopPrank();
421419
}
422420

423-
function test_enforceMain_whenPreCheckMissing_reverts() public {
421+
function test_policy_enforceMain_whenPreCheckMissing_reverts() public {
424422
vm.startPrank(deployer);
425423

426424
policy.setTarget(target);
@@ -436,7 +434,7 @@ contract AdvancedPolicy is Test {
436434
vm.stopPrank();
437435
}
438436

439-
function test_enforceMain_whenValid_succeeds() public {
437+
function test_policy_enforceMain_whenValid_succeeds() public {
440438
vm.startPrank(deployer);
441439

442440
policy.setTarget(target);
@@ -456,7 +454,7 @@ contract AdvancedPolicy is Test {
456454
vm.stopPrank();
457455
}
458456

459-
function test_enforceMain_whenMultipleValid_succeeds() public {
457+
function test_policy_enforceMain_whenMultipleValid_succeeds() public {
460458
vm.startPrank(deployer);
461459

462460
policy.setTarget(target);
@@ -481,7 +479,7 @@ contract AdvancedPolicy is Test {
481479
vm.stopPrank();
482480
}
483481

484-
function test_enforceMain_whenMultipleNotAllowed_reverts() public {
482+
function test_policy_enforceMain_whenMultipleNotAllowed_reverts() public {
485483
vm.startPrank(deployer);
486484

487485
policySkipped.setTarget(target);
@@ -499,7 +497,7 @@ contract AdvancedPolicy is Test {
499497
vm.stopPrank();
500498
}
501499

502-
function test_enforcePost_whenPreCheckMissing_reverts() public {
500+
function test_policy_enforcePost_whenPreCheckMissing_reverts() public {
503501
vm.startPrank(deployer);
504502

505503
policy.setTarget(target);
@@ -516,7 +514,7 @@ contract AdvancedPolicy is Test {
516514
vm.stopPrank();
517515
}
518516

519-
function test_enforcePost_whenCallerNotTarget_reverts() public {
517+
function test_policy_enforcePost_whenCallerNotTarget_reverts() public {
520518
vm.startPrank(deployer);
521519

522520
policy.setTarget(target);
@@ -531,7 +529,7 @@ contract AdvancedPolicy is Test {
531529
vm.stopPrank();
532530
}
533531

534-
function test_enforcePost_whenChecksSkipped_reverts() public {
532+
function test_policy_enforcePost_whenChecksSkipped_reverts() public {
535533
vm.startPrank(deployer);
536534

537535
policySkipped.setTarget(target);
@@ -549,7 +547,7 @@ contract AdvancedPolicy is Test {
549547
vm.stopPrank();
550548
}
551549

552-
function test_enforcePost_whenCheckFails_reverts() public {
550+
function test_policy_enforcePost_whenCheckFails_reverts() public {
553551
vm.startPrank(deployer);
554552

555553
policy.setTarget(target);
@@ -570,7 +568,7 @@ contract AdvancedPolicy is Test {
570568
vm.stopPrank();
571569
}
572570

573-
function test_enforcePost_whenValid_succeeds() public {
571+
function test_policy_enforcePost_whenValid_succeeds() public {
574572
vm.startPrank(deployer);
575573

576574
policy.setTarget(target);
@@ -591,7 +589,7 @@ contract AdvancedPolicy is Test {
591589
vm.stopPrank();
592590
}
593591

594-
function test_enforcePost_whenAlreadyEnforced_reverts() public {
592+
function test_policy_enforcePost_whenAlreadyEnforced_reverts() public {
595593
vm.startPrank(deployer);
596594

597595
policy.setTarget(target);

0 commit comments

Comments
 (0)