Skip to content

Commit

Permalink
Adapted unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Mar 20, 2023
1 parent 8810013 commit 075450b
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions web/src/components/network/NetworkPage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,29 +82,6 @@ describe("NetworkPage", () => {
within(section).getByText("192.168.69.200/24");
});

describe("when WiFi scan is supported", () => {
beforeEach(() => {
settingsFn.mockReturnValue({ ...networkSettings, wifiScanSupported: true });
});

it("displays a link for scanning other WiFi networks", async () => {
installerRender(<NetworkPage />);

const heading = await screen.findByRole("heading", { name: "WiFi networks" });
const section = heading.closest("section");
const scanWifiButton = within(section).getByRole("button", { name: "Connect to a Wi-Fi network" });
expect(scanWifiButton.classList.contains("pf-m-link")).toBe(true);
});

it("opens the WiFi selector dialog when user clicks for scanning WiFi networks", async () => {
const { user } = installerRender(<NetworkPage />);
const link = await screen.findByRole("button", { name: "Connect to a Wi-Fi network" });
await user.click(link);
const wifiDialog = await screen.findByRole("dialog");
within(wifiDialog).getByText("Connect to a Wi-Fi network");
});
});

describe("when no wired connection is detected", () => {
beforeEach(() => {
activeConnectionsFn.mockReturnValue([wiFiConnection]);
Expand Down

0 comments on commit 075450b

Please sign in to comment.