Skip to content

Commit

Permalink
remove part tests
Browse files Browse the repository at this point in the history
  • Loading branch information
justjais committed Nov 22, 2024
1 parent 027b9ee commit 3ecc01e
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions ansible_ai_connect_admin_portal/src/__tests__/AppHeader.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { render, screen, waitFor } from "@testing-library/react";
import { render, screen } from "@testing-library/react";
import "@testing-library/jest-dom";
import { AppHeader } from "../AppHeader";
import userEvent from "@testing-library/user-event";
import { BrowserRouter } from 'react-router-dom';
import { act } from 'react';

describe("AppHeader", () => {
// Store the original 'location' object so that it can be restored for other tests.
Expand Down Expand Up @@ -33,30 +31,5 @@ describe("AppHeader", () => {

// Check "Logout" option is not present
expect(screen.queryByText("Logout")).toBeNull();
// const accountMenuToggle = await act(()=> {
// screen.findByTestId(
// "page-masthead-dropdown__button",
// );
// });
const accountMenuToggle = await screen.findByTestId(
"page-masthead-dropdown__button",
);
// await act(() => {
// userEvent.click(accountMenuToggle);
// });
// await userEvent.click(accountMenuToggle);
// "Logout" menu option should now be present
// expect(await screen.findByText("Logout")).toBeInTheDocument();

// Emulate clicking on the logout button
// const logoutMenuItem = await act(() => {
// screen.findByTestId("app-header__logout");
// });
const logoutMenuItem = screen.findByTestId("app-header__logout");
// await act(() => {
// userEvent.click(logoutMenuItem);
// });
// await userEvent.click(logoutMenuItem);
// expect(window.location.assign).toHaveBeenCalledWith("/logout");
});
});

0 comments on commit 3ecc01e

Please sign in to comment.