diff --git a/ansible_ai_connect_admin_portal/package-lock.json b/ansible_ai_connect_admin_portal/package-lock.json index 0a55d446f..d7f8a17cd 100644 --- a/ansible_ai_connect_admin_portal/package-lock.json +++ b/ansible_ai_connect_admin_portal/package-lock.json @@ -8488,11 +8488,10 @@ } }, "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "devOptional": true, - "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -8513,7 +8512,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -8528,6 +8527,10 @@ }, "engines": { "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/express/node_modules/debug": { @@ -12695,9 +12698,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { @@ -12705,7 +12708,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -13505,11 +13507,10 @@ "license": "MIT" }, "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", - "devOptional": true, - "license": "MIT" + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "devOptional": true }, "node_modules/path-type": { "version": "4.0.0", diff --git a/ansible_ai_connect_admin_portal/src/__tests__/AppHeader.test.tsx b/ansible_ai_connect_admin_portal/src/__tests__/AppHeader.test.tsx index ac3fd067d..145f5ca6e 100644 --- a/ansible_ai_connect_admin_portal/src/__tests__/AppHeader.test.tsx +++ b/ansible_ai_connect_admin_portal/src/__tests__/AppHeader.test.tsx @@ -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. @@ -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"); }); }); diff --git a/requirements.in b/requirements.in index cd6ab2002..031eddc5c 100644 --- a/requirements.in +++ b/requirements.in @@ -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