Skip to content

Commit

Permalink
Update unnit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank1513 committed Jul 7, 2024
1 parent 38fad1b commit 5b576c3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,21 @@ describe("Test Board", () => {
expect(el).toBeDefined();
act(() => fireEvent.click(el));
});

test("Set Column color renders", () => {
const columnEl = screen.getByTestId("column-0");
const colorBtn = columnEl
.getElementsByClassName(columnListStyles.headerContent)[0]
.getElementsByTagName("button")[0];
act(() => fireEvent.click(colorBtn));
act(() => fireEvent.click(screen.getByText("Ok")));
});

test("Set Task color renders", () => {
const columnEl = screen.getByTestId("column-0");
const taskHEaderEl = columnEl.getElementsByClassName(taskStyles.task)[0].getElementsByTagName("header")[0];
const colorBtn = taskHEaderEl.getElementsByTagName("button")[0];
act(() => fireEvent.click(colorBtn));
act(() => fireEvent.click(screen.getByText("Ok")));
});
});
3 changes: 3 additions & 0 deletions vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "@testing-library/jest-dom";
import { useState } from "react";
import { vi } from "vitest";

export const scrollIntoViewMock = vi.fn();
Expand All @@ -19,3 +20,5 @@ Object.defineProperty(window, "matchMedia", {
});

vi.mock("react-webgl-trails", () => ({ MouseTrail: () => null }));

vi.mock("react-color-palette", () => ({ ColorPicker: () => null, useColor: useState }));

0 comments on commit 5b576c3

Please sign in to comment.