Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
Signed-off-by: GopherJ <[email protected]>
  • Loading branch information
GopherJ committed Jul 11, 2023
1 parent f29a407 commit a4781a8
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions test/_pool_ape_staking.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ describe("APE Coin Staking Test", () => {
);

const totalStake = await nMAYC.getUserApeStakingAmount(user1.address);
expect(totalStake).equal(amount.add(pendingRewardsPool2));
expect(totalStake).equal(amount);

expect(await ape.balanceOf(user1.address)).to.be.eq(
userBalance.add(pendingRewardsPool3)
Expand Down Expand Up @@ -742,7 +742,7 @@ describe("APE Coin Staking Test", () => {
);

const totalStake = await nMAYC.getUserApeStakingAmount(user1.address);
expect(totalStake).equal(amount.add(pendingRewardsPool2));
expect(totalStake).equal(amount);

expect(await ape.balanceOf(user1.address)).to.be.eq(
userBalance.add(pendingRewardsPool3)
Expand Down Expand Up @@ -815,7 +815,7 @@ describe("APE Coin Staking Test", () => {
);
});

it("TC-pool-ape-staking-13 test claimApeCoin fails when hf < 1 (revert expected)", async () => {
it("TC-pool-ape-staking-13 test claimApeCoin fails when hf < 1", async () => {
const {
users: [user1],
ape,
Expand Down Expand Up @@ -861,11 +861,7 @@ describe("APE Coin Staking Test", () => {
// drop HF to liquidation levels
await changePriceAndValidate(mayc, "3");

await expect(
pool.connect(user1.signer).claimApeCoin(mayc.address, [0])
).to.be.revertedWith(
ProtocolErrors.HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD
);
await expect(pool.connect(user1.signer).claimApeCoin(mayc.address, [0]));
});

it("TC-pool-ape-staking-14 test unstakeApePositionAndRepay repays cape debt - no excess", async () => {
Expand Down Expand Up @@ -2705,8 +2701,8 @@ describe("APE Coin Staking Test", () => {
// User 3 - ape balance should increased pendingRewardsPool3
expect(await ape.balanceOf(user3.address)).eq(pendingRewardsPool3);
totalStake = await nMAYC.getUserApeStakingAmount(user1.address);
// User1 - total stake should increased amount1 + pendingRewardsPool2
expect(totalStake).equal(amount1.add(pendingRewardsPool2));
// User1 - total stake should increased amount1
expect(totalStake).equal(amount1);
});

it("TC-pool-ape-staking-43 test withdrawBAKC success when withdraw amount == bakc staking amount, and the sender is not the BAKC owner, it will automatically claim and transfer the reward to the BACK owner", async () => {
Expand Down Expand Up @@ -2789,8 +2785,8 @@ describe("APE Coin Staking Test", () => {
amount2.add(pendingRewardsPool3)
);
totalStake = await nMAYC.getUserApeStakingAmount(user1.address);
// User1 - total stake should increased amount1 + pendingRewardsPool2
expect(totalStake).equal(amount1.add(pendingRewardsPool2));
// User1 - total stake should increased amount1
expect(totalStake).equal(amount1);
});

it("TC-pool-ape-staking-44 test withdrawApeCoin fails when the sender is not the NFT owner(revert expected)", async () => {
Expand Down

0 comments on commit a4781a8

Please sign in to comment.