Skip to content

Commit

Permalink
test: add getNextApplicationId test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Jul 19, 2024
1 parent b3f7169 commit b6dab49
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/ApplicationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,24 @@ describe("ApplicationManager", () => {
expect(returnedApps.length).to.equal(0);
});
});

describe("getNextApplicationId", () => {
let contract: any;

beforeEach(async () => {
const fixture = await loadFixture(deploy);
contract = fixture.contract;
});

it("Should return the next application ID", async () => {
expect(await contract.read.getNextApplicationId()).to.equal(parseUnits("0", 0));

const app = {
name: "app",
account: generateRandomAddress() as Address,
};
await contract.write.createApplication([app]);
expect(await contract.read.getNextApplicationId()).to.equal(parseUnits("1", 0));
});
});
});

0 comments on commit b6dab49

Please sign in to comment.