Skip to content

Commit 229f711

Browse files
authored
AAP-36512: FIx Admin portal tests fallout due to PF5 and latest Ansible-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.
1 parent 5f359f9 commit 229f711

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

ansible_ai_connect_admin_portal/package-lock.json

+15-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ansible_ai_connect_admin_portal/src/__tests__/AppHeader.test.tsx

+12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { render, screen } from "@testing-library/react";
22
import "@testing-library/jest-dom";
33
import { AppHeader } from "../AppHeader";
44
import { BrowserRouter } from "react-router-dom";
5+
import userEvent from "@testing-library/user-event";
56

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

3435
// Check "Logout" option is not present
3536
expect(screen.queryByText("Logout")).toBeNull();
37+
38+
// Emulate click on menu button
39+
await userEvent.click(accountMenu);
40+
41+
// "Logout" menu option should now be present
42+
const logoutMenuButton = await screen.findByText("Logout");
43+
expect(logoutMenuButton).toBeInTheDocument();
44+
45+
// Emulate clicking on the logout button
46+
await userEvent.click(logoutMenuButton);
47+
expect(window.location.assign).toBeCalledWith("/logout");
3648
});
3749
});

requirements.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ipython==8.10.0
3737
# remove this once django-oauth-toolkit is updated to properly
3838
# pull a version of jwcrypto >= 1.5.6.
3939
jwcrypto==1.5.6
40-
# pin jinja2 on 3.1.5 to address GHSA-h75v-3vvj-5mfj,
40+
# pin jinja2 on 3.1.5 to address GHSA-h75v-3vvj-5mfj,
4141
# CVE-2024-56326, CVE-2024-56201
4242
# remove this once ansible-core or torch are updated
4343
jinja2==3.1.5

0 commit comments

Comments
 (0)