From 0dfa49ba1f3ff69259fe82d521967d70ee413421 Mon Sep 17 00:00:00 2001 From: Andres Aiello Date: Mon, 13 Nov 2023 16:15:32 -0300 Subject: [PATCH] improve test --- .../test/zeta-points/InvitationManager.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/zevm-app-contracts/test/zeta-points/InvitationManager.ts b/packages/zevm-app-contracts/test/zeta-points/InvitationManager.ts index e5aaa350..b169e037 100644 --- a/packages/zevm-app-contracts/test/zeta-points/InvitationManager.ts +++ b/packages/zevm-app-contracts/test/zeta-points/InvitationManager.ts @@ -114,10 +114,12 @@ describe("InvitationManager Contract test", () => { const event = rec.events?.find(e => e.event === "InvitationAccepted"); const block = await ethers.provider.getBlock(rec.blockNumber); - await expect(event?.args?.inviter).to.be.eq(inviter.address); - await expect(event?.args?.invitee).to.be.eq(invitee.address); - await expect(event?.args?.index).to.be.eq(0); - await expect(event?.args?.acceptedAt).to.be.eq(block.timestamp); + expect(event?.args?.inviter).to.be.eq(inviter.address); + expect(event?.args?.invitee).to.be.eq(invitee.address); + expect(event?.args?.index).to.be.eq(0); + expect(event?.args?.acceptedAt).to.be.eq(block.timestamp); + const inviteeByIndex = await invitationManager.getInviteeAtIndex(inviter.address, event?.args?.index); + expect(inviteeByIndex).to.be.eq(invitee.address); const tx2 = await invitationManager.connect(addrs[0]).confirmAndAcceptInvitation(inviter.address, sig); const rec2 = await tx2.wait(); @@ -128,6 +130,8 @@ describe("InvitationManager Contract test", () => { await expect(event2?.args?.invitee).to.be.eq(addrs[0].address); await expect(event2?.args?.index).to.be.eq(1); await expect(event2?.args?.acceptedAt).to.be.eq(block2.timestamp); + const inviteeByIndex2 = await invitationManager.getInviteeAtIndex(inviter.address, event2?.args?.index); + expect(inviteeByIndex2).to.be.eq(addrs[0].address); }); }); });