Skip to content

Commit

Permalink
fix: e2e tests (#850)
Browse files Browse the repository at this point in the history
Co-authored-by: 0xmad <[email protected]>
  • Loading branch information
0xmad and 0xmad authored Sep 9, 2023
1 parent d60d253 commit 29b211b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/demo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ const App = () => {
onRevealConnectedIdentityCommitment,
} = useCryptKeeper();

const params = new URLSearchParams(window.location.search);
const canShowReveal = process.env.REVEAL_IDENTITY === "true" || params.get("REVEAL_IDENTITY") === "true";

useEffect(() => {
connect();
}, [connect]);
Expand Down Expand Up @@ -128,7 +131,7 @@ const App = () => {
</button>
</div>

{process.env.REVEAL_IDENTITY === "true" && (
{canShowReveal && (
<div>
<h2>Reveal connected identity Commitment</h2>

Expand Down
4 changes: 2 additions & 2 deletions packages/e2e/tests/revealIdentityCommitment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test.describe("reveal identity commitment", () => {
await connectWallet({ page, cryptKeeperExtensionId, context });
await expect(page.getByText("Connected to MetaMask")).toBeVisible();

await page.goto("/");
await page.goto("/?REVEAL_IDENTITY=true");
});

test("should reveal connected identity commitment properly [health-check]", async ({ page }) => {
Expand Down Expand Up @@ -43,7 +43,7 @@ test.describe("reveal identity commitment", () => {
cryptKeeperExtensionId,
}) => {
const demoApp = await context.newPage();
await demoApp.goto("/");
await demoApp.goto("/?REVEAL_IDENTITY=true");

const cryptKeeper = await context.newPage();
await cryptKeeper.bringToFront();
Expand Down

0 comments on commit 29b211b

Please sign in to comment.