diff --git a/test/unit/DSCEngineTest.t.sol b/test/unit/DSCEngineTest.t.sol index 5dd4fbe..c3acc62 100644 --- a/test/unit/DSCEngineTest.t.sol +++ b/test/unit/DSCEngineTest.t.sol @@ -231,16 +231,13 @@ contract DSCEngineTest is StdCheats, Test { vm.stopPrank(); } - function testRevertsIfMintAmountBreaksHealthFactor() public { + function testRevertsIfMintAmountBreaksHealthFactor() public depositedCollateral{ // 0xe580cc6100000000000000000000000000000000000000000000000006f05b59d3b20000 // 0xe580cc6100000000000000000000000000000000000000000000003635c9adc5dea00000 (, int256 price,,,) = MockV3Aggregator(ethUsdPriceFeed).latestRoundData(); amountToMint = (amountCollateral * (uint256(price) * dsce.getAdditionalFeedPrecision())) / dsce.getPrecision(); vm.startPrank(user); - ERC20Mock(weth).approve(address(dsce), amountCollateral); - dsce.depositCollateral(weth, amountCollateral); - uint256 expectedHealthFactor = dsce.calculateHealthFactor(amountToMint, dsce.getUsdValue(weth, amountCollateral)); vm.expectRevert(abi.encodeWithSelector(DSCEngine.DSCEngine__BreaksHealthFactor.selector, expectedHealthFactor));