Skip to content

Commit

Permalink
Merge pull request #2542 from dusk-network/feature-2471
Browse files Browse the repository at this point in the history
web-wallet: Fix Test Failing with Exception (OperationResult)
  • Loading branch information
nortonandreev authored Oct 1, 2024
2 parents b4e45a9 + 525c56b commit 2d7adcd
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { cleanup, render } from "@testing-library/svelte";
import { cleanup, fireEvent, render } from "@testing-library/svelte";

import { rejectAfter, resolveAfter } from "$lib/dusk/promise";

Expand Down Expand Up @@ -71,7 +71,11 @@ describe("OperationResult", () => {

const homeBtn = getByRole("link");

homeBtn.click();
// prevents the browser from attempting to navigate
// to the link's href, which jsdom cannot handle
homeBtn.addEventListener("click", (event) => event.preventDefault());

await fireEvent.click(homeBtn);

expect(baseProps.onBeforeLeave).toHaveBeenCalledTimes(1);
});
Expand Down

0 comments on commit 2d7adcd

Please sign in to comment.