Skip to content

Commit

Permalink
test: silence jsdom error
Browse files Browse the repository at this point in the history
Signed-off-by: rare-magma <rare-magma@posteo.eu>
  • Loading branch information
rare-magma committed Feb 2, 2025
1 parent bbf442e commit ea729f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/guitos/sections/NavBar/NavBar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ const importRegex = /import budget/i;
const exportCsvRegex = /export budget as csv/i;
const exportJsonRegex = /export budget as json/i;

// workaround for jsdom missing implementation https://stackoverflow.com/a/68038982
HTMLAnchorElement.prototype.click = vi.fn();

describe("NavBar", () => {
const windowSpy = vi.spyOn(window, "open");
const windowSpy = vi.spyOn(window, "open").mockImplementation(() => null);

beforeEach(() => {
windowSpy.mockClear();
Expand Down

0 comments on commit ea729f4

Please # to comment.