diff --git a/web/package/agama-web-ui.changes b/web/package/agama-web-ui.changes index 37911efdb0..001b5f0488 100644 --- a/web/package/agama-web-ui.changes +++ b/web/package/agama-web-ui.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 22 09:07:28 UTC 2025 - David Diaz + +- Do not crash when navigating to a Wi-Fi network (bsc#1243415) + ------------------------------------------------------------------- Mon May 19 13:38:16 UTC 2025 - David Diaz diff --git a/web/src/components/network/WifiNetworksList.test.tsx b/web/src/components/network/WifiNetworksList.test.tsx index 3c52f2b65b..c3d53a812b 100644 --- a/web/src/components/network/WifiNetworksList.test.tsx +++ b/web/src/components/network/WifiNetworksList.test.tsx @@ -21,7 +21,7 @@ import React from "react"; import { screen } from "@testing-library/react"; -import { installerRender } from "~/test-utils"; +import { installerRender, mockNavigateFn } from "~/test-utils"; import WifiNetworksList from "~/components/network/WifiNetworksList"; import { Connection, @@ -132,6 +132,16 @@ describe("WifiNetworksList", () => { screen.getByRole("progressbar", { name: "Connecting to Network 2" }); }); + describe("and user selects a network", () => { + it("navigates to the Wi-Fi network path including the expected SSID", async () => { + // @ts-expect-error: you need to specify the aria-label + const { user } = installerRender(); + const network1 = screen.getByLabelText("Secured network Network 1 Weak signal"); + await user.click(network1); + expect(mockNavigateFn).toHaveBeenCalledWith(expect.stringContaining("Network 1")); + }); + }); + describe.skip("and user selects a connected network", () => { it("renders basic network information and actions instead of the connection form", async () => { // @ts-expect-error: you need to specify the aria-label diff --git a/web/src/components/network/WifiNetworksList.tsx b/web/src/components/network/WifiNetworksList.tsx index ced47f4767..a099167551 100644 --- a/web/src/components/network/WifiNetworksList.tsx +++ b/web/src/components/network/WifiNetworksList.tsx @@ -113,7 +113,7 @@ const NetworkListItem = ({ network, connection, showIp }: NetworkListItemProps) const ipId = useId(); return ( - +