fix(ci): replace userEvent.selectOptions with fireEvent.change; bump setup-node to v6

userEvent.selectOptions hangs in jsdom when firing pointer + change event
sequences — fireEvent.change fires the React-controlled onChange directly
and is deterministic. Removes userEvent import (no longer used).

Bump actions/setup-node from v4 to v6 to clear the Node.js 20 deprecation
warning on GitHub Actions runners.
This commit is contained in:
Offending Commit
2026-06-03 16:41:40 -05:00
parent e66f927f89
commit 1c28cae3f2
2 changed files with 4 additions and 5 deletions

View File

@@ -1,7 +1,6 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { createMemoryHistory, createRouter, RouterProvider } from "@tanstack/react-router";
import { render, screen, waitFor, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { fireEvent, render, screen, waitFor, within } from "@testing-library/react";
import { afterEach, describe, expect, it, vi } from "vitest";
import { DemoProvider } from "@/context/DemoContext";
import { MetadataProvider } from "@/context/MetadataContext";
@@ -77,10 +76,10 @@ describe("Dashboard — unified server-aware view", () => {
it("narrows to a single server when filtered", async () => {
saveStore({ instances: [neo, iris], activeId: "neo" });
const user = userEvent.setup();
renderDashboard();
await screen.findByText("(Iris)");
await user.selectOptions(await screen.findByLabelText("Filter by server"), "iris");
const select = await screen.findByLabelText("Filter by server");
fireEvent.change(select, { target: { value: "iris" } });
await waitFor(() => {
expect(screen.queryByText("(Neo)")).not.toBeInTheDocument();
expect(screen.getByText("(Iris)")).toBeInTheDocument();