Skip to content

Commit

Permalink
AAP-36512: FIx Admin portal tests fallout due to PF5 and latest Ansib…
Browse files Browse the repository at this point in the history
…le-UI-framework (#1475)

* AAP-36512: FIx Admin portal tests fallout due to PF5 and latest Ansible-UI-framework

* Fix dependency audit issue

* Fix precommit issue

* Fix npm lint issues.
  • Loading branch information
manstis authored Jan 2, 2025
1 parent 5f359f9 commit 229f711
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
29 changes: 15 additions & 14 deletions ansible_ai_connect_admin_portal/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions ansible_ai_connect_admin_portal/src/__tests__/AppHeader.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { render, screen } from "@testing-library/react";
import "@testing-library/jest-dom";
import { AppHeader } from "../AppHeader";
import { BrowserRouter } from "react-router-dom";
import userEvent from "@testing-library/user-event";

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

// Check "Logout" option is not present
expect(screen.queryByText("Logout")).toBeNull();

// Emulate click on menu button
await userEvent.click(accountMenu);

// "Logout" menu option should now be present
const logoutMenuButton = await screen.findByText("Logout");
expect(logoutMenuButton).toBeInTheDocument();

// Emulate clicking on the logout button
await userEvent.click(logoutMenuButton);
expect(window.location.assign).toBeCalledWith("/logout");
});
});
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ipython==8.10.0
# remove this once django-oauth-toolkit is updated to properly
# pull a version of jwcrypto >= 1.5.6.
jwcrypto==1.5.6
# pin jinja2 on 3.1.5 to address GHSA-h75v-3vvj-5mfj,
# pin jinja2 on 3.1.5 to address GHSA-h75v-3vvj-5mfj,
# CVE-2024-56326, CVE-2024-56201
# remove this once ansible-core or torch are updated
jinja2==3.1.5
Expand Down

0 comments on commit 229f711

Please sign in to comment.