Skip to content

Commit

Permalink
temporarily remove tests for create research context dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
maany committed Sep 10, 2024
1 parent 90a0749 commit fb6c017
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions tests/components/CreateResearchContextDialog.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, describe, it, vi } from "vitest";
import { render, screen, fireEvent, waitFor } from "@testing-library/react";
import { CreateResearchContextDialog } from "@/components/dialog/CreateResearchContextDialog";
import { act } from "react-dom/test-utils";
import { describe, it } from "vitest";
// import { render, screen, fireEvent, waitFor } from "@testing-library/react";
// import { CreateResearchContextDialog } from "@/components/dialog/CreateResearchContextDialog";
// import { act } from "react-dom/test-utils";

describe("<CreateResearchContextDialog/>", () => {
// it("should render the trigger of the dialog", () => {
Expand Down Expand Up @@ -62,52 +62,41 @@ describe("<CreateResearchContextDialog/>", () => {
it('should show "Required Field" in the screen if any of the input values is empty', async () => {
// const onSubmit = () => {};
// const mockFunction = vi.fn().mockImplementation(onSubmit);

// // Render the component with the mock alert function as the buttonAction prop
// render(<CreateResearchContextDialog onSubmit={mockFunction} />);
// const triggerButton = screen.getByRole("button");
// fireEvent.click(triggerButton);

// // Simulate user input
// const nameInput = screen.getByLabelText("Name *");
// const descriptionInput = screen.getByLabelText("Description *");
// fireEvent.input(nameInput, { target: { value: `` } });
// fireEvent.input(descriptionInput, { target: { value: `` } });

// // Simulate button click
// const button = screen.getByText("Create new research context");
// act(() => {
// fireEvent.click(button);
// });

// // Check if mockButtonAction has been called
// await waitFor(() => expect(mockFunction).not.toHaveBeenCalled());

// const errorMessages = screen.queryAllByText(/characters long/i);
// expect(errorMessages).toHaveLength(2);

// // Test for empty "Description"
// fireEvent.input(nameInput, { target: { value: `Test Name` } });
// fireEvent.input(descriptionInput, { target: { value: `` } });

// act(() => {
// fireEvent.click(button);
// });

// await waitFor(() => expect(mockFunction).not.toHaveBeenCalled());
// const errorMessages2 = screen.queryAllByText(/characters long/i);
// expect(errorMessages2).toHaveLength(1);

// // Test for empty "Name"
// fireEvent.input(nameInput, { target: { value: `` } });
// fireEvent.input(descriptionInput, {
// target: { value: `Test description for a test research context` },
// });

// act(() => {
// fireEvent.click(button);
// });

// await waitFor(() => expect(mockFunction).not.toHaveBeenCalled());
// const errorMessages3 = screen.queryAllByText(/characters long/i);
// expect(errorMessages3).toHaveLength(1);
Expand Down

0 comments on commit fb6c017

Please sign in to comment.