Skip to content

Commit

Permalink
quick test
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvolear committed Jul 5, 2024
1 parent 1de81be commit 9ddfe57
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions test/passport/dispatchers/PNOAADispatcher.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { expect } from "chai";
import { ethers } from "hardhat";

import { PNOAADispatcher } from "@ethers-v6";

import { Reverter } from "@/test/helpers/";

describe("PNOAADispatcher", () => {
const reverter = new Reverter();

let dispatcher: PNOAADispatcher;

before("setup", async () => {
const PNOAADispatcher = await ethers.getContractFactory("PNOAADispatcher");

dispatcher = await PNOAADispatcher.deploy();

await dispatcher.__PNOAADispatcher_init();

await reverter.snapshot();
});

afterEach(reverter.revert);

describe("#init", () => {
it("should not init twice", async () => {
expect(dispatcher.__PNOAADispatcher_init()).to.be.revertedWith("Initializable: contract is already initialized");
});
});

describe("#authenticate", () => {
it("should authenticate", async () => {
expect(await dispatcher.authenticate("0x", "0x", "0x")).to.be.true;
});
});

describe("#getPassportChallenge", () => {
it("should get the challenge correctly", async () => {
expect(await dispatcher.getPassportChallenge(0)).to.equal("0x");
});
});

describe("#getPassportKey", () => {
it("should get the key correctly", async () => {
expect(await dispatcher.getPassportKey("0x")).to.equal(0);
});
});
});

0 comments on commit 9ddfe57

Please sign in to comment.